##// END OF EJS Templates
repair: move check for existing transaction earlier...
Martin von Zweigbergk -
r32924:f044295c default
parent child Browse files
Show More
@@ -79,6 +79,9 b' def strip(ui, repo, nodelist, backup=Tru'
79 # This function requires the caller to lock the repo, but it operates
79 # This function requires the caller to lock the repo, but it operates
80 # within a transaction of its own, and thus requires there to be no current
80 # within a transaction of its own, and thus requires there to be no current
81 # transaction when it is called.
81 # transaction when it is called.
82 if repo.currenttransaction() is not None:
83 raise error.ProgrammingError('cannot strip from inside a transaction')
84
82 # Simple way to maintain backwards compatibility for this
85 # Simple way to maintain backwards compatibility for this
83 # argument.
86 # argument.
84 if backup in ['none', 'strip']:
87 if backup in ['none', 'strip']:
@@ -168,9 +171,6 b' def strip(ui, repo, nodelist, backup=Tru'
168
171
169 mfst = repo.manifestlog._revlog
172 mfst = repo.manifestlog._revlog
170
173
171 if repo.currenttransaction() is not None:
172 raise error.ProgrammingError('cannot strip from inside a transaction')
173
174 try:
174 try:
175 with repo.transaction("strip") as tr:
175 with repo.transaction("strip") as tr:
176 offset = len(tr.entries)
176 offset = len(tr.entries)
@@ -108,7 +108,6 b''
108 $ hg add a
108 $ hg add a
109 $ hg commit -m a
109 $ hg commit -m a
110 $ hg stripintr 2>&1 | egrep -v '^(\*\*| )'
110 $ hg stripintr 2>&1 | egrep -v '^(\*\*| )'
111 saved backup bundle to $TESTTMP/lock-checker/.hg/strip-backup/*-backup.hg (glob)
112 Traceback (most recent call last):
111 Traceback (most recent call last):
113 mercurial.error.ProgrammingError: cannot strip from inside a transaction
112 mercurial.error.ProgrammingError: cannot strip from inside a transaction
114
113
General Comments 0
You need to be logged in to leave comments. Login now