Commits

Pierre-Yves David  committed 37b5432

obsolete: better lookuperror handling during convert

  • Participants
  • Parent commits 3853061

Comments (0)

Files changed (1)

File hgext/obsolete.py

                 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'])