diff hgext/convert/filemap.py @ 19862:42455ebbab9f

convert: fix crash when filemap filtering is changed
author Mads Kiilerich <madski@unity3d.com>
date Wed, 02 Oct 2013 19:46:47 +0200
parents e4da793998bf
children daeab82fa644
line wrap: on
line diff
--- a/hgext/convert/filemap.py	Tue Oct 01 14:48:53 2013 -0400
+++ b/hgext/convert/filemap.py	Wed Oct 02 19:46:47 2013 +0200
@@ -231,8 +231,8 @@
                 continue
             self.seenchildren[r] = self.seenchildren.get(r, 0) + 1
             if self.seenchildren[r] == self.children[r]:
-                del self.wantedancestors[r]
-                del self.parentmap[r]
+                self.wantedancestors.pop(r, None)
+                self.parentmap.pop(r, None)
                 del self.seenchildren[r]
                 if self._rebuilt:
                     del self.children[r]
@@ -281,7 +281,11 @@
         # of wanted ancestors of its parents. Plus rev itself.
         wrev = set()
         for p in parents:
-            wrev.update(self.wantedancestors[p])
+            if p in self.wantedancestors:
+                wrev.update(self.wantedancestors[p])
+            else:
+                self.ui.warn(_('warning: %s parent %s is missing\n') %
+                             (rev, p))
         wrev.add(rev)
         self.wantedancestors[rev] = wrev