##// END OF EJS Templates
histedit: inline cleanupnode...
Jun Wu -
r31528:2b599f54 default
parent child Browse files
Show More
@@ -1580,28 +1580,6 b' def movebookmarks(ui, repo, mapping, old'
1580 finally:
1580 finally:
1581 release(tr, lock)
1581 release(tr, lock)
1582
1582
1583 def cleanupnode(ui, repo, name, nodes):
1584 """strip a group of nodes from the repository
1585
1586 The set of node to strip may contains unknown nodes."""
1587 ui.debug('should strip %s nodes %s\n' %
1588 (name, ', '.join([node.short(n) for n in nodes])))
1589 with repo.lock():
1590 # do not let filtering get in the way of the cleanse
1591 # we should probably get rid of obsolescence marker created during the
1592 # histedit, but we currently do not have such information.
1593 repo = repo.unfiltered()
1594 # Find all nodes that need to be stripped
1595 # (we use %lr instead of %ln to silently ignore unknown items)
1596 nm = repo.changelog.nodemap
1597 nodes = sorted(n for n in nodes if n in nm)
1598 roots = [c.node() for c in repo.set("roots(%ln)", nodes)]
1599 for c in roots:
1600 # We should process node in reverse order to strip tip most first.
1601 # but this trigger a bug in changegroup hook.
1602 # This would reduce bundle overhead
1603 repair.strip(ui, repo, c)
1604
1605 def safecleanupnode(ui, repo, name, nodes):
1583 def safecleanupnode(ui, repo, name, nodes):
1606 """strip or obsolete nodes
1584 """strip or obsolete nodes
1607
1585
@@ -1628,7 +1606,23 b' def safecleanupnode(ui, repo, name, node'
1628 if markers:
1606 if markers:
1629 obsolete.createmarkers(repo, markers)
1607 obsolete.createmarkers(repo, markers)
1630 else:
1608 else:
1631 return cleanupnode(ui, repo, name, nodes)
1609 ui.debug('should strip %s nodes %s\n' %
1610 (name, ', '.join([node.short(n) for n in nodes])))
1611 with repo.lock():
1612 # Do not let filtering get in the way of the cleanse we should
1613 # probably get rid of obsolescence marker created during the
1614 # histedit, but we currently do not have such information.
1615 repo = repo.unfiltered()
1616 # Find all nodes that need to be stripped
1617 # (we use %lr instead of %ln to silently ignore unknown items)
1618 nm = repo.changelog.nodemap
1619 nodes = sorted(n for n in nodes if n in nm)
1620 roots = [c.node() for c in repo.set("roots(%ln)", nodes)]
1621 for c in roots:
1622 # We should process node in reverse order to strip tip most
1623 # first, but this trigger a bug in changegroup hook. This
1624 # would reduce bundle overhead
1625 repair.strip(ui, repo, c)
1632
1626
1633 def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs):
1627 def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs):
1634 if isinstance(nodelist, str):
1628 if isinstance(nodelist, str):
General Comments 0
You need to be logged in to leave comments. Login now