diff mercurial/localrepo.py @ 7460:3342e6ada4b9

push: use the fast changegroup() path on push The race doesn't happen on push (because the discovery is done in the same hg process), so use the fast path instead.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 02 Dec 2008 19:36:43 +0100
parents 5e13df32fb74
children f1af59451c0c
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Dec 01 10:45:22 2008 -0500
+++ b/mercurial/localrepo.py	Tue Dec 02 19:36:43 2008 +0100
@@ -1496,11 +1496,11 @@
         return self.push_addchangegroup(remote, force, revs)
 
     def prepush(self, remote, force, revs):
-        base = {}
+        common = {}
         remote_heads = remote.heads()
-        inc = self.findincoming(remote, base, remote_heads, force=force)
+        inc = self.findincoming(remote, common, remote_heads, force=force)
 
-        update, updated_heads = self.findoutgoing(remote, base, remote_heads)
+        update, updated_heads = self.findoutgoing(remote, common, remote_heads)
         if revs is not None:
             msng_cl, bases, heads = self.changelog.nodesbetween(update, revs)
         else:
@@ -1546,7 +1546,8 @@
 
 
         if revs is None:
-            cg = self.changegroup(update, 'push')
+            # use the fast path, no race possible on push
+            cg = self._changegroup(common.keys(), 'push')
         else:
             cg = self.changegroupsubset(update, revs, 'push')
         return cg, remote_heads