Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG5574629d5d45: obsolete: use context manager for lock 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 (5 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) | ||||
lock = repo.lock() | with repo.lock(): | ||||
try: | |||||
tr = repo.transaction('pushkey: obsolete markers') | tr = repo.transaction('pushkey: obsolete markers') | ||||
try: | try: | ||||
repo.obsstore.mergemarkers(tr, data) | repo.obsstore.mergemarkers(tr, data) | ||||
repo.invalidatevolatilesets() | repo.invalidatevolatilesets() | ||||
tr.close() | tr.close() | ||||
return True | return True | ||||
finally: | finally: | ||||
tr.release() | tr.release() | ||||
finally: | |||||
lock.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): |