[PATCH 6 of 6 V2] histedit: migrate to scmutil.cleanupnodes (BC)

Martin von Zweigbergk martinvonz at google.com
Sat Jul 8 09:06:31 EDT 2017


On Fri, Jul 7, 2017 at 7:11 PM, Jun Wu <quark at fb.com> wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1498515971 25200
> # Mon Jun 26 15:26:11 2017 -0700
> # Node ID 5844ab9ea01f0fec2a9885bb03918d34b534d374
> # Parent 8beac6dfe217dfabf51de371e04c024ad30406dd
> # Available At https://bitbucket.org/quark-zju/hg-draft
> # hg pull https://bitbucket.org/quark-zju/hg-draft -r 5844ab9ea01f
> histedit: migrate to scmutil.cleanupnodes (BC)

I've queued up to patch 5. Great cleanups!

This patch seems to do a few unrelated things that can be made clearer by
splitting it up.

>
> This is marked as BC because the strip backup file name has changed.
>
> Aside from exciting code removals, there are some output changes explained
> below:
>
> - "histedit: moving bookmarks X from Y to Z" no longer gets printed with
> --verbose. This is more consistent with other commands, like "commit"
> won't show bookmark movement message. The bookmark movement message is
> still available via --debug.
> - There is only one backup file per command invocation, instead of two.
> It is cleaner to just put all removed nodes in one file.
> - There are some debugobsolete ordering changes. That's just some
> implementation detail of cleanupnodes. It should not affect any end-user
> experience.

Seems more like it's a consequence of creating a single bundle, actually.
I'd suggest extracting the following patch from this one to make cause and
effect clearer. At least the following seems like a reasonable first piece
to extract.


diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1171,13 +1171,15 @@
for n in succs[1:]:
ui.debug(m % node.short(n))

- safecleanupnode(ui, repo, 'temp', tmpnodes)
-
if not state.keep:
if mapping:
movebookmarks(ui, repo, mapping, state.topmost, ntm)
# TODO update mq state
- safecleanupnode(ui, repo, 'replaced', mapping)
+ else:
+ mapping = {}
+ for n in tmpnodes:
+ mapping[n] = ()
+ safecleanupnode(ui, repo, 'histedit', mapping)

state.clear()
if os.path.exists(repo.sjoin('undo')):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170708/2d809720/attachment.html>


More information about the Mercurial-devel mailing list