Fix linking of changeset revs when merging
authoroxymoron@cinder.waste.org
Tue, 03 May 2005 23:37:43 -0800
changeset 10 e76ed1e480ef
parent 9 b4d0c3786ad3
child 11 7f16aaeed62f
Fix linking of changeset revs when merging
mercurial/hg.py
--- a/mercurial/hg.py	Tue May 03 18:51:52 2005 -0800
+++ b/mercurial/hg.py	Tue May 03 23:37:43 2005 -0800
@@ -289,18 +289,19 @@
         tr = self.transaction()
         changed = {}
         new = {}
-        nextrev = seqrev = self.changelog.count()
+        seqrev = self.changelog.count()
+        # some magic to allow fiddling in nested scope
+        nextrev = [seqrev]
 
         # helpers for back-linking file revisions to local changeset
         # revisions so we can immediately get to changeset from annotate
         def accumulate(text):
-            n = nextrev
             # track which files are added in which changeset and the
             # corresponding _local_ changeset revision
             files = self.changelog.extract(text)[3]
             for f in files:
-                changed.setdefault(f, []).append(n)
-            n += 1
+                changed.setdefault(f, []).append(nextrev[0])
+            nextrev[0] += 1
 
         def seq(start):
             while 1: