Bug in localrepository.changes( )

Matt Mackall mpm at selenic.com
Fri Jul 1 22:32:41 UTC 2005


On Sat, Jul 02, 2005 at 12:11:50AM +0200, Goffredo Baroncelli wrote:
> the 'or' should be an 'and': otherwise if a file is changed in the wd _and_
> between the 'tip' and the revision 'node1', the file is added two times to the 'c' 
> list.

No, that logic is right. What's needed is to flush out the c and a
lists.

--- a/mercurial/hg.py   Fri Jul  1 22:18:02 2005
+++ b/mercurial/hg.py   Fri Jul  1 15:32:08 2005
@@ -686,8 +686,7 @@
         self.dirstate.forget(remove)

     def changes(self, node1, node2, files=None):
-        # changed, added, deleted, unknown
-        c, a, d, u, mf2 = [], [], [], [], None
+        mf2, u = None, []

         def fcmp(fn, mf):
             t1 = self.wfile(fn).read()
@@ -726,6 +725,9 @@
         else:
             change = self.changelog.read(node2)
             mf2 = self.manifest.read(change[0])
+
+        # flush lists from dirstate before comparing manifests
+        c, a = [], []

         change = self.changelog.read(node1)
         mf1 = self.manifest.read(change[0]).copy()

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list