How to merge local changes, if any (other changes otherwise) in Mercurial?

There are two chapters in my repository. I have five files that I edited locally. There are 15 modified files in the Bitbucket repository that I have not edited, but also contain modified versions of the same 5 files.

I would like to do the following:

1) If I edited the file and the Bitbucket repository contains the same edited file, I would like my changes to take preference.

2) If I did not edit the file, I would like to update it to the latest version.

What sequence of commands in Mercurial will allow me to do this? Do I need to use an external program?

+3
source share
2 answers

WITH LOCAL COMMITTEES

hg pull
hg update --rev ${my version}
hg merge --rev ${their version} --tool internal:local

. hg help merge-tools

hg status -qn , . , , , , . unix script, - :

ls -l *.mine # check to see that there are none
for file in `hg status -qn`; do cp ${file} ${file}.mine; done
hg revert --all; hg pull; hg update
for file in *.mine; do cp ${file} ${file%.mine}; done

. . .

+1

hg pull
hg merge

, .

, mercurial, HG Init, .

-1

All Articles