Patchwork D9215: transaction: use ProgrammingError for when an committed transaction is used

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2020, 6:02 a.m.
Message ID <differential-rev-PHID-DREV-or4osihza2ttuqv65nrs-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47474/
State Superseded
Headers show

Comments

phabricator - Oct. 16, 2020, 6:02 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It seems to me that ProgrammingError is the right type of error here.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9215

AFFECTED FILES
  mercurial/transaction.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -38,10 +38,8 @@ 
 def active(func):
     def _active(self, *args, **kwds):
         if self._count == 0:
-            raise error.Abort(
-                _(
-                    b'cannot use transaction when it is already committed/aborted'
-                )
+            raise error.ProgrammingError(
+                b'cannot use transaction when it is already committed/aborted'
             )
         return func(self, *args, **kwds)