comparison mercurial/configitems.py @ 41987:c1d83d916e85

revert: option to choose what to keep, not what to discard I know the you (the reader) are probably tired of discussing how `hg revert -i -r .` should behave and so am I. And I know I'm one of the people who argued that showing the diff from the working copy to the parent was confusing. I think it is less confusing now that we show the diff from the parent to the working copy, but I still find it confusing. I think showing the diff of hunks to keep might make it easier to understand. So that's what this patch provides an option for. One argument doing it this way is that most people seem to find `hg split` natural. I suspect that is because it shows the forward diff (from parent commit to the commit) and asks you what to put in the first commit. I think the new "keep" mode for revert (this patch) matches that. In "keep" mode, all the changes are still selected by default. That means that `hg revert -i` followed by 'A' (keep all) (or 'c' in curses) will be different from `hg revert -a`. That's mostly because that was simplest. It can also be argued that it's safest. But it can also be argued that it should be consistent with `hg revert -a`. Note that in this mode, you can edit the hunks and it will do what you expect (e.g. add new lines to your file if you added a new lines when editing). The test case shows that that works. Differential Revision: https://phab.mercurial-scm.org/D6125
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 12 Mar 2019 14:17:41 -0700
parents d6569f1e9b37
children 1fac9b931d46
comparison
equal deleted inserted replaced
41986:95e4ae86329f 41987:c1d83d916e85
593 default=False, 593 default=False,
594 ) 594 )
595 coreconfigitem('experimental', 'removeemptydirs', 595 coreconfigitem('experimental', 'removeemptydirs',
596 default=True, 596 default=True,
597 ) 597 )
598 coreconfigitem('experimental', 'revert.interactive.select-to-keep',
599 default=False,
600 )
598 coreconfigitem('experimental', 'revisions.prefixhexnode', 601 coreconfigitem('experimental', 'revisions.prefixhexnode',
599 default=False, 602 default=False,
600 ) 603 )
601 coreconfigitem('experimental', 'revlogv2', 604 coreconfigitem('experimental', 'revlogv2',
602 default=None, 605 default=None,