debugobsolete: catch ValueError that may be raised by obsstore.create stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 14 Aug 2014 14:57:03 -0700
branchstable
changeset 22176 328efb5ca0b4
parent 22172 989c16c1b050
child 22177 a56038e6a3c9
debugobsolete: catch ValueError that may be raised by obsstore.create There are already a couple of errors that obsstore.create can raise and we are going to introduce a cycle check too.
mercurial/commands.py
--- a/mercurial/commands.py	Thu Aug 14 16:18:45 2014 -0500
+++ b/mercurial/commands.py	Thu Aug 14 14:57:03 2014 -0700
@@ -2338,9 +2338,12 @@
         try:
             tr = repo.transaction('debugobsolete')
             try:
-                repo.obsstore.create(tr, parsenodeid(precursor), succs,
-                                     opts['flags'], metadata)
-                tr.close()
+                try:
+                    repo.obsstore.create(tr, parsenodeid(precursor), succs,
+                                         opts['flags'], metadata)
+                    tr.close()
+                except ValueError, exc:
+                    raise util.Abort(_('bad obsmarker input: %s') % exc)
             finally:
                 tr.release()
         finally: