[PATCH RFC] commit: add --amend option to amend the parent changeset
Pierre-Yves David
pierre-yves.david at logilab.fr
Tue Feb 21 16:51:00 UTC 2012
On Tue, Feb 21, 2012 at 02:35:50PM +0100, Arne Babenhauserheide wrote:
> Am Dienstag, 21. Februar 2012, 12:27:13 schrieb Idan Kamara:
> > On Tue, Feb 21, 2012 at 10:22 AM, Arne Babenhauserheide
> <arne_bab at web.de>wrote:
> > > I might want it to be available to me, though, because I might make an
> > > error
> > > on the new commit which I might only catch by comparing it to the old one.
> >
> > If Mercurial could mark changesets as eligible for garbage collection it
> > would probably be a good fit to mark the amended commit as such.
>
> That’s actually what Pierre is working on with obsolete and evolve. But with
> additional tricks, so you can amend one changesets and have all its decendants
> and future decendants fix up themselves to be based on the new changeset as
> soon as you call hg evolve.
Tricky question about backing up changeset we amend. Not doing it is
dangerous. You have to try very hard in order to loose work in mercurial.
However bundle backup is a very inefficient way to store backup. Both regarding
space and ability to find the right bundle to restore.
I wish we already had obsolete as it is a good example of why having obsolete
concepts will solve several issue.
On of the core property of obsolete changeset that we could use here are:
* invisible to UI,
* no propagated,
* garbage collectable (an efficently stored until then),
* easy to retrieve for restore, diff and audit.
(other obsolete feature, sharing obsolete marker and allowing automatic
resolution are bonus not relevant at this stage of the discussion)
> > You shouldn't be able to amend public changesets. If you really want to
> > you could 'hg phase -f -d' it and then --amend will agree to do it.
>
> And then I will possibly mangle up the history of others. That’s why this is
> an advanced use-case where I definitely need a stronger tool.
Public changeset should **never** be rewritten. If you want to fix a public
changeset you have to stick to the old way: backout, fix commit + merge.
If you want to share and collaborate on mutable part of the history you must
configure your environement to exchange draft changeset.
--
Pierre-Yves David
http://www.logilab.fr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20120221/9259f36a/attachment.asc>
More information about the Mercurial-devel
mailing list