Patchwork [1,of,2] largefiles: don't explicitly list optional parameters that are not used

login
register
mail settings
Submitter Tony Tung
Date Feb. 23, 2016, 8:13 a.m.
Message ID <cbc605f28b61cc469e21.1456215239@dev8692.prn1.facebook.com>
Download mbox | patch
Permalink /patch/13304/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Tony Tung - Feb. 23, 2016, 8:13 a.m.
# HG changeset patch
# User Tony Tung <tonytung@merly.org>
# Date 1456211899 28800
#      Mon Feb 22 23:18:19 2016 -0800
# Node ID cbc605f28b61cc469e21186982d0569bf94f7d2a
# Parent  169a238c641540d1e78797fbce0f2599e60c85f6
largefiles: don't explicitly list optional parameters that are not used

This makes it easier for changes to the API.
Martin von Zweigbergk - Feb. 23, 2016, 6:48 p.m.
On Tue, Feb 23, 2016 at 12:13 AM, Tony Tung <ttung@fb.com> wrote:
> # HG changeset patch
> # User Tony Tung <tonytung@merly.org>
> # Date 1456211899 28800
> #      Mon Feb 22 23:18:19 2016 -0800
> # Node ID cbc605f28b61cc469e21186982d0569bf94f7d2a
> # Parent  169a238c641540d1e78797fbce0f2599e60c85f6
> largefiles: don't explicitly list optional parameters that are not used
>
> This makes it easier for changes to the API.
>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -452,12 +452,12 @@
>  # writing the files into the working copy and lfcommands.updatelfiles
>  # will update the largefiles.
>  def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
> -                             acceptremote, followcopies, matcher=None,
> -                             mergeforce=False):
> +                             acceptremote, followcopies,
> +                             *args, **kwargs):
>      overwrite = force and not branchmerge
>      actions, diverge, renamedelete = origfn(
>          repo, p1, p2, pas, branchmerge, force, acceptremote,
> -        followcopies, matcher=matcher)
> +        followcopies, *args, **kwargs)

"followcopies" also seems unused
Martin von Zweigbergk - Feb. 23, 2016, 6:55 p.m.
On Tue, Feb 23, 2016 at 10:48 AM, Martin von Zweigbergk
<martinvonz@google.com> wrote:
> On Tue, Feb 23, 2016 at 12:13 AM, Tony Tung <ttung@fb.com> wrote:
>> # HG changeset patch
>> # User Tony Tung <tonytung@merly.org>
>> # Date 1456211899 28800
>> #      Mon Feb 22 23:18:19 2016 -0800
>> # Node ID cbc605f28b61cc469e21186982d0569bf94f7d2a
>> # Parent  169a238c641540d1e78797fbce0f2599e60c85f6
>> largefiles: don't explicitly list optional parameters that are not used
>>
>> This makes it easier for changes to the API.
>>
>> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
>> --- a/hgext/largefiles/overrides.py
>> +++ b/hgext/largefiles/overrides.py
>> @@ -452,12 +452,12 @@
>>  # writing the files into the working copy and lfcommands.updatelfiles
>>  # will update the largefiles.
>>  def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
>> -                             acceptremote, followcopies, matcher=None,
>> -                             mergeforce=False):
>> +                             acceptremote, followcopies,
>> +                             *args, **kwargs):
>>      overwrite = force and not branchmerge
>>      actions, diverge, renamedelete = origfn(
>>          repo, p1, p2, pas, branchmerge, force, acceptremote,
>> -        followcopies, matcher=matcher)
>> +        followcopies, *args, **kwargs)
>
> "followcopies" also seems unused

Tests pass after I dropped it, so I'll just go ahead and push this to
the clowncopter. Thanks!
Augie Fackler - Feb. 23, 2016, 7:30 p.m.
On Tue, Feb 23, 2016 at 12:13:59AM -0800, Tony Tung wrote:
> # HG changeset patch
> # User Tony Tung <tonytung@merly.org>
> # Date 1456211899 28800
> #      Mon Feb 22 23:18:19 2016 -0800
> # Node ID cbc605f28b61cc469e21186982d0569bf94f7d2a
> # Parent  169a238c641540d1e78797fbce0f2599e60c85f6
> largefiles: don't explicitly list optional parameters that are not used

Queued this one, waiting for feedback from others on patch 2.

>
> This makes it easier for changes to the API.
>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -452,12 +452,12 @@
>  # writing the files into the working copy and lfcommands.updatelfiles
>  # will update the largefiles.
>  def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
> -                             acceptremote, followcopies, matcher=None,
> -                             mergeforce=False):
> +                             acceptremote, followcopies,
> +                             *args, **kwargs):
>      overwrite = force and not branchmerge
>      actions, diverge, renamedelete = origfn(
>          repo, p1, p2, pas, branchmerge, force, acceptremote,
> -        followcopies, matcher=matcher)
> +        followcopies, *args, **kwargs)
>
>      if overwrite:
>          return actions, diverge, renamedelete
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -452,12 +452,12 @@ 
 # writing the files into the working copy and lfcommands.updatelfiles
 # will update the largefiles.
 def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
-                             acceptremote, followcopies, matcher=None,
-                             mergeforce=False):
+                             acceptremote, followcopies,
+                             *args, **kwargs):
     overwrite = force and not branchmerge
     actions, diverge, renamedelete = origfn(
         repo, p1, p2, pas, branchmerge, force, acceptremote,
-        followcopies, matcher=matcher)
+        followcopies, *args, **kwargs)
 
     if overwrite:
         return actions, diverge, renamedelete