We're hitting a problem when merging in Mercurial where whitespace changes are causing merge conflicts which mask any "real" conflicts we may have and makes merging a nightmare. We've recently conformed to a formatting style which changed the indentation of files in some branches and merging has become almost impossible since.
As an example, try:
hg init testrepo
cd testrepo/
echo "This is text." > newfile.txt
hg add newfile.txt
hg commit -m "Created a file."
hg branch newbranch
echo "This is some more text." > newfile.txt
hg commit -m "Changed text in the file."
hg update default
echo " This is text." > newfile.txt
hg commit -m "Added indentation whitespace."
This results in two branches, one with whitespace changes, the other with textual changes:
@ 2 " This is text".
|
|
| o 1 "This is some more text."
|/
|
o 0 "This is text."
When trying an hg merge
on this I get a merge conflict. If we have conflicts on every line it becomes difficult and time consuming to sort out the "real" conflicts. What I'd prefer is for the merge process to think "OK, changeset 2 line 1 differs from the parent only in whitespace so consider it unchanged. Pick changeset 1 line 1 as the merged result."