Mercurial > hg
comparison hgext/rebase.py @ 27866:f54bf1f41566
with: use context manager for transaction in rebase
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 15 Jan 2016 13:14:48 -0800 |
parents | 2d294dada4f8 |
children | 6bc2299cc12f |
comparison
equal
deleted
inserted
replaced
27865:f6979b8f33c1 | 27866:f54bf1f41566 |
---|---|
545 collapsedas = None | 545 collapsedas = None |
546 if collapsef: | 546 if collapsef: |
547 collapsedas = newnode | 547 collapsedas = newnode |
548 clearrebased(ui, repo, state, skipped, collapsedas) | 548 clearrebased(ui, repo, state, skipped, collapsedas) |
549 | 549 |
550 tr = None | 550 with repo.transaction('bookmark') as tr: |
551 try: | |
552 tr = repo.transaction('bookmark') | |
553 if currentbookmarks: | 551 if currentbookmarks: |
554 updatebookmarks(repo, targetnode, nstate, currentbookmarks, tr) | 552 updatebookmarks(repo, targetnode, nstate, currentbookmarks, tr) |
555 if activebookmark not in repo._bookmarks: | 553 if activebookmark not in repo._bookmarks: |
556 # active bookmark was divergent one and has been deleted | 554 # active bookmark was divergent one and has been deleted |
557 activebookmark = None | 555 activebookmark = None |
558 tr.close() | |
559 finally: | |
560 release(tr) | |
561 clearstatus(repo) | 556 clearstatus(repo) |
562 | 557 |
563 ui.note(_("rebase completed\n")) | 558 ui.note(_("rebase completed\n")) |
564 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True) | 559 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True) |
565 if skipped: | 560 if skipped: |