repair: use ProgrammingError
authorJun Wu <quark@fb.com>
Sun, 26 Mar 2017 16:53:28 -0700
changeset 31645 7095e783958d
parent 31644 f80d9ddc40f3
child 31646 e960eba3581c
repair: use ProgrammingError
mercurial/repair.py
tests/test-devel-warnings.t
--- a/mercurial/repair.py	Sun Mar 26 16:33:12 2017 +0900
+++ b/mercurial/repair.py	Sun Mar 26 16:53:28 2017 -0700
@@ -163,8 +163,7 @@
     curtr = repo.currenttransaction()
     if curtr is not None:
         del curtr  # avoid carrying reference to transaction for nothing
-        msg = _('programming error: cannot strip from inside a transaction')
-        raise error.Abort(msg, hint=_('contact your extension maintainer'))
+        raise error.ProgrammingError('cannot strip from inside a transaction')
 
     try:
         with repo.transaction("strip") as tr:
--- a/tests/test-devel-warnings.t	Sun Mar 26 16:33:12 2017 +0900
+++ b/tests/test-devel-warnings.t	Sun Mar 26 16:53:28 2017 -0700
@@ -106,11 +106,10 @@
   $ echo a > a
   $ hg add a
   $ hg commit -m a
-  $ hg stripintr
+  $ hg stripintr 2>&1 | egrep -v '^(\*\*|  )'
   saved backup bundle to $TESTTMP/lock-checker/.hg/strip-backup/*-backup.hg (glob)
-  abort: programming error: cannot strip from inside a transaction
-  (contact your extension maintainer)
-  [255]
+  Traceback (most recent call last):
+  mercurial.error.ProgrammingError: cannot strip from inside a transaction
 
   $ hg log -r "oldstyle()" -T '{rev}\n'
   devel-warn: revset "oldstyle" uses list instead of smartset