Mercurial > hg-stable
comparison hgext/histedit.py @ 24626:e767f5aba810
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Sat, 04 Apr 2015 11:24:48 -0700 |
parents | 365fdbc54f1f |
children | d71c2da01d0d |
comparison
equal
deleted
inserted
replaced
24625:2cebf17c0fcc | 24626:e767f5aba810 |
---|---|
1028 if isinstance(nodelist, str): | 1028 if isinstance(nodelist, str): |
1029 nodelist = [nodelist] | 1029 nodelist = [nodelist] |
1030 if os.path.exists(os.path.join(repo.path, 'histedit-state')): | 1030 if os.path.exists(os.path.join(repo.path, 'histedit-state')): |
1031 state = histeditstate(repo) | 1031 state = histeditstate(repo) |
1032 state.read() | 1032 state.read() |
1033 histedit_nodes = set([ctx for (action, ctx) in state.rules]) | 1033 histedit_nodes = set([repo[rulehash].node() for (action, rulehash) |
1034 strip_nodes = set([repo[n].hex() for n in nodelist]) | 1034 in state.rules if rulehash in repo]) |
1035 strip_nodes = set([repo[n].node() for n in nodelist]) | |
1035 common_nodes = histedit_nodes & strip_nodes | 1036 common_nodes = histedit_nodes & strip_nodes |
1036 if common_nodes: | 1037 if common_nodes: |
1037 raise util.Abort(_("histedit in progress, can't strip %s") | 1038 raise util.Abort(_("histedit in progress, can't strip %s") |
1038 % ', '.join(node.short(x) for x in common_nodes)) | 1039 % ', '.join(node.short(x) for x in common_nodes)) |
1039 return orig(ui, repo, nodelist, *args, **kwargs) | 1040 return orig(ui, repo, nodelist, *args, **kwargs) |