What follows is an example of a merge between two unrelated files "a" and "b".
Please note that I'm abusing a list format because I can't figure out how to use this system. Lines that appear to be headers but start as "summary:" are actually output from hg and happen to be the last line before a blank line. All other headers are my own comments explaining a command/sequence and its output. Commands appear on line that have 'timeless-mbp:...$'. All other lines are output.
Setup
timeless-mbp:~ timeless$ cd /tmp
timeless-mbp:tmp timeless$ rm -rf q
timeless-mbp:tmp timeless$ hg init q
timeless-mbp:tmp timeless$ cd q
Define my username
timeless-mbp:q timeless$ echo '[ui]' > .hg/hgrc
timeless-mbp:q timeless$ echo 'username = timeless' >> .hg/hgrc
First create, add and commit file a
timeless-mbp:q timeless$ echo a > a
timeless-mbp:q timeless$ hg commit -Am a
adding a
Start at a new scratch revision (null)
timeless-mbp:q timeless$ hg up -r null
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
Create, add and commit file b
timeless-mbp:q timeless$ echo b > b
timeless-mbp:q timeless$ hg commit -Am b
adding b
created new head
Switch back to our first file, this is just to create an interleaved version history
timeless-mbp:q timeless$ hg up -r 0
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
Rename a to file because we want to merge it with b under the name "file"
timeless-mbp:q timeless$ hg mv a file
timeless-mbp:q timeless$ hg commit -m 'rename a to file'
Switch back to our second file, this is just to create an interleaved version history
timeless-mbp:q timeless$ hg up -r 1
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
Rename b to file because we want to merge it with a under the name "file"
timeless-mbp:q timeless$ hg mv b file
timeless-mbp:q timeless$ hg commit -m 'rename b to file'
I'm forcing a merge using internal because I don't want a merge tool to pop up, there are other merge tools you could use (e.g. on OS X with modern versions of Mercurial, it tends to pop up FileMerge.app, but that's hard to show in a log).
timeless-mbp:q timeless$ hg --config ui.merge=internal:local merge 2
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
Replace the content with what I want
timeless-mbp:q timeless$ hg cat -r 2 file > file
timeless-mbp:q timeless$ hg cat -r 3 file >> file
Verify that it now has the content I want
timeless-mbp:q timeless$ cat file
a
b
Commit the "merged" file
timeless-mbp:q timeless$ hg commit -m merging
Review the repository history
timeless-mbp:q timeless$ hg log
changeset: 4:d9d3d23ec1cc
tag: tip
parent: 3:01c6a61cbe04
parent: 2:3de70df713a7
user: timeless
date: Wed Jun 02 16:10:08 2010 +0300
summary: merging
changeset: 3:01c6a61cbe04
parent: 1:e6b8058965b4
user: timeless
date: Wed Jun 02 16:09:43 2010 +0300
summary: rename b to file
changeset: 2:3de70df713a7
parent: 0:635f50240100
user: timeless
date: Wed Jun 02 16:09:30 2010 +0300
summary: rename a to file
changeset: 1:e6b8058965b4
parent: -1:000000000000
user: timeless
date: Wed Jun 02 16:09:17 2010 +0300
summary: b
changeset: 0:635f50240100
user: timeless
date: Wed Jun 02 16:09:01 2010 +0300
summary: a
Check annotate output
timeless-mbp:q timeless$ hg ann -f -c file
635f50240100 a: a
e6b8058965b4 b: b