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

login
register
mail settings
Submitter phabricator
Date June 30, 2018, 1:47 a.m.
Message ID <f282727cbff9bbd5b477e5e9b4547655@localhost.localdomain>
Download mbox | patch
Permalink /patch/32518/
State Not Applicable
Headers show

Comments

phabricator - June 30, 2018, 1:47 a.m.
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

Patch

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: