evolve: revert amend

Matt Mackall mpm at selenic.com
Mon Aug 11 11:00:08 CDT 2014


On Mon, 2014-08-11 at 18:46 +0300, anatoly techtonik wrote:
> On Mon, Aug 11, 2014 at 6:25 PM, Matt Mackall <mpm at selenic.com> wrote:
> > On Mon, 2014-08-11 at 18:15 +0300, anatoly techtonik wrote:
> >> On Mon, Aug 11, 2014 at 5:39 PM, Augie Fackler <lists at durin42.com> wrote:
> >> > On Mon, Aug 11, 2014 at 10:37 AM, anatoly techtonik <techtonik at gmail.com> wrote:
> >> >>> I'd spell what he wants as
> >> >>>
> >> >>> hg touch --hidden 60196217f989
> >> >>> hg co tip # probably don't need this
> >> >>> hg revert --all -r 79c37431f559
> >> >>> hg prune 79c37431f559
> >> >>>
> >> >>> which should effectively undo the bad amend. For paranoia, start from
> >> >>> a clean working copy.
> >> >>
> >> >> Hmm. I fail to see how that changes the status of files to
> >> >> "modified". The problem started when changes from modified files
> >> >> slipped into amended commit, because I didn't pay attention there
> >> >> are more changes in repo and forgot to choose only needed ones.
> >> >
> >> > The revert step does that. Note that I've made the same mistake at
> >> > least once, and undone it this way.
> >>
> >> $ hg revert -h
> >> ...
> >> restore files to their checkout state
> >
> > Revert is probably easiest to explain like this:
> >
> > # undo our change to foo:
> > hg revert foo      == hg cat -r . foo > foo
> >
> > # get an old version of foo:
> > hg revert -r X foo == hg cat -r X foo > foo
> 
> How about changing help message to:
> revert file contents to specified revision

Been there. Had countless users trying to use it as "update to revision
in the past" (instead of using update) and having a big sad.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list