comparison hgext/histedit.py @ 22873:9fe8e1e80841

histedit: stabilise the order nodes that are stripped The `nodes` object is a set. We sort it to get stable order. This is going to prevent revsets from getting confused when removing a `.set()` call in `roots`.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 10 Oct 2014 13:31:00 -0700
parents 810d37485e85
children 7bf82faba774
comparison
equal deleted inserted replaced
22872:45afc86567ce 22873:9fe8e1e80841
923 try: 923 try:
924 lock = repo.lock() 924 lock = repo.lock()
925 # Find all node that need to be stripped 925 # Find all node that need to be stripped
926 # (we hg %lr instead of %ln to silently ignore unknown item 926 # (we hg %lr instead of %ln to silently ignore unknown item
927 nm = repo.changelog.nodemap 927 nm = repo.changelog.nodemap
928 nodes = [n for n in nodes if n in nm] 928 nodes = sorted(n for n in nodes if n in nm)
929 roots = [c.node() for c in repo.set("roots(%ln)", nodes)] 929 roots = [c.node() for c in repo.set("roots(%ln)", nodes)]
930 for c in roots: 930 for c in roots:
931 # We should process node in reverse order to strip tip most first. 931 # We should process node in reverse order to strip tip most first.
932 # but this trigger a bug in changegroup hook. 932 # but this trigger a bug in changegroup hook.
933 # This would reduce bundle overhead 933 # This would reduce bundle overhead