obsolete: better lookuperror handling during convert stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 06 Jul 2012 16:32:53 +0200
branchstable
changeset 340 37b543215187
parent 339 3853061e7fea
child 341 7653f80fd7a4
obsolete: better lookuperror handling during convert
hgext/obsolete.py
--- a/hgext/obsolete.py	Fri Jul 06 16:25:06 2012 +0200
+++ b/hgext/obsolete.py	Fri Jul 06 16:32:53 2012 +0200
@@ -605,15 +605,16 @@
                 del oldmark['reason']  # unused until then
                 oldobject = str(oldmark.pop('object'))
                 oldsubjects = [str(s) for s in oldmark.pop('subjects')]
+                LOOKUP_ERRORS = (error.RepoLookupError, error.LookupError)
                 if len(oldobject) != 40:
                     try:
                         oldobject = repo[oldobject].node()
-                    except error.RepoLookupError:
+                    except LOOKUP_ERRORS:
                         pass
                 if any(len(s) != 40 for s in oldsubjects):
                     try:
                         oldsubjects = [repo[s].node() for s in oldsubjects]
-                    except error.RepoLookupError:
+                    except LOOKUP_ERRORS:
                         pass
 
                 oldmark['date'] = '%i %i' % tuple(oldmark['date'])