--- a/mercurial/repair.py Mon Jun 19 13:13:28 2017 -0700
+++ b/mercurial/repair.py Mon Jun 19 13:18:00 2017 -0700
@@ -79,6 +79,9 @@
# This function requires the caller to lock the repo, but it operates
# within a transaction of its own, and thus requires there to be no current
# transaction when it is called.
+ if repo.currenttransaction() is not None:
+ raise error.ProgrammingError('cannot strip from inside a transaction')
+
# Simple way to maintain backwards compatibility for this
# argument.
if backup in ['none', 'strip']:
@@ -168,9 +171,6 @@
mfst = repo.manifestlog._revlog
- if repo.currenttransaction() is not None:
- raise error.ProgrammingError('cannot strip from inside a transaction')
-
try:
with repo.transaction("strip") as tr:
offset = len(tr.entries)