##// END OF EJS Templates
transaction: abstract away the detection of an abandoned transaction...
Raphaël Gomès -
r51881:cf47b83d default
parent child Browse files
Show More
@@ -59,6 +59,11 b' UNDO_FILES_MAY_NEED_CLEANUP = ['
59 ]
59 ]
60
60
61
61
62 def has_abandoned_transaction(repo):
63 """Return True if the repo has an abandoned transaction"""
64 return os.path.exists(repo.sjoin(b"journal"))
65
66
62 def cleanup_undo_files(report, vfsmap, undo_prefix=b'undo'):
67 def cleanup_undo_files(report, vfsmap, undo_prefix=b'undo'):
63 """remove "undo" files used by the rollback logic
68 """remove "undo" files used by the rollback logic
64
69
@@ -17,6 +17,7 b' from . import ('
17 pycompat,
17 pycompat,
18 requirements,
18 requirements,
19 revlog,
19 revlog,
20 transaction,
20 util,
21 util,
21 )
22 )
22
23
@@ -195,7 +196,7 b' class verifier:'
195 if not repo.url().startswith(b'file:'):
196 if not repo.url().startswith(b'file:'):
196 raise error.Abort(_(b"cannot verify bundle or remote repos"))
197 raise error.Abort(_(b"cannot verify bundle or remote repos"))
197
198
198 if os.path.exists(repo.sjoin(b"journal")):
199 if transaction.has_abandoned_transaction(repo):
199 ui.warn(_(b"abandoned transaction found - run hg recover\n"))
200 ui.warn(_(b"abandoned transaction found - run hg recover\n"))
200
201
201 if ui.verbose or not self.revlogv1:
202 if ui.verbose or not self.revlogv1:
General Comments 0
You need to be logged in to leave comments. Login now