From patchwork Sat Jun 30 01:47:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D3854: rebase: add lock to cover whole dryrun process From: phabricator X-Patchwork-Id: 32518 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Sat, 30 Jun 2018 01:47:19 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGba6d2c32f34a: rebase: add lock to cover whole dryrun process (authored by khanchi97, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D3854?vs=9354&id=9369#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3854?vs=9354&id=9369 REVISION DETAIL https://phab.mercurial-scm.org/D3854 AFFECTED FILES hgext/rebase.py CHANGE DETAILS To: khanchi97, #hg-reviewers Cc: yuja, mercurial-devel diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -818,22 +818,21 @@ opts[r'dest'] = '_destautoorphanrebase(SRC)' if dryrun: - leaveunfinished = True - inmemory = True - rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts)) - try: - overrides = {('rebase', 'singletransaction'): True} - with ui.configoverride(overrides, 'rebase'): - _origrebase(ui, repo, inmemory=True, rbsrt=rbsrt, - leaveunfinished=leaveunfinished, **opts) - except error.InMemoryMergeConflictsError: - ui.status(_('hit a merge conflict\n')) - return 1 - else: - ui.status(_('there will be no conflict, you can rebase\n')) - return 0 - finally: - with repo.wlock(), repo.lock(): + rbsrt = rebaseruntime(repo, ui, inmemory=True, + opts=pycompat.byteskwargs(opts)) + with repo.wlock(), repo.lock(): + try: + overrides = {('rebase', 'singletransaction'): True} + with ui.configoverride(overrides, 'rebase'): + _origrebase(ui, repo, inmemory=True, rbsrt=rbsrt, + leaveunfinished=True, **opts) + except error.InMemoryMergeConflictsError: + ui.status(_('hit a merge conflict\n')) + return 1 + else: + ui.status(_('there will be no conflict, you can rebase\n')) + return 0 + finally: rbsrt._prepareabortorcontinue(isabort=True) elif inmemory: try: