# HG changeset patch # User Pierre-Yves David # Date 1490535279 -7200 # Node ID c4dd1e7c1dab145e4cd2073ff4d280b8f9163338 # Parent f3b151278655222f75d5b192fc3b928061e4551a histedit: backout changeset 2b599f5468a4 Its parent is about to be backedout so this one needs to be removed too. diff -r f3b151278655 -r c4dd1e7c1dab hgext/histedit.py --- a/hgext/histedit.py Sun Mar 26 16:48:29 2017 -0400 +++ b/hgext/histedit.py Sun Mar 26 15:34:39 2017 +0200 @@ -1580,6 +1580,28 @@ finally: release(tr, lock) +def cleanupnode(ui, repo, name, nodes): + """strip a group of nodes from the repository + + The set of node to strip may contains unknown nodes.""" + ui.debug('should strip %s nodes %s\n' % + (name, ', '.join([node.short(n) for n in nodes]))) + with repo.lock(): + # do not let filtering get in the way of the cleanse + # we should probably get rid of obsolescence marker created during the + # histedit, but we currently do not have such information. + repo = repo.unfiltered() + # Find all nodes that need to be stripped + # (we use %lr instead of %ln to silently ignore unknown items) + nm = repo.changelog.nodemap + nodes = sorted(n for n in nodes if n in nm) + roots = [c.node() for c in repo.set("roots(%ln)", nodes)] + for c in roots: + # We should process node in reverse order to strip tip most first. + # but this trigger a bug in changegroup hook. + # This would reduce bundle overhead + repair.strip(ui, repo, c) + def safecleanupnode(ui, repo, name, nodes): """strip or obsolete nodes @@ -1606,23 +1628,7 @@ if markers: obsolete.createmarkers(repo, markers) else: - ui.debug('should strip %s nodes %s\n' % - (name, ', '.join([node.short(n) for n in nodes]))) - with repo.lock(): - # Do not let filtering get in the way of the cleanse we should - # probably get rid of obsolescence marker created during the - # histedit, but we currently do not have such information. - repo = repo.unfiltered() - # Find all nodes that need to be stripped - # (we use %lr instead of %ln to silently ignore unknown items) - nm = repo.changelog.nodemap - nodes = sorted(n for n in nodes if n in nm) - roots = [c.node() for c in repo.set("roots(%ln)", nodes)] - for c in roots: - # We should process node in reverse order to strip tip most - # first, but this trigger a bug in changegroup hook. This - # would reduce bundle overhead - repair.strip(ui, repo, c) + return cleanupnode(ui, repo, name, nodes) def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs): if isinstance(nodelist, str):