test-conflict.t
298 lines
| 5.9 KiB
| text/troff
|
Tads3Lexer
/ tests / test-conflict.t
|
r11797 | $ hg init | ||
|
r21920 | $ cat << EOF > a | ||
> Small Mathematical Series. | ||||
> One | ||||
> Two | ||||
> Three | ||||
> Four | ||||
> Five | ||||
> Hop we are done. | ||||
> EOF | ||||
|
r11797 | $ hg add a | ||
|
r12156 | $ hg commit -m ancestor | ||
|
r21920 | $ cat << EOF > a | ||
> Small Mathematical Series. | ||||
> 1 | ||||
> 2 | ||||
> 3 | ||||
> 4 | ||||
> 5 | ||||
> Hop we are done. | ||||
> EOF | ||||
|
r12156 | $ hg commit -m branch1 | ||
|
r11797 | $ hg co 0 | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
|
r21920 | $ cat << EOF > a | ||
> Small Mathematical Series. | ||||
> 1 | ||||
> 2 | ||||
> 3 | ||||
> 6 | ||||
> 8 | ||||
> Hop we are done. | ||||
> EOF | ||||
|
r12156 | $ hg commit -m branch2 | ||
|
r11797 | created new head | ||
$ hg merge 1 | ||||
merging a | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r11797 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
|
r12316 | [1] | ||
|
r11797 | |||
$ hg id | ||||
|
r21920 | 618808747361+c0c68e4fe667+ tip | ||
|
r11797 | |||
|
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 | ||||
|
r38360 | # To continue: hg commit | ||
|
r39001 | # To abort: hg merge --abort | ||
|
r33766 | |||
|
r11797 | $ cat a | ||
|
r21920 | Small Mathematical Series. | ||
1 | ||||
2 | ||||
3 | ||||
|
r30062 | <<<<<<< working copy: 618808747361 - test: branch2 | ||
|
r21920 | 6 | ||
8 | ||||
|
r21519 | ======= | ||
|
r21920 | 4 | ||
5 | ||||
|
r30460 | >>>>>>> merge rev: c0c68e4fe667 - test: branch1 | ||
|
r21920 | Hop we are done. | ||
|
r21519 | |||
|
r33766 | $ hg status --config commands.status.verbose=0 | ||
|
r21519 | M a | ||
? a.orig | ||||
Verify custom conflict markers | ||||
$ hg up -q --clean . | ||||
|
r32047 | $ cat <<EOF >> .hg/hgrc | ||
> [ui] | ||||
> mergemarkertemplate = '{author} {rev}' | ||||
> EOF | ||||
|
r21519 | |||
$ hg merge 1 | ||||
merging a | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r21519 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
|
r21519 | [1] | ||
$ cat a | ||||
|
r21920 | Small Mathematical Series. | ||
1 | ||||
2 | ||||
3 | ||||
|
r30062 | <<<<<<< working copy: test 2 | ||
|
r21920 | 6 | ||
8 | ||||
|
r21519 | ======= | ||
|
r21920 | 4 | ||
5 | ||||
|
r30062 | >>>>>>> merge rev: test 1 | ||
|
r21920 | Hop we are done. | ||
|
r21519 | |||
|
r21864 | Verify line splitting of custom conflict marker which causes multiple lines | ||
$ hg up -q --clean . | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [ui] | ||||
> mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz | ||||
> EOF | ||||
$ hg -q merge 1 | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r21864 | [1] | ||
$ cat a | ||||
|
r21920 | Small Mathematical Series. | ||
1 | ||||
2 | ||||
3 | ||||
|
r30062 | <<<<<<< working copy: test 2 | ||
|
r21920 | 6 | ||
8 | ||||
|
r21864 | ======= | ||
|
r21920 | 4 | ||
5 | ||||
|
r30062 | >>>>>>> merge rev: test 1 | ||
|
r21920 | Hop we are done. | ||
|
r21864 | |||
|
r21865 | Verify line trimming of custom conflict marker using multi-byte characters | ||
$ hg up -q --clean . | ||||
|
r33262 | $ $PYTHON <<EOF | ||
|
r35967 | > fp = open('logfile', 'wb') | ||
|
r35965 | > fp.write(b'12345678901234567890123456789012345678901234567890' + | ||
> b'1234567890') # there are 5 more columns for 80 columns | ||||
|
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 | ||||
> [ui] | ||||
> mergemarkertemplate={desc|firstline} | ||||
> EOF | ||||
$ hg -q --encoding utf-8 merge 1 | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r21865 | [1] | ||
$ cat a | ||||
|
r21920 | Small Mathematical Series. | ||
1 | ||||
2 | ||||
3 | ||||
|
r30062 | <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345... | ||
|
r21920 | 6 | ||
8 | ||||
|
r21865 | ======= | ||
|
r21920 | 4 | ||
5 | ||||
|
r30062 | >>>>>>> merge rev: branch1 | ||
|
r21920 | Hop we are done. | ||
|
r21865 | |||
|
r21519 | Verify basic conflict markers | ||
|
r21865 | $ hg up -q --clean 2 | ||
|
r21519 | $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc | ||
$ hg merge 1 | ||||
merging a | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r21519 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
|
r21519 | [1] | ||
$ cat a | ||||
|
r21920 | Small Mathematical Series. | ||
1 | ||||
2 | ||||
3 | ||||
|
r30062 | <<<<<<< working copy | ||
|
r21920 | 6 | ||
8 | ||||
|
r11797 | ======= | ||
|
r21920 | 4 | ||
5 | ||||
|
r30062 | >>>>>>> merge rev | ||
|
r21920 | Hop we are done. | ||
|
r22028 | |||
internal:merge3 | ||||
$ hg up -q --clean . | ||||
$ hg merge 1 --tool internal:merge3 | ||||
merging a | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r22028 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
|
r22028 | [1] | ||
$ cat a | ||||
Small Mathematical Series. | ||||
|
r30062 | <<<<<<< working copy | ||
|
r22028 | 1 | ||
2 | ||||
3 | ||||
6 | ||||
8 | ||||
||||||| base | ||||
One | ||||
Two | ||||
Three | ||||
Four | ||||
Five | ||||
======= | ||||
1 | ||||
2 | ||||
3 | ||||
4 | ||||
5 | ||||
|
r30062 | >>>>>>> merge rev | ||
|
r22028 | Hop we are done. | ||
|
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 | ||||
|
r32698 | updated to "e0693e20f496: 123456789012345678901234567890123456789012345678901234567890????" | ||
|
r28029 | 1 other heads for branch "default" | ||
|
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 | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r26224 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
|
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 | ||||
|
r32698 | updated to "18b51d585961: Add some stuff at the beginning" | ||
|
r28029 | 1 other heads for branch "default" | ||
|
r26224 | $ hg merge --tool :merge-local | ||
merging a | ||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(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 | ||||