# HG changeset patch # User Sushil khanchi # Date 1534312677 -19800 # Node ID ffb34ee6de9ec216a6aa711fe2f1e974288de942 # Parent 2a4bfbb5211171bdd5f084db0bfb3016d5690425 rebase: cover restorestatus() by lock to prevent it from being updated To prevent it from being updated by another process `restorestatus()` is moved under lock. Differential Revision: https://phab.mercurial-scm.org/D4282 diff -r 2a4bfbb52111 -r ffb34ee6de9e hgext/rebase.py --- a/hgext/rebase.py Mon Aug 13 21:22:14 2018 +0100 +++ b/hgext/rebase.py Wed Aug 15 11:27:57 2018 +0530 @@ -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