##// END OF EJS Templates
update: set custom conflict label for base commit...
update: set custom conflict label for base commit Differential Revision: https://phab.mercurial-scm.org/D12022

File last commit:

r49436:7e503eff default
r49436:7e503eff default
Show More
test-conflict.t
422 lines | 8.3 KiB | text/troff | Tads3Lexer
Nicolas Dumazet
tests: unify test-conflict
r11797 $ hg init
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 $ cat << EOF > a
> Small Mathematical Series.
> One
> Two
> Three
> Four
> Five
> Hop we are done.
> EOF
Nicolas Dumazet
tests: unify test-conflict
r11797 $ hg add a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg commit -m ancestor
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 $ cat << EOF > a
> Small Mathematical Series.
> 1
> 2
> 3
> 4
> 5
> Hop we are done.
> EOF
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg commit -m branch1
Nicolas Dumazet
tests: unify test-conflict
r11797 $ hg co 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 $ cat << EOF > a
> Small Mathematical Series.
> 1
> 2
> 3
> 6
> 8
> Hop we are done.
> EOF
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg commit -m branch2
Nicolas Dumazet
tests: unify test-conflict
r11797 created new head
$ hg merge 1
merging a
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
Nicolas Dumazet
tests: unify test-conflict
r11797 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
Pulkit Goyal
merge: add `--abort` flag which can abort the merge...
r35722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Nicolas Dumazet
tests: unify test-conflict
r11797
$ hg id
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 618808747361+c0c68e4fe667+ tip
Nicolas Dumazet
tests: unify test-conflict
r11797
Pulkit Goyal
morestatus: move fb extension to core by plugging to `hg status --verbose`...
r33766 $ echo "[commands]" >> $HGRCPATH
$ echo "status.verbose=true" >> $HGRCPATH
$ hg status
M a
? a.orig
# The repository is in an unfinished *merge* state.
# Unresolved merge conflicts:
#
# a
#
# To mark files as resolved: hg resolve --mark FILE
Pulkit Goyal
morestatus: remove some extra spaces...
r38360 # To continue: hg commit
Pulkit Goyal
status: advertise --abort instead of 'update -C .' to abort a merge...
r39001 # To abort: hg merge --abort
Pulkit Goyal
morestatus: move fb extension to core by plugging to `hg status --verbose`...
r33766
Yuya Nishihara
tests: show that the structure of the more status output looks weird...
r39772 $ hg status -Tjson
[
{
Rodrigo Damazio Bovendorp
status: outputting structured unfinished-operation information...
r44313 "itemtype": "file",
Yuya Nishihara
tests: show that the structure of the more status output looks weird...
r39772 "path": "a",
Rodrigo Damazio Bovendorp
status: add template/json data about whether a file has unresolved conflicts...
r44294 "status": "M",
"unresolved": true
Yuya Nishihara
tests: show that the structure of the more status output looks weird...
r39772 },
{
Rodrigo Damazio Bovendorp
status: outputting structured unfinished-operation information...
r44313 "itemtype": "file",
Yuya Nishihara
tests: show that the structure of the more status output looks weird...
r39772 "path": "a.orig",
"status": "?"
Rodrigo Damazio Bovendorp
status: outputting structured unfinished-operation information...
r44313 },
{
"itemtype": "morestatus",
"unfinished": "merge",
"unfinishedmsg": "To continue: hg commit\nTo abort: hg merge --abort"
Yuya Nishihara
tests: show that the structure of the more status output looks weird...
r39772 }
]
Pulkit Goyal
morestatus: move fb extension to core by plugging to `hg status --verbose`...
r33766
Martin von Zweigbergk
status: disable morestatus when using -0...
r46696 $ hg status -0
M a\x00? a.orig\x00 (no-eol) (esc)
Nicolas Dumazet
tests: unify test-conflict
r11797 $ cat a
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Small Mathematical Series.
1
2
3
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 <<<<<<< working copy: 618808747361 - test: branch2
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 6
8
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 =======
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 4
5
Kostia Balytskyi
conflicts: make spacing consistent in conflict markers...
r30460 >>>>>>> merge rev: c0c68e4fe667 - test: branch1
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Hop we are done.
Durham Goode
merge: add conflict marker formatter (BC)...
r21519
Pulkit Goyal
morestatus: move fb extension to core by plugging to `hg status --verbose`...
r33766 $ hg status --config commands.status.verbose=0
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 M a
? a.orig
Verify custom conflict markers
$ hg up -q --clean .
Yuya Nishihara
filemerge: optionally strip quotes from merge marker template (BC)...
r32047 $ cat <<EOF >> .hg/hgrc
Martin von Zweigbergk
config: rename ui.mergemarkertemplate to command-templates.mergemarker...
r46352 > [command-templates]
> mergemarker = '{author} {rev}'
> EOF
$ hg merge 1
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
[1]
$ cat a
Small Mathematical Series.
1
2
3
<<<<<<< working copy: test 2
6
8
=======
4
5
>>>>>>> merge rev: test 1
Hop we are done.
Verify custom conflict markers with legacy config name
$ hg up -q --clean .
$ cat <<EOF >> .hg/hgrc
Yuya Nishihara
filemerge: optionally strip quotes from merge marker template (BC)...
r32047 > [ui]
> mergemarkertemplate = '{author} {rev}'
> EOF
Durham Goode
merge: add conflict marker formatter (BC)...
r21519
$ hg merge 1
merging a
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
Pulkit Goyal
merge: add `--abort` flag which can abort the merge...
r35722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 [1]
$ cat a
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Small Mathematical Series.
1
2
3
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 <<<<<<< working copy: test 2
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 6
8
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 =======
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 4
5
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 >>>>>>> merge rev: test 1
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Hop we are done.
Durham Goode
merge: add conflict marker formatter (BC)...
r21519
FUJIWARA Katsunori
filemerge: use only the first line of the generated conflict marker for safety...
r21864 Verify line splitting of custom conflict marker which causes multiple lines
$ hg up -q --clean .
$ cat >> .hg/hgrc <<EOF
Martin von Zweigbergk
config: rename ui.mergemarkertemplate to command-templates.mergemarker...
r46352 > [command-templates]
> mergemarker={author} {rev}\nfoo\nbar\nbaz
FUJIWARA Katsunori
filemerge: use only the first line of the generated conflict marker for safety...
r21864 > EOF
$ hg -q merge 1
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
FUJIWARA Katsunori
filemerge: use only the first line of the generated conflict marker for safety...
r21864 [1]
$ cat a
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Small Mathematical Series.
1
2
3
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 <<<<<<< working copy: test 2
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 6
8
FUJIWARA Katsunori
filemerge: use only the first line of the generated conflict marker for safety...
r21864 =======
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 4
5
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 >>>>>>> merge rev: test 1
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Hop we are done.
FUJIWARA Katsunori
filemerge: use only the first line of the generated conflict marker for safety...
r21864
FUJIWARA Katsunori
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly...
r21865 Verify line trimming of custom conflict marker using multi-byte characters
$ hg up -q --clean .
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" <<EOF
Pulkit Goyal
py3: make sure we open the file in bytes mode...
r35967 > fp = open('logfile', 'wb')
Pulkit Goyal
py3: add b'' prefixes to string literals in test files...
r35965 > fp.write(b'12345678901234567890123456789012345678901234567890' +
> b'1234567890') # there are 5 more columns for 80 columns
FUJIWARA Katsunori
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly...
r21865 >
> # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
> fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
>
> fp.close()
> EOF
$ hg add logfile
$ hg --encoding utf-8 commit --logfile logfile
$ cat >> .hg/hgrc <<EOF
Martin von Zweigbergk
config: rename ui.mergemarkertemplate to command-templates.mergemarker...
r46352 > [command-templates]
> mergemarker={desc|firstline}
FUJIWARA Katsunori
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly...
r21865 > EOF
$ hg -q --encoding utf-8 merge 1
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
FUJIWARA Katsunori
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly...
r21865 [1]
$ cat a
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Small Mathematical Series.
1
2
3
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345...
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 6
8
FUJIWARA Katsunori
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly...
r21865 =======
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 4
5
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 >>>>>>> merge rev: branch1
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Hop we are done.
FUJIWARA Katsunori
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly...
r21865
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 Verify basic conflict markers
FUJIWARA Katsunori
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly...
r21865 $ hg up -q --clean 2
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc
$ hg merge 1
merging a
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
Pulkit Goyal
merge: add `--abort` flag which can abort the merge...
r35722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
Durham Goode
merge: add conflict marker formatter (BC)...
r21519 [1]
$ cat a
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Small Mathematical Series.
1
2
3
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 <<<<<<< working copy
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 6
8
Nicolas Dumazet
tests: unify test-conflict
r11797 =======
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 4
5
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 >>>>>>> merge rev
Pierre-Yves David
test: use more elaborated content in ``test-conflict.t``...
r21920 Hop we are done.
Pierre-Yves David
merge: add an internal:merge3 tool...
r22028
internal:merge3
$ hg up -q --clean .
$ hg merge 1 --tool internal:merge3
merging a
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
Pierre-Yves David
merge: add an internal:merge3 tool...
r22028 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
Pulkit Goyal
merge: add `--abort` flag which can abort the merge...
r35722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
Pierre-Yves David
merge: add an internal:merge3 tool...
r22028 [1]
$ cat a
Small Mathematical Series.
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 <<<<<<< working copy
Pierre-Yves David
merge: add an internal:merge3 tool...
r22028 1
2
3
6
8
Martin von Zweigbergk
merge: set custom conflict label for base commit...
r49435 ||||||| common ancestor
Pierre-Yves David
merge: add an internal:merge3 tool...
r22028 One
Two
Three
Four
Five
=======
1
2
3
4
5
Simon Farnsworth
merge: add conflict labels to merge command...
r30062 >>>>>>> merge rev
Pierre-Yves David
merge: add an internal:merge3 tool...
r22028 Hop we are done.
Jordi Gutiérrez Hermoso
filemerge: add non-interactive :merge-local and :merge-other...
r26224
Martin von Zweigbergk
mergetools: add new conflict marker format with diffs in...
r46724 internal:mergediff
$ hg co -C 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat << EOF > a
> Small Mathematical Series.
> 1
> 2
> 3
> 4
> 4.5
> 5
> Hop we are done.
> EOF
$ hg co -m 2 -t internal:mergediff
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges
[1]
$ cat a
Small Mathematical Series.
1
2
3
<<<<<<<
Martin von Zweigbergk
update: set custom conflict label for base commit...
r49436 ------- working copy parent
Martin von Zweigbergk
mergetools: add new conflict marker format with diffs in...
r46724 +++++++ working copy
4
+4.5
5
======= destination
6
8
>>>>>>>
Hop we are done.
Test the same thing as above but modify a bit more so we instead get the working
copy in full and the diff from base to destination.
$ hg co -C 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat << EOF > a
> Small Mathematical Series.
> 1
> 2
> 3.5
> 4.5
> 5.5
> Hop we are done.
> EOF
$ hg co -m 2 -t internal:mergediff
merging a
warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges
[1]
$ cat a
Small Mathematical Series.
1
2
<<<<<<<
======= working copy
3.5
4.5
5.5
Martin von Zweigbergk
update: set custom conflict label for base commit...
r49436 ------- working copy parent
Martin von Zweigbergk
mergetools: add new conflict marker format with diffs in...
r46724 +++++++ destination
3
-4
-5
+6
+8
>>>>>>>
Hop we are done.
Jordi Gutiérrez Hermoso
filemerge: add non-interactive :merge-local and :merge-other...
r26224 Add some unconflicting changes on each head, to make sure we really
are merging, unlike :local and :other
$ hg up -C
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Pulkit Goyal
update: show the commit to which we updated in case of multiple heads (BC)...
r32698 updated to "e0693e20f496: 123456789012345678901234567890123456789012345678901234567890????"
Pierre-Yves David
update: warn about other topological heads on bare update...
r28029 1 other heads for branch "default"
Jordi Gutiérrez Hermoso
filemerge: add non-interactive :merge-local and :merge-other...
r26224 $ printf "\n\nEnd of file\n" >> a
$ hg ci -m "Add some stuff at the end"
$ hg up -r 1
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ printf "Start of file\n\n\n" > tmp
$ cat a >> tmp
$ mv tmp a
$ hg ci -m "Add some stuff at the beginning"
Now test :merge-other and :merge-local
$ hg merge
merging a
Siddharth Agarwal
simplemerge: move conflict warning message to filemerge...
r26614 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
Jordi Gutiérrez Hermoso
filemerge: add non-interactive :merge-local and :merge-other...
r26224 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
Pulkit Goyal
merge: add `--abort` flag which can abort the merge...
r35722 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
Jordi Gutiérrez Hermoso
filemerge: add non-interactive :merge-local and :merge-other...
r26224 [1]
$ hg resolve --tool :merge-other a
merging a
(no more unresolved files)
$ cat a
Start of file
Small Mathematical Series.
1
2
3
6
8
Hop we are done.
End of file
$ hg up -C
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
Pulkit Goyal
update: show the commit to which we updated in case of multiple heads (BC)...
r32698 updated to "18b51d585961: Add some stuff at the beginning"
Pierre-Yves David
update: warn about other topological heads on bare update...
r28029 1 other heads for branch "default"
Jordi Gutiérrez Hermoso
filemerge: add non-interactive :merge-local and :merge-other...
r26224 $ hg merge --tool :merge-local
merging a
Martin von Zweigbergk
merge: consider the file merged when using :merge-{local,other}...
r49415 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
Jordi Gutiérrez Hermoso
filemerge: add non-interactive :merge-local and :merge-other...
r26224 (branch merge, don't forget to commit)
$ cat a
Start of file
Small Mathematical Series.
1
2
3
4
5
Hop we are done.
End of file