D4282: rebase: cover restorestatus() by lock to prevent it from being updated

khanchi97 (Sushil khanchi) phabricator at mercurial-scm.org
Thu Aug 16 06:34:01 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGffb34ee6de9e: rebase: cover restorestatus() by lock to prevent it from being updated (authored by khanchi97, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D4282?vs=10359&id=10380#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4282?vs=10359&id=10380

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -837,18 +837,17 @@
         return _dryrunrebase(ui, repo, action, opts)
     elif action == 'stop':
         rbsrt = rebaseruntime(repo, ui)
-        rbsrt.restorestatus()
-
-        if rbsrt.collapsef:
-            raise error.Abort(_("cannot stop in --collapse session"))
-        allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
-        if not (rbsrt.keepf or allowunstable):
-            raise error.Abort(_("cannot remove original changesets with"
-                                " unrebased descendants"),
-                hint=_('either enable obsmarkers to allow unstable '
-                       'revisions or use --keep to keep original '
-                       'changesets'))
         with repo.wlock(), repo.lock():
+            rbsrt.restorestatus()
+            if rbsrt.collapsef:
+                raise error.Abort(_("cannot stop in --collapse session"))
+            allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
+            if not (rbsrt.keepf or allowunstable):
+                raise error.Abort(_("cannot remove original changesets with"
+                                    " unrebased descendants"),
+                    hint=_('either enable obsmarkers to allow unstable '
+                           'revisions or use --keep to keep original '
+                           'changesets'))
             if needupdate(repo, rbsrt.state):
                 # update to the current working revision
                 # to clear interrupted merge



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


More information about the Mercurial-devel mailing list