[PATCH] histedit: don't recreate state object

Durham Goode durham at fb.com
Wed Feb 18 04:08:21 UTC 2015


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1424231966 28800
#      Tue Feb 17 19:59:26 2015 -0800
# Node ID 85b6e8979ba1810cb11dfe149a0099569e0c75d1
# Parent  e1dbe0b215ae137eec53ceb12440536d570a83d2
histedit: don't recreate state object

Previously, the histedit state object was being recreated during continue/abort.
This meant that the locks that were held on the original state object were not
available to actions, which meant actions could not release the lock on the
repository (like an 'exec' action would need to do).

This affected our internal extension that added the 'exec' action.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -593,11 +593,9 @@ def _histedit(ui, repo, state, *freeargs
 
     # rebuild state
     if goal == 'continue':
-        state = histeditstate(repo)
         state.read()
         state = bootstrapcontinue(ui, state, opts)
     elif goal == 'abort':
-        state = histeditstate(repo)
         state.read()
         mapping, tmpnodes, leafs, _ntm = processreplacement(state)
         ui.debug('restore wc to old parent %s\n' % node.short(state.topmost))


More information about the Mercurial-devel mailing list