newcomer question not found in the FAQ

Steve Borho steve at borho.org
Mon Dec 21 23:22:41 CST 2009


On Mon, Dec 21, 2009 at 10:59 PM, tristan stag <trstag75 at yahoo.fr> wrote:
>
>> hg up 5
>> hg merge --config ui.merge=internal:local
>> hg commit
>
> I just did that and ended up with the changeset
> I didn't want (changeset 3) merged with the rest:
>
> [nonet at saturn 27.3G ~/example/proj/] $ hg glog | grep -v date | grep -v user
> @    changeset:   6:4a0b60b54ee0
> |\   tag:         tip
> | |  parent:      5:d69ac2cb7713
> | |  parent:      3:21697fa637b5
> | |  summary:     testing internal:local
> | |
> | o  changeset:   5:d69ac2cb7713
> | |  summary:     even better
> | |
> | o  changeset:   4:485cada3297c
> | |  parent:      2:056a28fae544
> | |  summary:     Heuristic algo giving very good results
> | |
> o |  changeset:   3:21697fa637b5
> | |  parent:      1:9d83166bce20
> | |  summary:     No closed formula, heuristic algo giving terribly
> | |               bad results: example of what not to do
> | |
> | o  changeset:   2:056a28fae544
> |/   summary:     Algo passing all test on data set, moderately fast
> |
> o  changeset:   1:9d83166bce20
> |  summary:     Added data set to test algos
> |
> o  changeset:   0:2f01508c3f15
>   summary:     Initial import
>
> This is precisely what I don't want to happen during a merge.
>
> I want changeset 3: to never mess with the rest of the repository
> again (it can either stay there or disappear completely: I don't
> care as long as it ain't ever merged again with the rest).
>
> Ah damn me, I'm really a Mercurial newbie :(

It is merged, but it is not effecting the tip at all.  This is how you
kill the effects of a dead branch.  You have now officially told
Mercurial that changeset 3 should not to affect anything after it.
Normally merges like that are giving commit messages like:  "Killing
off a bad head".

So, if you are really annoyed by the revision 3 still being in your
repository, you can do this:

hg clone -r5 repo repo-clean

This will generate a clone with revision 5 and it's ancestors.
changeset 3 will not be in repo-clean, and if you're happy with it you
can nuke the original repo.

--
Steve Borho


More information about the Mercurial mailing list