[PATCH 5 of 6] localrepo: use more direct vars in addchangegroup

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Thu May 14 09:27:37 CDT 2009


# HG changeset patch
# User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
# Date 1242310305 -7200
# Node ID cd6d60858ce30796da62e491d6cce591cf759529
# Parent  771dce40fc56600bf4b01f6ace41e4cecf80a19e
localrepo: use more direct vars in addchangegroup

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2020,12 +2020,12 @@
             trp = weakref.proxy(tr)
             # pull off the changeset group
             self.ui.status(_("adding changesets\n"))
-            cor = len(cl) - 1
+            clstart = len(cl)
             chunkiter = changegroup.chunkiter(source)
             if cl.addgroup(chunkiter, csmap, trp) is None and not emptyok:
                 raise util.Abort(_("received changelog group is empty"))
-            cnr = len(cl) - 1
-            changesets = cnr - cor
+            clend = len(cl)
+            changesets = clend - clstart
 
             # pull off the manifest group
             self.ui.status(_("adding manifests\n"))
@@ -2063,7 +2063,7 @@
             if changesets > 0:
                 p = lambda: cl.writepending() and self.root or ""
                 self.hook('pretxnchangegroup', throw=True,
-                          node=hex(cl.node(cor+1)), source=srctype,
+                          node=hex(cl.node(clstart)), source=srctype,
                           url=url, pending=p)
 
             # make changelog see real files again
@@ -2077,10 +2077,10 @@
             # forcefully update the on-disk branch cache
             self.ui.debug(_("updating the branch cache\n"))
             self.branchtags()
-            self.hook("changegroup", node=hex(cl.node(cor+1)),
+            self.hook("changegroup", node=hex(cl.node(clstart)),
                       source=srctype, url=url)
 
-            for i in xrange(cor + 1, cnr + 1):
+            for i in xrange(clstart, clend):
                 self.hook("incoming", node=hex(cl.node(i)),
                           source=srctype, url=url)
 


More information about the Mercurial-devel mailing list