test-merge-types.t
472 lines
| 13.7 KiB
| text/troff
|
Tads3Lexer
/ tests / test-merge-types.t
|
r22046 | #require symlink execbit | ||
|
r15441 | |||
|
r18337 | $ tellmeabout() { | ||
> if [ -h $1 ]; then | ||||
> echo $1 is a symlink: | ||||
> $TESTDIR/readlink.py $1 | ||||
> elif [ -x $1 ]; then | ||||
> echo $1 is an executable file with content: | ||||
> cat $1 | ||||
> else | ||||
> echo $1 is a plain file with content: | ||||
> cat $1 | ||||
> fi | ||||
> } | ||||
$ hg init test1 | ||||
$ cd test1 | ||||
|
r12279 | |||
$ echo a > a | ||||
|
r18337 | $ hg ci -Aqmadd | ||
|
r12279 | $ chmod +x a | ||
$ hg ci -mexecutable | ||||
|
r18337 | $ hg up -q 0 | ||
|
r12279 | $ rm a | ||
$ ln -s symlink a | ||||
$ hg ci -msymlink | ||||
created new head | ||||
|
r18337 | Symlink is local parent, executable is other: | ||
|
r12279 | $ hg merge --debug | ||
resolving manifests | ||||
|
r18605 | branchmerge: True, force: False, partial: False | ||
|
r15625 | ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c | ||
|
r21391 | preserving a for resolve of a | ||
|
r26618 | a: versions differ -> m (premerge) | ||
|
r40507 | tool internal:merge (for pattern a) can't handle symlinks | ||
|
r40503 | couldn't find merge tool hgmerge | ||
no tool found to merge a | ||||
picked tool ':prompt' for a (binary False symlink True changedelete False) | ||||
|
r42765 | file 'a' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r18338 | 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 | ||
|
r18338 | [1] | ||
|
r12279 | |||
|
r18337 | $ tellmeabout a | ||
|
r18338 | a is a symlink: | ||
a -> symlink | ||||
$ hg resolve a --tool internal:other | ||||
|
r21947 | (no more unresolved files) | ||
|
r18338 | $ tellmeabout a | ||
a is an executable file with content: | ||||
a | ||||
$ hg st | ||||
M a | ||||
? a.orig | ||||
|
r12279 | |||
|
r18337 | Symlink is other parent, executable is local: | ||
|
r12279 | |||
$ hg update -C 1 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
|
r26518 | $ hg merge --debug --tool :union | ||
|
r12279 | resolving manifests | ||
|
r18605 | branchmerge: True, force: False, partial: False | ||
|
r15625 | ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f | ||
|
r21391 | preserving a for resolve of a | ||
|
r26618 | a: versions differ -> m (premerge) | ||
|
r27161 | picked tool ':union' for a (binary False symlink True changedelete False) | ||
|
r18338 | merging a | ||
my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da | ||||
|
r26518 | warning: internal :union cannot merge symlinks for a | ||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r18338 | 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 | ||
|
r18338 | [1] | ||
|
r12279 | |||
|
r18337 | $ tellmeabout a | ||
|
r18338 | a is an executable file with content: | ||
a | ||||
|
r12279 | |||
|
r26519 | $ hg update -C 1 | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge --debug --tool :merge3 | ||||
resolving manifests | ||||
branchmerge: True, force: False, partial: False | ||||
ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f | ||||
preserving a for resolve of a | ||||
|
r26618 | a: versions differ -> m (premerge) | ||
|
r27161 | picked tool ':merge3' for a (binary False symlink True changedelete False) | ||
|
r26519 | merging a | ||
my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da | ||||
warning: internal :merge3 cannot merge symlinks for a | ||||
|
r26614 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
|
r26519 | 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 | ||
|
r26519 | [1] | ||
$ tellmeabout a | ||||
a is an executable file with content: | ||||
a | ||||
|
r26892 | $ hg update -C 1 | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge --debug --tool :merge-local | ||||
resolving manifests | ||||
branchmerge: True, force: False, partial: False | ||||
ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f | ||||
preserving a for resolve of a | ||||
a: versions differ -> m (premerge) | ||||
|
r27161 | picked tool ':merge-local' for a (binary False symlink True changedelete False) | ||
|
r26892 | merging a | ||
my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da | ||||
|
r26893 | warning: internal :merge-local cannot merge symlinks for a | ||
|
r26892 | 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 | ||
|
r26892 | [1] | ||
$ tellmeabout a | ||||
a is an executable file with content: | ||||
a | ||||
$ hg update -C 1 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg merge --debug --tool :merge-other | ||||
resolving manifests | ||||
branchmerge: True, force: False, partial: False | ||||
ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f | ||||
preserving a for resolve of a | ||||
a: versions differ -> m (premerge) | ||||
|
r27161 | picked tool ':merge-other' for a (binary False symlink True changedelete False) | ||
|
r26892 | merging a | ||
my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da | ||||
|
r26893 | warning: internal :merge-other cannot merge symlinks for a | ||
|
r26892 | 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 | ||
|
r26892 | [1] | ||
$ tellmeabout a | ||||
a is an executable file with content: | ||||
a | ||||
|
r16255 | Update to link without local change should get us a symlink (issue3316): | ||
|
r17110 | $ hg up -C 0 | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg up | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
|
r32698 | updated to "521a1e40188f: symlink" | ||
|
r28029 | 1 other heads for branch "default" | ||
|
r17110 | $ hg st | ||
|
r18338 | ? a.orig | ||
|
r16255 | |||
Update to link with local change should cause a merge prompt (issue3200): | ||||
|
r18337 | $ hg up -Cq 0 | ||
|
r16255 | $ echo data > a | ||
|
r40503 | $ HGMERGE= hg up -y --debug --config ui.merge= | ||
|
r16255 | resolving manifests | ||
|
r18605 | branchmerge: False, force: False, partial: False | ||
|
r16255 | ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f | ||
|
r21391 | preserving a for resolve of a | ||
|
r26618 | a: versions differ -> m (premerge) | ||
|
r16355 | (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re) | ||
|
r32253 | no tool found to merge a | ||
|
r27161 | picked tool ':prompt' for a (binary False symlink True changedelete False) | ||
|
r42765 | file 'a' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r27164 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
use 'hg resolve' to retry unresolved file merges | ||||
|
r32698 | updated to "521a1e40188f: symlink" | ||
|
r28029 | 1 other heads for branch "default" | ||
|
r27164 | [1] | ||
|
r16255 | $ hg diff --git | ||
diff --git a/a b/a | ||||
old mode 120000 | ||||
new mode 100644 | ||||
--- a/a | ||||
+++ b/a | ||||
@@ -1,1 +1,1 @@ | ||||
-symlink | ||||
\ No newline at end of file | ||||
+data | ||||
|
r18337 | Test only 'l' change - happens rarely, except when recovering from situations | ||
where that was what happened. | ||||
$ hg init test2 | ||||
$ cd test2 | ||||
$ printf base > f | ||||
$ hg ci -Aqm0 | ||||
$ echo file > f | ||||
$ echo content >> f | ||||
$ hg ci -qm1 | ||||
$ hg up -qr0 | ||||
$ rm f | ||||
$ ln -s base f | ||||
$ hg ci -qm2 | ||||
$ hg merge | ||||
|
r40507 | tool internal:merge (for pattern f) can't handle symlinks | ||
|
r40503 | no tool found to merge f | ||
|
r42765 | file 'f' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r18338 | 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 | ||
|
r18338 | [1] | ||
|
r18337 | $ tellmeabout f | ||
f is a symlink: | ||||
|
r18338 | f -> base | ||
|
r18337 | |||
$ hg up -Cqr1 | ||||
$ hg merge | ||||
|
r40507 | tool internal:merge (for pattern f) can't handle symlinks | ||
|
r40503 | no tool found to merge f | ||
|
r42765 | file 'f' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r18338 | 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 | ||
|
r18338 | [1] | ||
|
r18337 | $ tellmeabout f | ||
f is a plain file with content: | ||||
file | ||||
content | ||||
$ cd .. | ||||
Test removed 'x' flag merged with change to symlink | ||||
$ hg init test3 | ||||
$ cd test3 | ||||
$ echo f > f | ||||
$ chmod +x f | ||||
$ hg ci -Aqm0 | ||||
$ chmod -x f | ||||
$ hg ci -qm1 | ||||
$ hg up -qr0 | ||||
$ rm f | ||||
$ ln -s dangling f | ||||
$ hg ci -qm2 | ||||
$ hg merge | ||||
|
r40507 | tool internal:merge (for pattern f) can't handle symlinks | ||
|
r40503 | no tool found to merge f | ||
|
r42765 | file 'f' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r18338 | 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 | ||
|
r18338 | [1] | ||
|
r18337 | $ tellmeabout f | ||
f is a symlink: | ||||
f -> dangling | ||||
$ hg up -Cqr1 | ||||
$ hg merge | ||||
|
r40507 | tool internal:merge (for pattern f) can't handle symlinks | ||
|
r40503 | no tool found to merge f | ||
|
r42765 | file 'f' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r18338 | 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 | ||
|
r18338 | [1] | ||
|
r18337 | $ tellmeabout f | ||
|
r18338 | f is a plain file with content: | ||
f | ||||
|
r18337 | |||
|
r18505 | Test removed 'x' flag merged with content change - both ways | ||
$ hg up -Cqr0 | ||||
$ echo change > f | ||||
$ hg ci -qm3 | ||||
$ hg merge -r1 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ tellmeabout f | ||||
f is a plain file with content: | ||||
change | ||||
$ hg up -qCr1 | ||||
$ hg merge -r3 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ tellmeabout f | ||||
f is a plain file with content: | ||||
change | ||||
|
r18337 | $ cd .. | ||
Test merge with no common ancestor: | ||||
a: just different | ||||
b: x vs -, different (cannot calculate x, cannot ask merge tool) | ||||
c: x vs -, same (cannot calculate x, merge tool is no good) | ||||
d: x vs l, different | ||||
e: x vs l, same | ||||
f: - vs l, different | ||||
g: - vs l, same | ||||
h: l vs l, different | ||||
(where same means the filelog entry is shared and there thus is an ancestor!) | ||||
$ hg init test4 | ||||
$ cd test4 | ||||
$ echo 0 > 0 | ||||
$ hg ci -Aqm0 | ||||
$ echo 1 > a | ||||
$ echo 1 > b | ||||
$ chmod +x b | ||||
|
r30160 | $ echo 1 > bx | ||
$ chmod +x bx | ||||
|
r18337 | $ echo x > c | ||
$ chmod +x c | ||||
$ echo 1 > d | ||||
$ chmod +x d | ||||
$ printf x > e | ||||
$ chmod +x e | ||||
$ echo 1 > f | ||||
$ printf x > g | ||||
$ ln -s 1 h | ||||
$ hg ci -qAm1 | ||||
$ hg up -qr0 | ||||
$ echo 2 > a | ||||
$ echo 2 > b | ||||
|
r30160 | $ echo 2 > bx | ||
$ chmod +x bx | ||||
|
r18337 | $ echo x > c | ||
$ ln -s 2 d | ||||
$ ln -s x e | ||||
$ ln -s 2 f | ||||
$ ln -s x g | ||||
$ ln -s 2 h | ||||
$ hg ci -Aqm2 | ||||
$ hg merge | ||||
merging a | ||||
|
r30162 | warning: cannot merge flags for b without common ancestor - keeping local flags | ||
|
r18337 | merging b | ||
|
r30160 | merging bx | ||
|
r30162 | warning: cannot merge flags for c without common ancestor - keeping local flags | ||
|
r40507 | tool internal:merge (for pattern d) can't handle symlinks | ||
|
r40503 | no tool found to merge d | ||
|
r42765 | file 'd' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r40507 | tool internal:merge (for pattern f) can't handle symlinks | ||
|
r40503 | no tool found to merge f | ||
|
r42765 | file 'f' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r40507 | tool internal:merge (for pattern h) can't handle symlinks | ||
|
r40503 | no tool found to merge h | ||
|
r42765 | file 'h' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r26618 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | ||||
|
r30160 | warning: conflicts while merging bx! (edit, then use 'hg resolve --mark') | ||
3 files updated, 0 files merged, 0 files removed, 6 files unresolved | ||||
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
|
r18337 | [1] | ||
$ hg resolve -l | ||||
U a | ||||
U b | ||||
|
r30160 | U bx | ||
|
r18337 | U d | ||
U f | ||||
U h | ||||
$ tellmeabout a | ||||
a is a plain file with content: | ||||
|
r30160 | <<<<<<< working copy: 0c617753b41b - test: 2 | ||
|
r18337 | 2 | ||
======= | ||||
1 | ||||
|
r30460 | >>>>>>> merge rev: 2e60aa20b912 - test: 1 | ||
|
r18337 | $ tellmeabout b | ||
|
r18338 | b is a plain file with content: | ||
|
r30160 | <<<<<<< working copy: 0c617753b41b - test: 2 | ||
|
r18337 | 2 | ||
======= | ||||
1 | ||||
|
r30460 | >>>>>>> merge rev: 2e60aa20b912 - test: 1 | ||
|
r18337 | $ tellmeabout c | ||
|
r18338 | c is a plain file with content: | ||
|
r18337 | x | ||
$ tellmeabout d | ||||
|
r18338 | d is a symlink: | ||
d -> 2 | ||||
|
r18337 | $ tellmeabout e | ||
|
r18338 | e is a symlink: | ||
e -> x | ||||
|
r18337 | $ tellmeabout f | ||
f is a symlink: | ||||
f -> 2 | ||||
$ tellmeabout g | ||||
g is a symlink: | ||||
g -> x | ||||
$ tellmeabout h | ||||
h is a symlink: | ||||
h -> 2 | ||||
$ hg up -Cqr1 | ||||
$ hg merge | ||||
merging a | ||||
|
r30162 | warning: cannot merge flags for b without common ancestor - keeping local flags | ||
|
r18337 | merging b | ||
|
r30160 | merging bx | ||
|
r30162 | warning: cannot merge flags for c without common ancestor - keeping local flags | ||
|
r40507 | tool internal:merge (for pattern d) can't handle symlinks | ||
|
r40503 | no tool found to merge d | ||
|
r42765 | file 'd' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r40507 | tool internal:merge (for pattern f) can't handle symlinks | ||
|
r40503 | no tool found to merge f | ||
|
r42765 | file 'f' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r40507 | tool internal:merge (for pattern h) can't handle symlinks | ||
|
r40503 | no tool found to merge h | ||
|
r42765 | file 'h' needs to be resolved. | ||
You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | ||||
What do you want to do? u | ||||
|
r26618 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | ||
warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | ||||
|
r30160 | warning: conflicts while merging bx! (edit, then use 'hg resolve --mark') | ||
3 files updated, 0 files merged, 0 files removed, 6 files unresolved | ||||
|
r35722 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | ||
|
r18337 | [1] | ||
$ tellmeabout a | ||||
a is a plain file with content: | ||||
|
r30460 | <<<<<<< working copy: 2e60aa20b912 - test: 1 | ||
|
r18337 | 1 | ||
======= | ||||
2 | ||||
|
r30160 | >>>>>>> merge rev: 0c617753b41b - test: 2 | ||
|
r18337 | $ tellmeabout b | ||
b is an executable file with content: | ||||
|
r30460 | <<<<<<< working copy: 2e60aa20b912 - test: 1 | ||
|
r18337 | 1 | ||
======= | ||||
2 | ||||
|
r30160 | >>>>>>> merge rev: 0c617753b41b - test: 2 | ||
|
r18337 | $ tellmeabout c | ||
|
r20897 | c is an executable file with content: | ||
|
r18337 | x | ||
$ tellmeabout d | ||||
|
r18338 | d is an executable file with content: | ||
|
r18337 | 1 | ||
$ tellmeabout e | ||||
|
r18338 | e is an executable file with content: | ||
|
r18337 | x (no-eol) | ||
$ tellmeabout f | ||||
f is a plain file with content: | ||||
1 | ||||
$ tellmeabout g | ||||
g is a plain file with content: | ||||
x (no-eol) | ||||
$ tellmeabout h | ||||
h is a symlink: | ||||
h -> 1 | ||||
$ cd .. | ||||