[PATCH 7 of 7] histedit: use scmutil.cleanupnodes (BC)

Martin von Zweigbergk martinvonz at google.com
Sun Jul 9 15:04:11 EDT 2017


On Sat, Jul 8, 2017 at 4:51 PM, Jun Wu <quark at fb.com> wrote:
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -1182,5 +1182,9 @@ def _finishhistedit(ui, repo, state):
>          mapping[n] = ()
>
> -    safecleanupnode(ui, repo, mapping)
> +    # remove entries about unknown nodes
> +    nodemap = repo.unfiltered().changelog.nodemap
> +    mapping = {k: v for k, v in mapping.items()
> +               if k in nodemap and all(n in nodemap for n in v)}

I suppose these few lines could potentially move into cleanupnodes?
IIUC, it's to prevent crashing if you had stripped nodes during
histedit. The same can be done during rebase (while stopped to resolve
conflicts) and

> +    scmutil.cleanupnodes(repo, mapping, 'histedit')
>
>      state.clear()


More information about the Mercurial-devel mailing list