Mercurial > public > mercurial-scm > hg
comparison mercurial/transaction.py @ 50985:cf47b83d8ad0
transaction: abstract away the detection of an abandoned transaction
We're about to add another place where this is used, let's not spill this
implementation detail.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Wed, 13 Sep 2023 12:25:51 +0200 |
parents | 6408777c8fa4 |
children | f4733654f144 |
comparison
equal
deleted
inserted
replaced
50984:727428c7e1fc | 50985:cf47b83d8ad0 |
---|---|
55 (b'plain', b'%s.desc'), | 55 (b'plain', b'%s.desc'), |
56 # Always delete undo last to make sure we detect that a clean up is needed if | 56 # Always delete undo last to make sure we detect that a clean up is needed if |
57 # the process is interrupted. | 57 # the process is interrupted. |
58 (b'store', b'%s'), | 58 (b'store', b'%s'), |
59 ] | 59 ] |
60 | |
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")) | |
60 | 65 |
61 | 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 |