[PATCH RESEND] revert: do not reverse hunks in interactive when REV is not parent (issue5096)

Jun Wu quark at fb.com
Wed Nov 23 10:01:52 EST 2016


Excerpts from Martin von Zweigbergk's message of 2016-11-14 15:57:30 -0800:
> Pierre-Yves reached out and reminded me that he actually frequently
> uses "hg revert -i -r .~1" to undo changes since that commit. Also, I
> still personally feel that the people who want to undo changes since a
> revision and the people who want to get changes from a revision are
> thinking about it differently enough that they should be using
> different commands. I think it would be good if we could find good

There are other commands:
- For picking what should be undone: "hg uncommit -i"
- For picking what to kept: "hg split". (We can enhance it so it's possible
  to abort and drop the remaining changes)

Those commands sound more intuitive to me and could probably fit marmoute's
use-case.

> names for both of those operations. In my mind, "revert" is a good
> word for the former (i.e. undoing), and I'm not sure what's a good
> word for the latter (i.e. getting state from). It's still unclear to
> me if others were turned off mostly by my proposed name ("apply") or
> the idea of them being different operations.
> 
> I'll de-queue this patch for now, and we can talk (even) more about it :-/

An internal user just complained about the confusing behavior. I think an
easy change we would all agree is to make the curses UI to use the same verb
as the text UI does.

Before:

  SELECT CHUNKS: .... toggle hunk/all; (e)dit hunk;
   (f)old/unfold; (c)onfirm applied; ... [X]=hunk applied ....
                            ^^^^^^^               ^^^^^^^
After:

  SELECT CHUNKS: .... toggle hunk/all; (e)dit hunk;
   (f)old/unfold; (c)onfirm revert; ... [X]=hunk to revert ....
                            ^^^^^^               ^^^^^^^^^

If there is no objection, I could prepare the patch.


More information about the Mercurial-devel mailing list