localrepo: use more direct vars in addchangegroup
authorPeter Arrenbrecht <peter.arrenbrecht@gmail.com>
Thu, 14 May 2009 16:11:45 +0200
changeset 8393 59160ca338f7
parent 8392 7e5cbb09515b
child 8394 850b5a7c210d
localrepo: use more direct vars in addchangegroup
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu May 14 16:09:27 2009 +0200
+++ b/mercurial/localrepo.py	Thu May 14 16:11:45 2009 +0200
@@ -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)