Patchwork D3854: rebase: add lock to cover whole dryrun process

login
register
mail settings
Submitter phabricator
Date June 29, 2018, 6:08 p.m.
Message ID <e34eb4f20758aad1b651ab58042f91f1@localhost.localdomain>
Download mbox | patch
Permalink /patch/32503/
State Not Applicable
Headers show

Comments

phabricator - June 29, 2018, 6:08 p.m.
khanchi97 updated this revision to Diff 9354.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3854?vs=9342&id=9354

REVISION DETAIL
  https://phab.mercurial-scm.org/D3854

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: khanchi97, #hg-reviewers
Cc: yuja, mercurial-devel
Yuya Nishihara - June 30, 2018, 1:29 a.m.
Rebased on top of 2394cd58b81f and queued, thanks.
phabricator - June 30, 2018, 2:01 a.m.
yuja added a comment.


  Rebased on top of https://phab.mercurial-scm.org/rHG2394cd58b81f77816caf4068ed5e441089460b47 and queued, thanks.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3854

To: khanchi97, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -818,22 +818,20 @@ 
         opts[r'dest'] = '_destautoorphanrebase(SRC)'
 
     if dryrun:
-        leaveunfinished = True
-        inmemory = True
-        rbsrt = rebaseruntime(repo, ui, inmemory, 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=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: