Patchwork [12,of,12,V2] largefiles: remove no more referred "getoutgoinglfiles()"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 15, 2014, 3:52 p.m.
Message ID <4887a52fe6fea96eb018.1397577153@juju>
Download mbox | patch
Permalink /patch/4370/
State Accepted
Commit d384ce982a51e8631da597eb53a9b75fef01a029
Headers show

Comments

Katsunori FUJIWARA - April 15, 2014, 3:52 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1397576244 -32400
#      Wed Apr 16 00:37:24 2014 +0900
# Node ID 4887a52fe6fea96eb018ef03e55ca58070ba9650
# Parent  cca25a4c3c8eb6f712cf7a035cf6177000bd09cb
largefiles: remove no more referred "getoutgoinglfiles()"
Siddharth Agarwal - April 15, 2014, 7:36 p.m.
On 04/15/2014 08:52 AM, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1397576244 -32400
> #      Wed Apr 16 00:37:24 2014 +0900
> # Node ID 4887a52fe6fea96eb018ef03e55ca58070ba9650
> # Parent  cca25a4c3c8eb6f712cf7a035cf6177000bd09cb
> largefiles: remove no more referred "getoutgoinglfiles()"

Queued for default, thanks.

>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -12,7 +12,7 @@
>   import copy
>   
>   from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \
> -        archival, error, merge, discovery, pathutil, revset
> +        archival, merge, pathutil, revset
>   from mercurial.i18n import _
>   from mercurial.node import hex
>   from hgext import rebase
> @@ -983,28 +983,6 @@
>   
>       return result
>   
> -def getoutgoinglfiles(ui, repo, dest=None, **opts):
> -    dest = ui.expandpath(dest or 'default-push', dest or 'default')
> -    dest, branches = hg.parseurl(dest, opts.get('branch'))
> -    revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
> -    if revs:
> -        revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
> -
> -    try:
> -        remote = hg.peer(repo, opts, dest)
> -    except error.RepoError:
> -        return None
> -    outgoing = discovery.findcommonoutgoing(repo, remote.peer(), force=False)
> -    if not outgoing.missing:
> -        return outgoing.missing
> -    o = repo.changelog.nodesbetween(outgoing.missing, revs)[0]
> -    if opts.get('newest_first'):
> -        o.reverse()
> -
> -    toupload = set()
> -    lfutil.getlfilestoupload(repo, o, lambda fn, lfhash: toupload.add(fn))
> -    return sorted(toupload)
> -
>   def outgoinghook(ui, repo, other, opts, missing):
>       if opts.pop('large', None):
>           toupload = set()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Mads Kiilerich - April 15, 2014, 9:17 p.m.
On 04/15/2014 09:36 PM, Siddharth Agarwal wrote:
> On 04/15/2014 08:52 AM, FUJIWARA Katsunori wrote:
>> # HG changeset patch
>> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
>> # Date 1397576244 -32400
>> #      Wed Apr 16 00:37:24 2014 +0900
>> # Node ID 4887a52fe6fea96eb018ef03e55ca58070ba9650
>> # Parent  cca25a4c3c8eb6f712cf7a035cf6177000bd09cb
>> largefiles: remove no more referred "getoutgoinglfiles()"
>
> Queued for default, thanks.

A nice patch series with some nice refactorings and improvements. It 
looks good to me too. Thanks!

/Mads

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -12,7 +12,7 @@ 
 import copy
 
 from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \
-        archival, error, merge, discovery, pathutil, revset
+        archival, merge, pathutil, revset
 from mercurial.i18n import _
 from mercurial.node import hex
 from hgext import rebase
@@ -983,28 +983,6 @@ 
 
     return result
 
-def getoutgoinglfiles(ui, repo, dest=None, **opts):
-    dest = ui.expandpath(dest or 'default-push', dest or 'default')
-    dest, branches = hg.parseurl(dest, opts.get('branch'))
-    revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
-    if revs:
-        revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
-
-    try:
-        remote = hg.peer(repo, opts, dest)
-    except error.RepoError:
-        return None
-    outgoing = discovery.findcommonoutgoing(repo, remote.peer(), force=False)
-    if not outgoing.missing:
-        return outgoing.missing
-    o = repo.changelog.nodesbetween(outgoing.missing, revs)[0]
-    if opts.get('newest_first'):
-        o.reverse()
-
-    toupload = set()
-    lfutil.getlfilestoupload(repo, o, lambda fn, lfhash: toupload.add(fn))
-    return sorted(toupload)
-
 def outgoinghook(ui, repo, other, opts, missing):
     if opts.pop('large', None):
         toupload = set()