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.
--- 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: