How to automatically merge 2 heads using mercurial

We have just moved on to mercury from subversive activity, and there is one thing that takes longer than expected; head fusion.

We like the fact that it preserves merges independent of 2 commits (compared to subversion), but we regularly combine 2 chapters for unrelated changes.

A simple scenario. Both I and Bob are updated. We both update the current default position (as the main one) and make improvements in different files.

We are making a transaction, and only one can click on the central server, the other will create 2 heads. Then pull, select 2 heads, merge (it will be easy, since the changes are in different files). Lock, then press.

Therefore, is there an extension that follows these steps Merge attempt If there are no conflicts yet Cancel merge

We want this launch to be done on an automated server, so +1 is the command line and another +1 if it can merge without touching the working copy.

Thanks!


Update:
As a result, we ran several python scripts to manage the most common tasks (merge and assembly, merge two goals).

Thanks for the help!

+7
source share
2 answers

It looks like you should use hg fetch for this. It will pull the changes from the server, merge, and then automatically copy the merge. It also causes merge conflicts. It is included in Mercurial, so just add

 fetch = 

to your hgrc and you should be tuned. This is not an automatic click, but it is usually a bad idea. Usually you want to run tests and resolve any merge problems before pushing your code to everyone else.

+3
source

Are mergers really time consuming? If these are โ€œunrelated changes,โ€ should you just blink?

Someone has already suggested fetch , and someone else will probably suggest rebase , but personally I think the merge is an encoding, and I want it to be manual. It takes almost no time, and he has the opportunity to give a good message, for example: "Pull in Jane, working halfway through my FooBar work" (instead of providing extracts of useless messages).

+3
source

All Articles