largefiles: remove findoutgoing portability wrapper
authorMads Kiilerich <madski@unity3d.com>
Thu, 13 Dec 2012 19:19:06 +0100
changeset 18152 4454607b5d25
parent 18151 90ad387d9245
child 18153 51837a31b425
largefiles: remove findoutgoing portability wrapper
hgext/largefiles/lfutil.py
hgext/largefiles/overrides.py
hgext/largefiles/reposetup.py
--- a/hgext/largefiles/lfutil.py	Thu Dec 13 19:19:06 2012 +0100
+++ b/hgext/largefiles/lfutil.py	Thu Dec 13 19:19:06 2012 +0100
@@ -47,11 +47,6 @@
     forget = repo[None].forget
     return forget(list)
 
-def findoutgoing(repo, remote, force):
-    from mercurial import discovery
-    outgoing = discovery.findcommonoutgoing(repo, remote.peer(), force=force)
-    return outgoing.missing
-
 # -- Private worker functions ------------------------------------------
 
 def getminsize(ui, assumelfiles, opt, default=10):
--- a/hgext/largefiles/overrides.py	Thu Dec 13 19:19:06 2012 +0100
+++ b/hgext/largefiles/overrides.py	Thu Dec 13 19:19:06 2012 +0100
@@ -12,7 +12,7 @@
 import copy
 
 from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \
-    node, archival, error, merge
+    node, archival, error, merge, discovery
 from mercurial.i18n import _
 from mercurial.node import hex
 from hgext import rebase
@@ -976,10 +976,10 @@
         remote = hg.peer(repo, opts, dest)
     except error.RepoError:
         return None
-    o = lfutil.findoutgoing(repo, remote, False)
-    if not o:
-        return o
-    o = repo.changelog.nodesbetween(o, revs)[0]
+    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()
 
--- a/hgext/largefiles/reposetup.py	Thu Dec 13 19:19:06 2012 +0100
+++ b/hgext/largefiles/reposetup.py	Thu Dec 13 19:19:06 2012 +0100
@@ -11,7 +11,8 @@
 import types
 import os
 
-from mercurial import context, error, manifest, match as match_, util
+from mercurial import context, error, manifest, match as match_, util, \
+    discovery
 from mercurial import node as node_
 from mercurial.i18n import _
 from mercurial import localrepo
@@ -404,10 +405,11 @@
                 wlock.release()
 
         def push(self, remote, force=False, revs=None, newbranch=False):
-            o = lfutil.findoutgoing(self, remote, force)
-            if o:
+            outgoing = discovery.findcommonoutgoing(repo, remote.peer(),
+                                                    force=force)
+            if outgoing.missing:
                 toupload = set()
-                o = self.changelog.nodesbetween(o, revs)[0]
+                o = self.changelog.nodesbetween(outgoing.missing, revs)[0]
                 for n in o:
                     parents = [p for p in self.changelog.parents(n)
                                if p != node_.nullid]