Mercurial > hg
comparison hgext/histedit.py @ 25808:425839c8ec79
histedit: minor refactoring of createmarkers check
We use a variable to store whether or not we can create obsolescence markers.
It makes the patch series more readable as we are going to reuse this
values in other places in the function.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Thu, 16 Jul 2015 11:17:37 -0700 |
parents | 328739ea70c3 |
children | ebb5bb9bc32e |
comparison
equal
deleted
inserted
replaced
25807:2cccaf937a7a | 25808:425839c8ec79 |
---|---|
748 _('histedit requires exactly one ancestor revision')) | 748 _('histedit requires exactly one ancestor revision')) |
749 | 749 |
750 | 750 |
751 replacements = [] | 751 replacements = [] |
752 state.keep = opts.get('keep', False) | 752 state.keep = opts.get('keep', False) |
753 supportsmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt) | |
753 | 754 |
754 # rebuild state | 755 # rebuild state |
755 if goal == 'continue': | 756 if goal == 'continue': |
756 state.read() | 757 state.read() |
757 state = bootstrapcontinue(ui, state, opts) | 758 state = bootstrapcontinue(ui, state, opts) |
879 | 880 |
880 if not state.keep: | 881 if not state.keep: |
881 if mapping: | 882 if mapping: |
882 movebookmarks(ui, repo, mapping, state.topmost, ntm) | 883 movebookmarks(ui, repo, mapping, state.topmost, ntm) |
883 # TODO update mq state | 884 # TODO update mq state |
884 if obsolete.isenabled(repo, obsolete.createmarkersopt): | 885 if supportsmarkers: |
885 markers = [] | 886 markers = [] |
886 # sort by revision number because it sound "right" | 887 # sort by revision number because it sound "right" |
887 for prec in sorted(mapping, key=repo.changelog.rev): | 888 for prec in sorted(mapping, key=repo.changelog.rev): |
888 succs = mapping[prec] | 889 succs = mapping[prec] |
889 markers.append((repo[prec], | 890 markers.append((repo[prec], |