mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
histedit: fix preventing strips during histedit
We were trying to prevent strips of important nodes during histedit, but the check was actually comparing the short hashes in the rules to the exact value the user typed in, so it only ever worked if the user typed a 12 character hash.
This commit is contained in:
parent
ce308b547b
commit
04eb9da604
@ -1030,8 +1030,9 @@ def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs):
|
||||
if os.path.exists(os.path.join(repo.path, 'histedit-state')):
|
||||
state = histeditstate(repo)
|
||||
state.read()
|
||||
histedit_nodes = set([ctx for (action, ctx) in state.rules])
|
||||
strip_nodes = set([repo[n].hex() for n in nodelist])
|
||||
histedit_nodes = set([repo[rulehash].node() for (action, rulehash)
|
||||
in state.rules if rulehash in repo])
|
||||
strip_nodes = set([repo[n].node() for n in nodelist])
|
||||
common_nodes = histedit_nodes & strip_nodes
|
||||
if common_nodes:
|
||||
raise util.Abort(_("histedit in progress, can't strip %s")
|
||||
|
@ -87,8 +87,8 @@ Go at a random point and try to continue
|
||||
[255]
|
||||
|
||||
Try to delete necessary commit
|
||||
$ hg strip -r 652413bf663e
|
||||
abort: histedit in progress, can't strip 363532343133
|
||||
$ hg strip -r 652413b
|
||||
abort: histedit in progress, can't strip 652413bf663e
|
||||
[255]
|
||||
|
||||
commit, then edit the revision
|
||||
|
Loading…
Reference in New Issue
Block a user