Show More
@@ -1,223 +1,225 b'' | |||
|
1 | 1 | $ hg init a |
|
2 | 2 | $ cd a |
|
3 | 3 | $ echo a > a |
|
4 | 4 | $ hg add -n |
|
5 | 5 | adding a |
|
6 | 6 | $ hg st |
|
7 | 7 | ? a |
|
8 | 8 | $ hg add |
|
9 | 9 | adding a |
|
10 | 10 | $ hg st |
|
11 | 11 | A a |
|
12 | 12 | $ hg forget a |
|
13 | 13 | $ hg add |
|
14 | 14 | adding a |
|
15 | 15 | $ hg st |
|
16 | 16 | A a |
|
17 | 17 | |
|
18 | 18 | $ echo b > b |
|
19 | 19 | $ hg add -n b |
|
20 | 20 | $ hg st |
|
21 | 21 | A a |
|
22 | 22 | ? b |
|
23 | 23 | $ hg add b |
|
24 | 24 | $ hg st |
|
25 | 25 | A a |
|
26 | 26 | A b |
|
27 | 27 | |
|
28 | 28 | should fail |
|
29 | 29 | |
|
30 | 30 | $ hg add b |
|
31 | 31 | b already tracked! |
|
32 | 32 | $ hg st |
|
33 | 33 | A a |
|
34 | 34 | A b |
|
35 | 35 | |
|
36 | 36 | #if no-windows |
|
37 | 37 | $ echo foo > con.xml |
|
38 | 38 | $ hg --config ui.portablefilenames=jump add con.xml |
|
39 | 39 | abort: ui.portablefilenames value is invalid ('jump') |
|
40 | 40 | [255] |
|
41 | 41 | $ hg --config ui.portablefilenames=abort add con.xml |
|
42 | 42 | abort: filename contains 'con', which is reserved on Windows: 'con.xml' |
|
43 | 43 | [255] |
|
44 | 44 | $ hg st |
|
45 | 45 | A a |
|
46 | 46 | A b |
|
47 | 47 | ? con.xml |
|
48 | 48 | $ hg add con.xml |
|
49 | 49 | warning: filename contains 'con', which is reserved on Windows: 'con.xml' |
|
50 | 50 | $ hg st |
|
51 | 51 | A a |
|
52 | 52 | A b |
|
53 | 53 | A con.xml |
|
54 | 54 | $ hg forget con.xml |
|
55 | 55 | $ rm con.xml |
|
56 | 56 | #endif |
|
57 | 57 | |
|
58 | 58 | #if eol-in-paths |
|
59 | 59 | $ echo bla > 'hello:world' |
|
60 | 60 | $ hg --config ui.portablefilenames=abort add |
|
61 | 61 | adding hello:world |
|
62 | 62 | abort: filename contains ':', which is reserved on Windows: 'hello:world' |
|
63 | 63 | [255] |
|
64 | 64 | $ hg st |
|
65 | 65 | A a |
|
66 | 66 | A b |
|
67 | 67 | ? hello:world |
|
68 | 68 | $ hg --config ui.portablefilenames=ignore add |
|
69 | 69 | adding hello:world |
|
70 | 70 | $ hg st |
|
71 | 71 | A a |
|
72 | 72 | A b |
|
73 | 73 | A hello:world |
|
74 | 74 | #endif |
|
75 | 75 | |
|
76 | 76 | $ hg ci -m 0 --traceback |
|
77 | 77 | |
|
78 | 78 | should fail |
|
79 | 79 | |
|
80 | 80 | $ hg add a |
|
81 | 81 | a already tracked! |
|
82 | 82 | |
|
83 | 83 | $ echo aa > a |
|
84 | 84 | $ hg ci -m 1 |
|
85 | 85 | $ hg up 0 |
|
86 | 86 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 | 87 | $ echo aaa > a |
|
88 | 88 | $ hg ci -m 2 |
|
89 | 89 | created new head |
|
90 | 90 | |
|
91 | 91 | $ hg merge |
|
92 | 92 | merging a |
|
93 | 93 | warning: conflicts during merge. |
|
94 | 94 | merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
95 | 95 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
96 | 96 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
97 | 97 | [1] |
|
98 | 98 | $ hg st |
|
99 | 99 | M a |
|
100 | 100 | ? a.orig |
|
101 | 101 | |
|
102 | 102 | should fail |
|
103 | 103 | |
|
104 | 104 | $ hg add a |
|
105 | 105 | a already tracked! |
|
106 | 106 | $ hg st |
|
107 | 107 | M a |
|
108 | 108 | ? a.orig |
|
109 | 109 | $ hg resolve -m a |
|
110 | 110 | (no more unresolved files) |
|
111 | 111 | $ hg ci -m merge |
|
112 | 112 | |
|
113 | 113 | Issue683: peculiarity with hg revert of an removed then added file |
|
114 | 114 | |
|
115 | 115 | $ hg forget a |
|
116 | 116 | $ hg add a |
|
117 | 117 | $ hg st |
|
118 | 118 | ? a.orig |
|
119 | 119 | $ hg rm a |
|
120 | 120 | $ hg st |
|
121 | 121 | R a |
|
122 | 122 | ? a.orig |
|
123 | 123 | $ echo a > a |
|
124 | 124 | $ hg add a |
|
125 | 125 | $ hg st |
|
126 | 126 | M a |
|
127 | 127 | ? a.orig |
|
128 | 128 | |
|
129 | 129 | Forgotten file can be added back (as either clean or modified) |
|
130 | 130 | |
|
131 | 131 | $ hg forget b |
|
132 | 132 | $ hg add b |
|
133 | 133 | $ hg st -A b |
|
134 | 134 | C b |
|
135 | 135 | $ hg forget b |
|
136 | 136 | $ echo modified > b |
|
137 | 137 | $ hg add b |
|
138 | 138 | $ hg st -A b |
|
139 | 139 | M b |
|
140 | 140 | $ hg revert -qC b |
|
141 | 141 | |
|
142 | 142 | $ hg add c && echo "unexpected addition of missing file" |
|
143 | 143 | c: * (glob) |
|
144 | 144 | [1] |
|
145 | 145 | $ echo c > c |
|
146 | 146 | $ hg add d c && echo "unexpected addition of missing file" |
|
147 | 147 | d: * (glob) |
|
148 | 148 | [1] |
|
149 | 149 | $ hg st |
|
150 | 150 | M a |
|
151 | 151 | A c |
|
152 | 152 | ? a.orig |
|
153 | 153 | $ hg up -C |
|
154 | 154 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
155 | 155 | |
|
156 | 156 | forget and get should have the right order: added but missing dir should be |
|
157 | 157 | forgotten before file with same name is added |
|
158 | 158 | |
|
159 | 159 | $ echo file d > d |
|
160 | 160 | $ hg add d |
|
161 | 161 | $ hg ci -md |
|
162 | 162 | $ hg rm d |
|
163 | 163 | $ mkdir d |
|
164 | 164 | $ echo a > d/a |
|
165 | 165 | $ hg add d/a |
|
166 | 166 | $ rm -r d |
|
167 | 167 | $ hg up -C |
|
168 | 168 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
169 | 169 | $ cat d |
|
170 | 170 | file d |
|
171 | 171 | |
|
172 | 172 | Test that adding a directory doesn't require case matching (issue4578) |
|
173 | 173 | #if icasefs |
|
174 | 174 | $ mkdir -p CapsDir1/CapsDir |
|
175 | 175 | $ echo abc > CapsDir1/CapsDir/AbC.txt |
|
176 | 176 | $ mkdir CapsDir1/CapsDir/SubDir |
|
177 | 177 | $ echo def > CapsDir1/CapsDir/SubDir/Def.txt |
|
178 | 178 | |
|
179 | 179 | $ hg add capsdir1/capsdir |
|
180 | 180 | adding CapsDir1/CapsDir/AbC.txt (glob) |
|
181 | 181 | adding CapsDir1/CapsDir/SubDir/Def.txt (glob) |
|
182 | 182 | |
|
183 | 183 | $ hg forget capsdir1/capsdir/abc.txt |
|
184 | 184 | removing CapsDir1/CapsDir/AbC.txt (glob) |
|
185 | 185 | |
|
186 | 186 | $ hg forget capsdir1/capsdir |
|
187 | 187 | removing CapsDir1/CapsDir/SubDir/Def.txt (glob) |
|
188 | 188 | |
|
189 | 189 | $ hg add capsdir1 |
|
190 | 190 | adding CapsDir1/CapsDir/AbC.txt (glob) |
|
191 | 191 | adding CapsDir1/CapsDir/SubDir/Def.txt (glob) |
|
192 | 192 | |
|
193 | 193 | $ hg ci -m "AbCDef" capsdir1/capsdir |
|
194 | 194 | |
|
195 | 195 | $ hg status -A capsdir1/capsdir |
|
196 | 196 | C CapsDir1/CapsDir/AbC.txt |
|
197 | 197 | C CapsDir1/CapsDir/SubDir/Def.txt |
|
198 | 198 | |
|
199 | 199 | $ hg files capsdir1/capsdir |
|
200 | 200 | CapsDir1/CapsDir/AbC.txt (glob) |
|
201 | 201 | CapsDir1/CapsDir/SubDir/Def.txt (glob) |
|
202 | 202 | |
|
203 | 203 | $ echo xyz > CapsDir1/CapsDir/SubDir/Def.txt |
|
204 | 204 | $ hg ci -m xyz capsdir1/capsdir/subdir/def.txt |
|
205 | 205 | |
|
206 | 206 | $ hg revert -r '.^' capsdir1/capsdir |
|
207 | 207 | reverting CapsDir1/CapsDir/SubDir/Def.txt (glob) |
|
208 | 208 | |
|
209 | The conditional tests above mean the hash on the diff line differs on Windows | |
|
210 | and OS X | |
|
209 | 211 | $ hg diff capsdir1/capsdir |
|
210 |
diff -r |
|
|
212 | diff -r * CapsDir1/CapsDir/SubDir/Def.txt (glob) | |
|
211 | 213 | --- a/CapsDir1/CapsDir/SubDir/Def.txt Thu Jan 01 00:00:00 1970 +0000 |
|
212 | 214 | +++ b/CapsDir1/CapsDir/SubDir/Def.txt * +0000 (glob) |
|
213 | 215 | @@ -1,1 +1,1 @@ |
|
214 | 216 | -xyz |
|
215 | 217 | +def |
|
216 | 218 | |
|
217 | 219 | $ hg remove -f 'glob:**.txt' -X capsdir1/capsdir |
|
218 | 220 | $ hg remove -f 'glob:**.txt' -I capsdir1/capsdir |
|
219 | 221 | removing CapsDir1/CapsDir/AbC.txt (glob) |
|
220 | 222 | removing CapsDir1/CapsDir/SubDir/Def.txt (glob) |
|
221 | 223 | #endif |
|
222 | 224 | |
|
223 | 225 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now