Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG09285733ad71: obsolete: use context manager for transaction in pushmarker()
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/obsolete.py (13 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
"""Push markers over pushkey""" | """Push markers over pushkey""" | ||||
if not key.startswith('dump'): | if not key.startswith('dump'): | ||||
repo.ui.warn(_('unknown key: %r') % key) | repo.ui.warn(_('unknown key: %r') % key) | ||||
return False | return False | ||||
if old: | if old: | ||||
repo.ui.warn(_('unexpected old value for %r') % key) | repo.ui.warn(_('unexpected old value for %r') % key) | ||||
return False | return False | ||||
data = util.b85decode(new) | data = util.b85decode(new) | ||||
with repo.lock(): | with repo.lock(), repo.transaction('pushkey: obsolete markers') as tr: | ||||
tr = repo.transaction('pushkey: obsolete markers') | |||||
try: | |||||
repo.obsstore.mergemarkers(tr, data) | repo.obsstore.mergemarkers(tr, data) | ||||
repo.invalidatevolatilesets() | repo.invalidatevolatilesets() | ||||
tr.close() | |||||
return True | return True | ||||
finally: | |||||
tr.release() | |||||
# keep compatibility for the 4.3 cycle | # keep compatibility for the 4.3 cycle | ||||
def allprecursors(obsstore, nodes, ignoreflags=0): | def allprecursors(obsstore, nodes, ignoreflags=0): | ||||
movemsg = 'obsolete.allprecursors moved to obsutil.allprecursors' | movemsg = 'obsolete.allprecursors moved to obsutil.allprecursors' | ||||
util.nouideprecwarn(movemsg, '4.3') | util.nouideprecwarn(movemsg, '4.3') | ||||
return obsutil.allprecursors(obsstore, nodes, ignoreflags) | return obsutil.allprecursors(obsstore, nodes, ignoreflags) | ||||
def allsuccessors(obsstore, nodes, ignoreflags=0): | def allsuccessors(obsstore, nodes, ignoreflags=0): |