diff mercurial/commands.py @ 22176:328efb5ca0b4 stable

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 14 Aug 2014 14:57:03 -0700
parents 42b1344656f7
children 8dda6f6ff564 9472284df4eb
line wrap: on
line diff
--- 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: