Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG8b729856ca03: obsolete: use context manager for transaction in createmarkers()
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 (6 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
'evolution.track-operation') | 'evolution.track-operation') | ||||
if useoperation and operation: | if useoperation and operation: | ||||
metadata['operation'] = operation | metadata['operation'] = operation | ||||
# Effect flag metadata handling | # Effect flag metadata handling | ||||
saveeffectflag = repo.ui.configbool('experimental', | saveeffectflag = repo.ui.configbool('experimental', | ||||
'evolution.effect-flags') | 'evolution.effect-flags') | ||||
tr = repo.transaction('add-obsolescence-marker') | with repo.transaction('add-obsolescence-marker') as tr: | ||||
try: | |||||
markerargs = [] | markerargs = [] | ||||
for rel in relations: | for rel in relations: | ||||
prec = rel[0] | prec = rel[0] | ||||
sucs = rel[1] | sucs = rel[1] | ||||
localmetadata = metadata.copy() | localmetadata = metadata.copy() | ||||
if 2 < len(rel): | if 2 < len(rel): | ||||
localmetadata.update(rel[2]) | localmetadata.update(rel[2]) | ||||
markerargs.append((nprec, nsucs, npare, localmetadata)) | markerargs.append((nprec, nsucs, npare, localmetadata)) | ||||
for args in markerargs: | for args in markerargs: | ||||
nprec, nsucs, npare, localmetadata = args | nprec, nsucs, npare, localmetadata = args | ||||
repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare, | repo.obsstore.create(tr, nprec, nsucs, flag, parents=npare, | ||||
date=date, metadata=localmetadata, | date=date, metadata=localmetadata, | ||||
ui=repo.ui) | ui=repo.ui) | ||||
repo.filteredrevcache.clear() | repo.filteredrevcache.clear() | ||||
tr.close() | |||||
finally: | |||||
tr.release() |