backout is not inverse of ci?
Matt Mackall
mpm at selenic.com
Wed Nov 28 23:22:31 UTC 2007
On Wed, Nov 28, 2007 at 06:07:30PM -0500, Neal Becker wrote:
> On Wednesday 28 November 2007, Matt Mackall wrote:
> > On Wed, Nov 28, 2007 at 04:46:35PM -0500, Neal Becker wrote:
> > > It seems that ci has no problem with uncommitted changes (to other
> > > files), backout refuses, and doesn't even offer any option (AFAICT).
> > >
> > > hg backout -r tip
> > > abort: outstanding uncommitted changes
> >
> > Yep. For backout to work its magic, it needs a clean working
> > directory.
>
>
> I guess the procedure to reverse a mistaken commit (unless it was the last
> change) is to commit an 'inverting' change (remove any add, undo any
> edits...)?
That's what backout does. But it's more complicated than that because
newer commits may be entangled with the original change.
So what backout actually does is check out the old commit, invert it,
then merge this version with the current version. The merge then does
the right thing (possibly with the user's help) to disentangle the
later dependent commits.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list