This fixes a bug that Chris Mason found. As for a test case, I can't
authorEric Hopper <hopper@omnifarious.org>
Fri, 20 Jan 2006 09:35:43 -0800
changeset 1630 5ecf05541e11
parent 1627 11cd38286fdb
child 1632 3f214984fd9e
This fixes a bug that Chris Mason found. As for a test case, I can't think of one. It's a very weird case. Basically, if there is a file listed as changed in the changelog entry, but not showing up in any of the associated manifest entries, hg would abort when trying to create a changeset. Now it just decides the file must not have any versions relevant to the changeset.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Jan 18 17:07:48 2006 +0100
+++ b/mercurial/localrepo.py	Fri Jan 20 09:35:43 2006 -0800
@@ -1202,8 +1202,11 @@
                 filerevlog = self.file(fname)
                 # Toss out the filenodes that the recipient isn't really
                 # missing.
-                prune_filenodes(fname, filerevlog)
-                msng_filenode_lst = msng_filenode_set[fname].keys()
+                if msng_filenode_set.has_key(fname):
+                    prune_filenodes(fname, filerevlog)
+                    msng_filenode_lst = msng_filenode_set[fname].keys()
+                else:
+                    msng_filenode_lst = []
                 # If any filenodes are left, generate the group for them,
                 # otherwise don't bother.
                 if len(msng_filenode_lst) > 0:
@@ -1217,8 +1220,9 @@
                                              lookup_filenode_link_func(fname))
                     for chnk in group:
                         yield chnk
-                # Don't need this anymore, toss it to free memory.
-                del msng_filenode_set[fname]
+                if msng_filenode_set.has_key(fname):
+                    # Don't need this anymore, toss it to free memory.
+                    del msng_filenode_set[fname]
             # Signal that no more groups are left.
             yield struct.pack(">l", 0)