##// END OF EJS Templates
tests: clarify some missing output in test-merge-subrepos...
marmoute -
r47472:b4ad45f2 default
parent child Browse files
Show More
@@ -1,141 +1,148 b''
1 1 $ hg init
2 2
3 3 $ echo a > a
4 4 $ hg ci -qAm 'add a'
5 5
6 6 $ hg init subrepo
7 7 $ echo 'subrepo = http://example.net/libfoo' > .hgsub
8 8 $ hg ci -qAm 'added subrepo'
9 9
10 10 $ hg up -qC 0
11 11 $ echo ax > a
12 12 $ hg ci -m 'changed a'
13 13 created new head
14 14
15 15 $ hg up -qC 1
16 16 $ cd subrepo
17 17 $ echo b > b
18 18 $ hg add b
19 19 $ cd ..
20 20
21 21 Should fail, since there are added files to subrepo:
22 22
23 23 $ hg merge
24 24 abort: uncommitted changes in subrepository "subrepo"
25 25 [255]
26 26
27 27 Deleted files trigger a '+' marker in top level repos. Deleted files are also
28 28 noticed by `update --check` in the top level repo.
29 29
30 30 $ hg ci -Sqm 'add b'
31 31 $ echo change > subrepo/b
32 32
33 33 $ hg ci -Sm 'change b'
34 34 committing subrepository subrepo
35 35
36 36 $ rm a
37 37 $ hg id
38 38 9bfe45a197d7+ tip
39 39 $ hg sum
40 40 parent: 4:9bfe45a197d7 tip
41 41 change b
42 42 branch: default
43 43 commit: 1 deleted (clean)
44 44 update: 1 new changesets, 2 branch heads (merge)
45 45 phases: 5 draft
46 46
47 47 $ hg up --check -r '.^'
48 48 abort: uncommitted changes
49 49 [20]
50 50 $ hg st -S
51 51 ! a
52 52 $ hg up -Cq .
53 53
54 54 Test that dirty is consistent through subrepos
55 55
56 56 $ rm subrepo/b
57 57
58 58 A deleted subrepo file is flagged as dirty, like the top level repo
59 59
60 60 $ hg id --config extensions.blackbox= --config blackbox.dirty=True \
61 61 > --config blackbox.track='command commandfinish'
62 62 9bfe45a197d7+ tip
63 63 $ cat .hg/blackbox.log
64 64 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --cmdserver chgunix * (glob) (chg !)
65 65 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* (glob)
66 66 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob)
67 67
68 68 TODO: a deleted file should be listed as such, like the top level repo
69 69
70 70 $ hg sum
71 71 parent: 4:9bfe45a197d7 tip
72 72 change b
73 73 branch: default
74 74 commit: (clean)
75 75 update: 1 new changesets, 2 branch heads (merge)
76 76 phases: 5 draft
77 77
78 78 Modified subrepo files are noticed by `update --check` and `summary`
79 79
80 80 $ echo mod > subrepo/b
81 81 $ hg st -S
82 82 M subrepo/b
83 83
84 84 $ hg up -r '.^' --check
85 85 abort: uncommitted changes in subrepository "subrepo"
86 86 [255]
87 87
88 88 $ hg sum
89 89 parent: 4:9bfe45a197d7 tip
90 90 change b
91 91 branch: default
92 92 commit: 1 subrepos
93 93 update: 1 new changesets, 2 branch heads (merge)
94 94 phases: 5 draft
95 95
96 96 TODO: why is -R needed here? If it's because the subrepo is treated as a
97 97 discrete unit, then this should probably warn or something.
98 98 $ hg revert -R subrepo --no-backup subrepo/b -r .
99 99
100 100 $ rm subrepo/b
101 101 $ hg st -S
102 102 ! subrepo/b
103 103
104 104 `hg update --check` notices a subrepo with a missing file, like it notices a
105 105 missing file in the top level repo.
106 106
107 107 $ hg up -r '.^' --check
108 108 abort: uncommitted changes in subrepository "subrepo"
109 109 [255]
110 110
111 111 $ hg up -r '.^' --config ui.interactive=True << EOF
112 112 > d
113 113 > EOF
114 114 file 'b' was deleted in local [working copy] but was modified in other [destination].
115 115 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
116 116 What do you want to do? d
117 117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 118
119 119 XXX: There's a difference between wdir() and '.', so there should be a status.
120 `hg files -S` from the top is also missing 'subrepo/b'.
120 `hg files -S` from the top is also missing 'subrepo/b'. The files should be
121 seen as deleted (and, maybe even missing? in which case `hg files` should list
122 it)
121 123
122 124 $ hg st -S
125 R subrepo/b (missing-correct-output !)
123 126 $ hg st -R subrepo
127 R subrepo/b (missing-correct-output !)
128
129 (note: return [1] because no files "match" since the list is empty)
130
124 131 $ hg files -R subrepo
125 132 [1]
126 133 $ hg files -R subrepo -r '.'
127 134 subrepo/b
128 135
129 136 $ hg bookmark -r tip @other
130 137 $ echo xyz > subrepo/c
131 138 $ hg ci -SAm 'add c'
132 139 adding subrepo/c
133 140 committing subrepository subrepo
134 141 created new head
135 142 $ rm subrepo/c
136 143
137 144 Merge sees deleted subrepo files as an uncommitted change
138 145
139 146 $ hg merge @other
140 147 abort: uncommitted changes in subrepository "subrepo"
141 148 [255]
General Comments 0
You need to be logged in to leave comments. Login now