[PATCH 1 of 1] This fixes a bug that Chris Mason found. As for a test case, I can't

Eric Hopper hopper at omnifarious.org
Fri Jan 20 17:39:00 UTC 2006


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Node ID 5ecf05541e111897c2dd5b8e5a06b0a7790a251c
# Parent  11cd38286fdbd87402a16058c1d8b1afc5636bbe
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.

diff -r 11cd38286fdb -r 5ecf05541e11 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)
 



More information about the Mercurial mailing list