about hg merge

Thomas Arendsen Hein thomas at intevation.de
Tue Aug 30 01:49:02 CDT 2005


* Ling, Xiaofeng <xiaofeng.ling at intel.com> [20050830 08:38]:
> After pull, I got a three
> 1-2-3-4 local branch
>  \5-6-7  remote
>
> I hope to get
> 1-2-3-4 my local branch
>  \
>   5-6-7-8-9-10
>
> Yes, I can get this by three hg co -m
> hg co -C 2
> hg co -m tip
> hg co -C 3
> hg co -m tip
> hg co -C 4
> hg co -m tip
> but then 8,9,10 will be a merge verion, I can not export a single
> changeset by hg export 8

Merge changesets are mostly uninteresting. It seems that you think
'hg merge' is something that it isn't. With merge you don't move
changesets around, but you link changesets together in a new way.

> So I don't care there are multiheads, of cause, if there is a command
> like hg hide 4
> to hide the head, it will be better.

You can do this: Use 'hg co -m' to merge the heads and after this
'hg revert -r tip' to make the working directory look like the
unmerged tip was before. Now commit.

> > Now the good news: You can do many things you describe here with the
> > 'mq' extension from ftp://ftp.suse.com/pub/people/mason/mercurial 
>
>  Can this do what I describe above?

Yes, because it doesn't add changesets with your local changes, but
keeps a set (or queue) of patches against the unmodified tree.

> BTW, seems 0.6c doesn't support extension yet. I had to use the latest hg.

I'd recommend to use the latest hg if you want to use mq, but there
are older versions of mq in the 'old' subdirectory which may work
with older hg versions.

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial mailing list