Comment 5 for bug 304134

Revision history for this message
Wesley J. Landaker (wjl) wrote : Re: KeyError when updating lightweight bzr-svn checkout

Okay, this is *TOTAL MINDLESS HACK AND SLASH*, but for kicks I tried to just ignore the errors with the following patch and see what else fails. But as far as I can tell, everything appears to be "working". Again, this is provided in case this gives information about the root cause. I don't think this is actually a correct way to fix this. (You probably know that better than me!)

--- /usr/lib/python2.5/site-packages/bzrlib/plugins/svn/fileids.py.orig 2008-12-03 09:04:05.000000000 -0700
+++ /usr/lib/python2.5/site-packages/bzrlib/plugins/svn/fileids.py 2008-12-03 09:05:28.000000000 -0700
@@ -188,11 +188,17 @@
         """
         for p in changes:
             if changes[p][0] == 'M' and not delta.has_key(p):
- delta[p] = map[p][0]
+ try:
+ delta[p] = map[p][0]
+ except KeyError:
+ pass

         for x in sorted(delta.keys(), reverse=True):
             if delta[x] is None:
- del map[x]
+ try:
+ del map[x]
+ except KeyError:
+ pass
                 for p in map.keys():
                     if p.startswith(u"%s/" % x):
                         del map[p]