merge: allow smarter tool configuration
Add [merge-tool] hgrc section with:
<tool>.executable = name or path (<tool>)
<tool>.args = args with $local/base/other/output ($local $base $other)
<tool>.priority = priority (default 0)
<tool>.binary = handles binary (False)
<tool>.symlink = handles symlinks (False)
<tool>.checkconflict = check for conflict markers (False)
<tool>.premerge = try internal simplemerge (True if not binary or symlink)
Four built-in tools: internal:{merge,local,other,fail}
Add [merge-patterns] section of the form:
<pattern> = <tool>
Priority of settings is:
HGMERGE
merge-patterns
ui:merge
merge-tools by priority
hgmerge, if it can be found
Changes:
unsuccessful merges leave .orig files
% initial svn import
Adding t/a
Committed revision 1.
% update svn repository
A t2/a
Checked out revision 1.
A b
Sending a
Adding b
Transmitting file data ..
Committed revision 2.
% convert to hg once
assuming destination test-hg
initializing destination test-hg repository
scanning source...
sorting...
converting...
1 init
0 changea
% update svn repository again
Sending a
Sending b
Transmitting file data ..
Committed revision 3.
% test incremental conversion
assuming destination test-hg
scanning source...
fetching revision log for "/trunk/test" from 3 to 2
sorting...
converting...
0 changeb
source:
a
b
no tags found at revision 3
% test filemap
initializing destination fmap repository
scanning source...
sorting...
converting...
2 init
1 changea
0 changeb
o 1 changeb files: b
|
o 0 changea files: b
% test stop revision
initializing destination stoprev repository
scanning source...
sorting...
converting...
0 init
extra: branch=
extra: convert_revision=
# now tests that it works with trunk/branches/tags layout
% initial svn import
Adding projA/trunk
Adding projA/branches
Adding projA/tags
Committed revision 4.
% update svn repository
Checked out revision 4.
A letter.txt
Adding letter.txt
Transmitting file data .
Committed revision 5.
Sending letter.txt
Transmitting file data .
Committed revision 6.
Committed revision 7.
Sending letter.txt
Transmitting file data .
Committed revision 8.
% convert to hg once
initializing destination A-hg repository
scanning source...
sorting...
converting...
3 init projA
2 hello
1 world
0 nice day
updating tags
% update svn repository again
A todo
A todo/letter2.txt
Sending letter.txt
Adding todo
Adding todo/letter2.txt
Transmitting file data ..
Committed revision 9.
Committed revision 10.
Sending todo/letter2.txt
Transmitting file data .
Committed revision 11.
% test incremental conversion
scanning source...
sorting...
converting...
1 second letter
0 work in progress
updating tags
o 7 update tags files: .hgtags
|
o 6 work in progress files: todo/letter2.txt
|
o 5 second letter files: letter.txt todo/letter2.txt
|
o 4 update tags files: .hgtags
|
o 3 nice day files: letter.txt
|
o 2 world files: letter.txt
|
o 1 hello files: letter.txt
|
o 0 init projA files:
tip
v0.2
v0.1
# now tests that it works with trunk/tags layout, but no branches yet
% initial svn import
Adding projB/trunk
Adding projB/tags
Committed revision 12.
% update svn repository
Checked out revision 12.
A letter.txt
Adding letter.txt
Transmitting file data .
Committed revision 13.
Sending letter.txt
Transmitting file data .
Committed revision 14.
Committed revision 15.
Sending letter.txt
Transmitting file data .
Committed revision 16.
% convert to hg once
initializing destination B-hg repository
scanning source...
sorting...
converting...
3 init projB
2 hello
1 world
0 nice day
updating tags
% update svn repository again
A letter2.txt
Sending letter.txt
Adding letter2.txt
Transmitting file data ..
Committed revision 17.
Committed revision 18.
Sending letter2.txt
Transmitting file data .
Committed revision 19.
% test incremental conversion
scanning source...
sorting...
converting...
1 second letter
0 work in progress
updating tags
o 7 update tags files: .hgtags
|
o 6 work in progress files: letter2.txt
|
o 5 second letter files: letter.txt letter2.txt
|
o 4 update tags files: .hgtags
|
o 3 nice day files: letter.txt
|
o 2 world files: letter.txt
|
o 1 hello files: letter.txt
|
o 0 init projB files:
tip
v0.2
v0.1