Merging should be *this* easy

Is merging so easy in your SCM system?

$ pwd
/home/keramida/hg/mercurial/gker
$ hg pull crew
pulling from /home/keramida/hg/mercurial/crew
searching for changes
adding changesets
adding manifests
adding file changes
added 54 changesets with 143 changes to 82 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg up -C keramida
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge
merging mercurial/commands.py
merging mercurial/hgweb/webcommands.py
merging tests/test-hgweb-commands.out
79 files updated, 3 files merged, 3 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ 

If you are using a VCS to keep track of a “vendor” source tree, plus your own local modifications, enhancements or features, and you repeatedly merge from “upstream” sources, then you deserve something like the merge shown above.

The “keramida” branch in the Mercurial “branch” we saw above is a personal branch which I use to keep my laptop’s installation in sync with the latest Mercurial “crew” repository.

The steps to pull a new upstream version and merge it into my own “branch” are summarized below:

$ cd ~/hg/mercurial/crew
$ hg pull
$ cd ~/hg/mercurial/gker

$ hg pull crew
$ hg update --clean keramida
$ hg merge

The last steps are, essentially, the “merge process”.

If you are still using an SCM that forces you to plan ahead for a week, then set aside an entire day’s work to “Perform The Merge(TM)”, maybe it is time to start looking at Mercurial:

http://www.selenic.com/mercurial/

In the meantime, I’m off to read a bit more of prof. Lessig’s “Code v2“, because tonight’s “merge” with the crew version of Mercurial is done, pushed to 10 different systems I often use, and installed already :-)

G. K.

Advertisements