Mercurial > hg
comparison hgext/histedit.py @ 26763:50fc80e46786
histedit: make histedit prune when obsolete is enabled
Back in June we made histedit use obsolete markers to cleanup when possible.
This was rolled back as part of 54f9561088c7 (which should have only rolled back
the --abort stuff, but rolled back everything). This caused a nasty bug when
used in conjuction with the inhibit+directaccess extensions where histedit would
leave old nodes around even after they had been squashed away.
The root of the problem is that we first clean up old nodes, and then we clean
up temp nodes. In the first pass, when we obsoleted old nodes, some would become
unobsolete because they had temp nodes on top of them, thus making them stick
around even after the histedit finished.
The fix is to A) move the temp node cleanup to be before the old node cleanup
(since they are topological on top of the old nodes), and B) use obsolete
markers instead of stripping.
author | Durham Goode <durham@fb.com> |
---|---|
date | Sat, 17 Oct 2015 12:32:23 -0700 |
parents | 78aa4392c261 |
children | 38dcb85f9370 |
comparison
equal
deleted
inserted
replaced
26762:26f622859288 | 26763:50fc80e46786 |
---|---|
923 if len(succs) > 1: | 923 if len(succs) > 1: |
924 m = 'histedit: %s' | 924 m = 'histedit: %s' |
925 for n in succs[1:]: | 925 for n in succs[1:]: |
926 ui.debug(m % node.short(n)) | 926 ui.debug(m % node.short(n)) |
927 | 927 |
928 if supportsmarkers: | |
929 # Only create markers if the temp nodes weren't already removed. | |
930 obsolete.createmarkers(repo, ((repo[t],()) for t in sorted(tmpnodes) | |
931 if t in repo)) | |
932 else: | |
933 cleanupnode(ui, repo, 'temp', tmpnodes) | |
934 | |
928 if not state.keep: | 935 if not state.keep: |
929 if mapping: | 936 if mapping: |
930 movebookmarks(ui, repo, mapping, state.topmost, ntm) | 937 movebookmarks(ui, repo, mapping, state.topmost, ntm) |
931 # TODO update mq state | 938 # TODO update mq state |
932 if supportsmarkers: | 939 if supportsmarkers: |
939 if markers: | 946 if markers: |
940 obsolete.createmarkers(repo, markers) | 947 obsolete.createmarkers(repo, markers) |
941 else: | 948 else: |
942 cleanupnode(ui, repo, 'replaced', mapping) | 949 cleanupnode(ui, repo, 'replaced', mapping) |
943 | 950 |
944 cleanupnode(ui, repo, 'temp', tmpnodes) | |
945 state.clear() | 951 state.clear() |
946 if os.path.exists(repo.sjoin('undo')): | 952 if os.path.exists(repo.sjoin('undo')): |
947 os.unlink(repo.sjoin('undo')) | 953 os.unlink(repo.sjoin('undo')) |
948 | 954 |
949 def bootstrapcontinue(ui, state, opts): | 955 def bootstrapcontinue(ui, state, opts): |