annotate tests/test-merge-prompt.t @ 25757:4d1382fd96ff

context: write dirstate out explicitly at the end of markcommitted To detect change of a file without redundant comparison of file content, dirstate recognizes a file as certainly clean, if: (1) it is already known as "normal", (2) dirstate entry for it has valid (= not "-1") timestamp, and (3) mode, size and timestamp of it on the filesystem are as same as ones expected in dirstate This works as expected in many cases, but doesn't in the corner case that changing a file keeps mode, size and timestamp of it on the filesystem. The timetable below shows steps in one of typical such situations: ---- ----------------------------------- ---------------- timestamp of "f" ---------------- dirstate file- time action mem file system ---- ----------------------------------- ---- ----- ----- * *** *** - 'hg transplant REV1 REV2 ...' - transplanting REV1 .... N - change "f", but keep size N (via 'patch.patch()') - 'dirstate.normal("f")' N *** (via 'repo.commit()') - transplanting REV2 - change "f", but keep size N (via 'patch.patch()') - aborted while patching N+1 - release wlock - 'dirstate.write()' N N N - 'hg status' shows "r1" as "clean" N N N ---- ----------------------------------- ---- ----- ----- The most important point is that 'dirstate.write()' is executed at N+1 or later. This causes writing dirstate timestamp N of "f" out successfully. If it is executed at N, 'parsers.pack_dirstate()' replaces timestamp N with "-1" before actual writing dirstate out. This issue can occur when 'hg transplant' satisfies conditions below: - multiple revisions to be transplanted change the same file - those revisions don't change mode and size of the file, and - the 2nd or later revision of them fails after changing the file The root cause of this issue is that files are changed without flushing in-memory dirstate changes via 'repo.commit()' (even though omitting 'dirstate.normallookup()' on files changed by 'patch.patch()' for efficiency also causes this issue). To detect changes of files correctly, this patch writes in-memory dirstate changes out explicitly after marking files as clean in 'committablectx.markcommitted()', which is invoked via 'repo.commit()'. After this change, timetable is changed as below: ---- ----------------------------------- ---------------- timestamp of "f" ---------------- dirstate file- time action mem file system ---- ----------------------------------- ---- ----- ----- * *** *** - 'hg transplant REV1 REV2 ...' - transplanting REV1 .... N - change "f", but keep size N (via 'patch.patch()') - 'dirstate.normal("f")' N *** (via 'repo.commit()') ----------------------------------- ---- ----- ----- - 'dirsttate.write()' -1 -1 ----------------------------------- ---- ----- ----- - transplanting REV2 - change "f", but keep size N (via 'patch.patch()') - aborted while patching N+1 - release wlock - 'dirstate.write()' -1 -1 N - 'hg status' shows "r1" as "clean" -1 -1 N ---- ----------------------------------- ---- ----- ----- To reproduce this issue in tests certainly, this patch emulates some timing critical actions as below: - change "f" at N 'patch.patch()' with 'fakepatchtime.py' explicitly changes mtime of patched files to "2000-01-01 00:00" (= N). - 'dirstate.write()' via 'repo.commit()' at N 'fakedirstatewritetime.py' forces 'pack_dirstate()' to use "2000-01-01 00:00" as "now", only if 'pack_dirstate()' is invoked via 'committablectx.markcommitted()'. - 'dirstate.write()' via releasing wlock at N+1 (or "not at N") 'pack_dirstate()' via releasing wlock uses actual timestamp at runtime as "now", and it should be different from the "2000-01-01 00:00" of "f". BTW, this patch doesn't test cases below, even though 'patch.patch()' is used similarly in these cases: 1. failure of 'hg import' or 'hg qpush' 2. success of 'hg import', 'hg qpush' or 'hg transplant' Case (1) above doesn't cause this kind of issue, because: - if patching is aborted by conflicts, changed files are committed changed files are marked as CLEAN, even though they are partially patched. - otherwise, dirstate are fully restored by 'dirstateguard' For example in timetable above, timestamp of "f" in .hg/dirstate is restored to -1 (or less than N), and subsequent 'hg status' can detect changes correctly. Case (2) always causes 'repo.status()' invocation via 'repo.commit()' just after changing files inside same wlock scope. ---- ----------------------------------- ---------------- timestamp of "f" ---------------- dirstate file- time action mem file system ---- ----------------------------------- ---- ----- ----- N *** *** - make file "f" clean N - execute 'hg foobar' .... - 'dirstate.normal("f")' N *** (e.g. via dirty check or previous 'repo.commit()') - change "f", but keep size N - 'repo.status()' (*1) (via 'repo.commit()') ---- ----------------------------------- ---- ----- ----- At a glance, 'repo.status()' at (*1) seems to cause similar issue (= "changed files are treated as clean"), but actually doesn't. 'dirstate._lastnormaltime' should be N at (*1) above, because 'dirstate.normal()' via dirty check is finished at N. Therefore, "f" changed at N (= 'dirstate._lastnormaltime') is forcibly treated as "unsure" at (*1), and changes are detected as expected (see 'dirstate.status()' for detail). If 'hg import' is executed with '--no-commit', 'repo.status()' isn't invoked just after changing files inside same wlock scope. But preceding 'dirstate.normal()' is invoked inside another wlock scope via 'cmdutil.bailifchanged()', and in-memory changes should be flushed at the end of that scope. Therefore, timestamp N of clean "f" should be replaced by -1, if 'dirstate.write()' is invoked at N. It means that condition of this issue isn't satisfied.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 08 Jul 2015 17:01:09 +0900
parents 9ab18a912c44
children 00209e38e7d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12259
diff changeset
1 Test for
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12259
diff changeset
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12259
diff changeset
3 (issue897)
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12259
diff changeset
4
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12259
diff changeset
5 840e2b315c1f: Fix misleading error and prompts during update/merge
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12259
diff changeset
6 (issue556)
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
7
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
8 $ status() {
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
9 > echo "--- status ---"
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
10 > hg st -A file1 file2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
11 > for file in file1 file2; do
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
12 > if [ -f $file ]; then
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
13 > echo "--- $file ---"
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
14 > cat $file
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
15 > else
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
16 > echo "*** $file does not exist"
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
17 > fi
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
18 > done
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
19 > }
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
20
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
21 $ hg init
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
22
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
23 $ echo 1 > file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
24 $ echo 2 > file2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
25 $ hg ci -Am 'added file1 and file2'
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
26 adding file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
27 adding file2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
28
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
29 $ hg rm file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
30 $ echo changed >> file2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
31 $ hg ci -m 'removed file1, changed file2'
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
32
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
33 $ hg co 0
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
34 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
35
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
36 $ echo changed >> file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
37 $ hg rm file2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
38 $ hg ci -m 'changed file1, removed file2'
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
39 created new head
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
40
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
41
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
42 Non-interactive merge:
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
43
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
44 $ hg merge -y
18543
c8ba98bf0e71 merge: don't indent "local changed %s which remote deleted" prompt
Mads Kiilerich <madski@unity3d.com>
parents: 15521
diff changeset
45 local changed file1 which remote deleted
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
46 use (c)hanged version or (d)elete? c
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
47 remote changed file2 which local deleted
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
48 use (c)hanged version or leave (d)eleted? c
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
50 (branch merge, don't forget to commit)
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
51
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
52 $ status
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
53 --- status ---
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
54 M file2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
55 C file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
56 --- file1 ---
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
57 1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
58 changed
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
59 --- file2 ---
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
60 2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
61 changed
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
62
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
63
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
64 Interactive merge:
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
65
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
66 $ hg co -C
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
68
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
69 $ hg merge --config ui.interactive=true <<EOF
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
70 > c
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
71 > d
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
72 > EOF
18543
c8ba98bf0e71 merge: don't indent "local changed %s which remote deleted" prompt
Mads Kiilerich <madski@unity3d.com>
parents: 15521
diff changeset
73 local changed file1 which remote deleted
22589
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
74 use (c)hanged version or (d)elete? c
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
75 remote changed file2 which local deleted
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
76 use (c)hanged version or leave (d)eleted? d
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
77 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
78 (branch merge, don't forget to commit)
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
79
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
80 $ status
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
81 --- status ---
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 12365
diff changeset
82 file2: * (glob)
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
83 C file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
84 --- file1 ---
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
85 1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
86 changed
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
87 *** file2 does not exist
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
88
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
89
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
90 Interactive merge with bad input:
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
91
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
92 $ hg co -C
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
93 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
94
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
95 $ hg merge --config ui.interactive=true <<EOF
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
96 > foo
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
97 > bar
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
98 > d
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
99 > baz
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
100 > c
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
101 > EOF
18543
c8ba98bf0e71 merge: don't indent "local changed %s which remote deleted" prompt
Mads Kiilerich <madski@unity3d.com>
parents: 15521
diff changeset
102 local changed file1 which remote deleted
22589
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
103 use (c)hanged version or (d)elete? foo
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
104 unrecognized response
18543
c8ba98bf0e71 merge: don't indent "local changed %s which remote deleted" prompt
Mads Kiilerich <madski@unity3d.com>
parents: 15521
diff changeset
105 local changed file1 which remote deleted
22589
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
106 use (c)hanged version or (d)elete? bar
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
107 unrecognized response
18543
c8ba98bf0e71 merge: don't indent "local changed %s which remote deleted" prompt
Mads Kiilerich <madski@unity3d.com>
parents: 15521
diff changeset
108 local changed file1 which remote deleted
22589
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
109 use (c)hanged version or (d)elete? d
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
110 remote changed file2 which local deleted
22589
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
111 use (c)hanged version or leave (d)eleted? baz
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
112 unrecognized response
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
113 remote changed file2 which local deleted
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
114 use (c)hanged version or leave (d)eleted? c
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
116 (branch merge, don't forget to commit)
5672
8a65ea986755 Tests for b5605d88dc27 and 840e2b315c1f (interactive prompts during merge)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
117
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
118 $ status
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
119 --- status ---
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
120 M file2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
121 R file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
122 *** file1 does not exist
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
123 --- file2 ---
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
124 2
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
125 changed
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
126
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
127
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
128 Interactive merge with not enough input:
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
129
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
130 $ hg co -C
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
131 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
132
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
133 $ hg merge --config ui.interactive=true <<EOF
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
134 > d
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
135 > EOF
18543
c8ba98bf0e71 merge: don't indent "local changed %s which remote deleted" prompt
Mads Kiilerich <madski@unity3d.com>
parents: 15521
diff changeset
136 local changed file1 which remote deleted
22589
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
137 use (c)hanged version or (d)elete? d
9ab18a912c44 ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents: 18543
diff changeset
138 remote changed file2 which local deleted
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
139 use (c)hanged version or leave (d)eleted? abort: response expected
12365
22f3353bcc36 tests: cleanup exit code handling in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12328
diff changeset
140 [255]
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
141
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
142 $ status
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
143 --- status ---
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 12365
diff changeset
144 file2: * (glob)
12259
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
145 C file1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
146 --- file1 ---
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
147 1
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
148 changed
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
149 *** file2 does not exist
7b05cb9ac6d2 tests: unify test-merge-prompt
Adrian Buehlmann <adrian@cadifra.com>
parents: 5672
diff changeset
150