Amending a changeset
Paul Moore
p.f.moore at gmail.com
Tue Apr 22 04:11:06 CDT 2008
On 22/04/2008, leslie.polzer at gmx.net <leslie.polzer at gmx.net> wrote:
>
> Hello,
>
> in a recent changeset some changes that semantically belong to it are missing.
> In Darcs I would now use AMEND-RECORD to add the remaining changes (they
> are in the working copy right now and have not been committed yet).
>
> Is there a way to do this in hg?
At a fundamental level, no, as in Mercurial, history is immutable. If
your changeset has been distributed to other repositories, you can't
get it back.
On a practical level, there are ways of doing this if you understand
that you are *not* amending the existing changeset, but are rather
replacing it with an altered changeset (with all the implications that
has).
See http://www.selenic.com/mercurial/wiki/index.cgi/FAQ (section 4.10)
and http://www.selenic.com/mercurial/wiki/index.cgi/EditingHistory for
some more details.
You should also make sure you understand your motivations in wanting
to edit this changeset. What does that give you that simply committing
a new changeset which fixes the problem doesn't? In Mercurial, while
individual changesets are important, they aren't quite the complete,
self-contained entities that they seem to be in darcs. Maybe you don't
need to do this at all, and it's just a hold-over from your ways of
working in darcs?
I hope this helps,
Paul.
More information about the Mercurial
mailing list