about hg merge

Ling, Xiaofeng xiaofeng.ling at intel.com
Tue Aug 30 01:35:23 CDT 2005


Thomas Arendsen Hein <> wrote:
> * Ling, Xiaofeng <xiaofeng.ling at intel.com> [20050830 06:18]:
>> for example, after pull, I have a tree with two head 1-2-3-4
>>  \5-6-7
> 
> I assume 2-3-4 are your changes and 5-6-7 are made my others in a
> different repository. 
> 
>> I hope to get a new tree
>> 1-2-3-4-8-9-10
>>  \5-6-7
>> here 8,9,10 is 5,6,7's new changeset based on the new revision.
seems I use a wrong number for the tree.
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
I had to do
hg diff -r 8 -r7
hg diff -r 9 -r8
hg diff -r 10 -r9
General I won't push the changeset, just by export and send to others.
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.


> With this you would duplicate 5-7 to 8-10, this is not merging. What
> you really want is to merge 4 and 7 to a new changeset 8, so just do
> "hg co -m" to do it:  

> Do you want to _combine_ the patches of 5 and 6 to a new patch or
> changeset? This can't be done with changesets, but only with 'hg
> export'  
> and patch.
yes, 
general I can use "hg export" and "combinediff",but that will lose description, 
if hg support, that will be better.
 
> 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?
BTW, seems 0.6c doesn't support extension yet. I had to use the latest hg.




More information about the Mercurial mailing list