Show More
@@ -1,432 +1,432 b'' | |||||
1 | $ cat <<EOF > merge |
|
1 | $ cat <<EOF > merge | |
2 | > from __future__ import print_function |
|
2 | > from __future__ import print_function | |
3 | > import sys, os |
|
3 | > import sys, os | |
4 | > |
|
4 | > | |
5 | > try: |
|
5 | > try: | |
6 | > import msvcrt |
|
6 | > import msvcrt | |
7 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
7 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
8 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
8 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) | |
9 | > except ImportError: |
|
9 | > except ImportError: | |
10 | > pass |
|
10 | > pass | |
11 | > |
|
11 | > | |
12 | > print("merging for", os.path.basename(sys.argv[1])) |
|
12 | > print("merging for", os.path.basename(sys.argv[1])) | |
13 | > EOF |
|
13 | > EOF | |
14 | $ HGMERGE="$PYTHON ../merge"; export HGMERGE |
|
14 | $ HGMERGE="$PYTHON ../merge"; export HGMERGE | |
15 |
|
15 | |||
16 | $ hg init t |
|
16 | $ hg init t | |
17 | $ cd t |
|
17 | $ cd t | |
18 | $ echo This is file a1 > a |
|
18 | $ echo This is file a1 > a | |
19 | $ hg add a |
|
19 | $ hg add a | |
20 | $ hg commit -m "commit #0" |
|
20 | $ hg commit -m "commit #0" | |
21 | $ echo This is file b1 > b |
|
21 | $ echo This is file b1 > b | |
22 | $ hg add b |
|
22 | $ hg add b | |
23 | $ hg commit -m "commit #1" |
|
23 | $ hg commit -m "commit #1" | |
24 |
|
24 | |||
25 | $ hg update 0 |
|
25 | $ hg update 0 | |
26 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
26 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
27 |
|
27 | |||
28 | Test interrupted updates by having a non-empty dir with the same name as one |
|
28 | Test interrupted updates by having a non-empty dir with the same name as one | |
29 | of the files in a commit we're updating to |
|
29 | of the files in a commit we're updating to | |
30 |
|
30 | |||
31 | $ mkdir b && touch b/nonempty |
|
31 | $ mkdir b && touch b/nonempty | |
32 | $ hg up |
|
32 | $ hg up | |
33 | abort: Unlinking directory not permitted: '$TESTTMP/t/b' (windows !) |
|
33 | abort: Unlinking directory not permitted: '?\$TESTTMP/t/b'? (re) (windows !) | |
34 | abort: Directory not empty: '$TESTTMP/t/b' (no-windows !) |
|
34 | abort: Directory not empty: '?\$TESTTMP/t/b'? (re) (no-windows !) | |
35 | [255] |
|
35 | [255] | |
36 | $ hg ci |
|
36 | $ hg ci | |
37 | abort: last update was interrupted |
|
37 | abort: last update was interrupted | |
38 | (use 'hg update' to get a consistent checkout) |
|
38 | (use 'hg update' to get a consistent checkout) | |
39 | [255] |
|
39 | [255] | |
40 | $ hg sum |
|
40 | $ hg sum | |
41 | parent: 0:538afb845929 |
|
41 | parent: 0:538afb845929 | |
42 | commit #0 |
|
42 | commit #0 | |
43 | branch: default |
|
43 | branch: default | |
44 | commit: 1 unknown (interrupted update) |
|
44 | commit: 1 unknown (interrupted update) | |
45 | update: 1 new changesets (update) |
|
45 | update: 1 new changesets (update) | |
46 | phases: 2 draft |
|
46 | phases: 2 draft | |
47 |
|
47 | |||
48 | $ rm b/nonempty |
|
48 | $ rm b/nonempty | |
49 |
|
49 | |||
50 | $ hg up |
|
50 | $ hg up | |
51 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
51 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
52 | $ hg sum |
|
52 | $ hg sum | |
53 | parent: 1:b8bb4a988f25 tip |
|
53 | parent: 1:b8bb4a988f25 tip | |
54 | commit #1 |
|
54 | commit #1 | |
55 | branch: default |
|
55 | branch: default | |
56 | commit: (clean) |
|
56 | commit: (clean) | |
57 | update: (current) |
|
57 | update: (current) | |
58 | phases: 2 draft |
|
58 | phases: 2 draft | |
59 |
|
59 | |||
60 | Prepare a basic merge |
|
60 | Prepare a basic merge | |
61 |
|
61 | |||
62 | $ hg up 0 |
|
62 | $ hg up 0 | |
63 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
63 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
64 | $ echo This is file c1 > c |
|
64 | $ echo This is file c1 > c | |
65 | $ hg add c |
|
65 | $ hg add c | |
66 | $ hg commit -m "commit #2" |
|
66 | $ hg commit -m "commit #2" | |
67 | created new head |
|
67 | created new head | |
68 | $ echo This is file b1 > b |
|
68 | $ echo This is file b1 > b | |
69 | no merges expected |
|
69 | no merges expected | |
70 | $ hg merge -P 1 |
|
70 | $ hg merge -P 1 | |
71 | changeset: 1:b8bb4a988f25 |
|
71 | changeset: 1:b8bb4a988f25 | |
72 | user: test |
|
72 | user: test | |
73 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
73 | date: Thu Jan 01 00:00:00 1970 +0000 | |
74 | summary: commit #1 |
|
74 | summary: commit #1 | |
75 |
|
75 | |||
76 | $ hg merge 1 |
|
76 | $ hg merge 1 | |
77 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
78 | (branch merge, don't forget to commit) |
|
78 | (branch merge, don't forget to commit) | |
79 | $ hg diff --nodates |
|
79 | $ hg diff --nodates | |
80 | diff -r 49035e18a8e6 b |
|
80 | diff -r 49035e18a8e6 b | |
81 | --- /dev/null |
|
81 | --- /dev/null | |
82 | +++ b/b |
|
82 | +++ b/b | |
83 | @@ -0,0 +1,1 @@ |
|
83 | @@ -0,0 +1,1 @@ | |
84 | +This is file b1 |
|
84 | +This is file b1 | |
85 | $ hg status |
|
85 | $ hg status | |
86 | M b |
|
86 | M b | |
87 | $ cd ..; rm -r t |
|
87 | $ cd ..; rm -r t | |
88 |
|
88 | |||
89 | $ hg init t |
|
89 | $ hg init t | |
90 | $ cd t |
|
90 | $ cd t | |
91 | $ echo This is file a1 > a |
|
91 | $ echo This is file a1 > a | |
92 | $ hg add a |
|
92 | $ hg add a | |
93 | $ hg commit -m "commit #0" |
|
93 | $ hg commit -m "commit #0" | |
94 | $ echo This is file b1 > b |
|
94 | $ echo This is file b1 > b | |
95 | $ hg add b |
|
95 | $ hg add b | |
96 | $ hg commit -m "commit #1" |
|
96 | $ hg commit -m "commit #1" | |
97 |
|
97 | |||
98 | $ hg update 0 |
|
98 | $ hg update 0 | |
99 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
99 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
100 | $ echo This is file c1 > c |
|
100 | $ echo This is file c1 > c | |
101 | $ hg add c |
|
101 | $ hg add c | |
102 | $ hg commit -m "commit #2" |
|
102 | $ hg commit -m "commit #2" | |
103 | created new head |
|
103 | created new head | |
104 | $ echo This is file b2 > b |
|
104 | $ echo This is file b2 > b | |
105 | merge should fail |
|
105 | merge should fail | |
106 | $ hg merge 1 |
|
106 | $ hg merge 1 | |
107 | b: untracked file differs |
|
107 | b: untracked file differs | |
108 | abort: untracked files in working directory differ from files in requested revision |
|
108 | abort: untracked files in working directory differ from files in requested revision | |
109 | [255] |
|
109 | [255] | |
110 |
|
110 | |||
111 | #if symlink |
|
111 | #if symlink | |
112 | symlinks to directories should be treated as regular files (issue5027) |
|
112 | symlinks to directories should be treated as regular files (issue5027) | |
113 | $ rm b |
|
113 | $ rm b | |
114 | $ ln -s 'This is file b2' b |
|
114 | $ ln -s 'This is file b2' b | |
115 | $ hg merge 1 |
|
115 | $ hg merge 1 | |
116 | b: untracked file differs |
|
116 | b: untracked file differs | |
117 | abort: untracked files in working directory differ from files in requested revision |
|
117 | abort: untracked files in working directory differ from files in requested revision | |
118 | [255] |
|
118 | [255] | |
119 | symlinks shouldn't be followed |
|
119 | symlinks shouldn't be followed | |
120 | $ rm b |
|
120 | $ rm b | |
121 | $ echo This is file b1 > .hg/b |
|
121 | $ echo This is file b1 > .hg/b | |
122 | $ ln -s .hg/b b |
|
122 | $ ln -s .hg/b b | |
123 | $ hg merge 1 |
|
123 | $ hg merge 1 | |
124 | b: untracked file differs |
|
124 | b: untracked file differs | |
125 | abort: untracked files in working directory differ from files in requested revision |
|
125 | abort: untracked files in working directory differ from files in requested revision | |
126 | [255] |
|
126 | [255] | |
127 |
|
127 | |||
128 | $ rm b |
|
128 | $ rm b | |
129 | $ echo This is file b2 > b |
|
129 | $ echo This is file b2 > b | |
130 | #endif |
|
130 | #endif | |
131 |
|
131 | |||
132 | bad config |
|
132 | bad config | |
133 | $ hg merge 1 --config merge.checkunknown=x |
|
133 | $ hg merge 1 --config merge.checkunknown=x | |
134 | abort: merge.checkunknown not valid ('x' is none of 'abort', 'ignore', 'warn') |
|
134 | abort: merge.checkunknown not valid ('x' is none of 'abort', 'ignore', 'warn') | |
135 | [255] |
|
135 | [255] | |
136 | this merge should fail |
|
136 | this merge should fail | |
137 | $ hg merge 1 --config merge.checkunknown=abort |
|
137 | $ hg merge 1 --config merge.checkunknown=abort | |
138 | b: untracked file differs |
|
138 | b: untracked file differs | |
139 | abort: untracked files in working directory differ from files in requested revision |
|
139 | abort: untracked files in working directory differ from files in requested revision | |
140 | [255] |
|
140 | [255] | |
141 |
|
141 | |||
142 | this merge should warn |
|
142 | this merge should warn | |
143 | $ hg merge 1 --config merge.checkunknown=warn |
|
143 | $ hg merge 1 --config merge.checkunknown=warn | |
144 | b: replacing untracked file |
|
144 | b: replacing untracked file | |
145 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
145 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
146 | (branch merge, don't forget to commit) |
|
146 | (branch merge, don't forget to commit) | |
147 | $ cat b.orig |
|
147 | $ cat b.orig | |
148 | This is file b2 |
|
148 | This is file b2 | |
149 | $ hg up --clean 2 |
|
149 | $ hg up --clean 2 | |
150 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
150 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
151 | $ mv b.orig b |
|
151 | $ mv b.orig b | |
152 |
|
152 | |||
153 | this merge should silently ignore |
|
153 | this merge should silently ignore | |
154 | $ cat b |
|
154 | $ cat b | |
155 | This is file b2 |
|
155 | This is file b2 | |
156 | $ hg merge 1 --config merge.checkunknown=ignore |
|
156 | $ hg merge 1 --config merge.checkunknown=ignore | |
157 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
157 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
158 | (branch merge, don't forget to commit) |
|
158 | (branch merge, don't forget to commit) | |
159 |
|
159 | |||
160 | merge.checkignored |
|
160 | merge.checkignored | |
161 | $ hg up --clean 1 |
|
161 | $ hg up --clean 1 | |
162 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
162 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
163 | $ cat >> .hgignore << EOF |
|
163 | $ cat >> .hgignore << EOF | |
164 | > remoteignored |
|
164 | > remoteignored | |
165 | > EOF |
|
165 | > EOF | |
166 | $ echo This is file localignored3 > localignored |
|
166 | $ echo This is file localignored3 > localignored | |
167 | $ echo This is file remoteignored3 > remoteignored |
|
167 | $ echo This is file remoteignored3 > remoteignored | |
168 | $ hg add .hgignore localignored remoteignored |
|
168 | $ hg add .hgignore localignored remoteignored | |
169 | $ hg commit -m "commit #3" |
|
169 | $ hg commit -m "commit #3" | |
170 |
|
170 | |||
171 | $ hg up 2 |
|
171 | $ hg up 2 | |
172 | 1 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
172 | 1 files updated, 0 files merged, 4 files removed, 0 files unresolved | |
173 | $ cat >> .hgignore << EOF |
|
173 | $ cat >> .hgignore << EOF | |
174 | > localignored |
|
174 | > localignored | |
175 | > EOF |
|
175 | > EOF | |
176 | $ hg add .hgignore |
|
176 | $ hg add .hgignore | |
177 | $ hg commit -m "commit #4" |
|
177 | $ hg commit -m "commit #4" | |
178 |
|
178 | |||
179 | remote .hgignore shouldn't be used for determining whether a file is ignored |
|
179 | remote .hgignore shouldn't be used for determining whether a file is ignored | |
180 | $ echo This is file remoteignored4 > remoteignored |
|
180 | $ echo This is file remoteignored4 > remoteignored | |
181 | $ hg merge 3 --config merge.checkignored=ignore --config merge.checkunknown=abort |
|
181 | $ hg merge 3 --config merge.checkignored=ignore --config merge.checkunknown=abort | |
182 | remoteignored: untracked file differs |
|
182 | remoteignored: untracked file differs | |
183 | abort: untracked files in working directory differ from files in requested revision |
|
183 | abort: untracked files in working directory differ from files in requested revision | |
184 | [255] |
|
184 | [255] | |
185 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore |
|
185 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore | |
186 | merging .hgignore |
|
186 | merging .hgignore | |
187 | merging for .hgignore |
|
187 | merging for .hgignore | |
188 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
188 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
189 | (branch merge, don't forget to commit) |
|
189 | (branch merge, don't forget to commit) | |
190 | $ cat remoteignored |
|
190 | $ cat remoteignored | |
191 | This is file remoteignored3 |
|
191 | This is file remoteignored3 | |
192 | $ cat remoteignored.orig |
|
192 | $ cat remoteignored.orig | |
193 | This is file remoteignored4 |
|
193 | This is file remoteignored4 | |
194 | $ rm remoteignored.orig |
|
194 | $ rm remoteignored.orig | |
195 |
|
195 | |||
196 | local .hgignore should be used for that |
|
196 | local .hgignore should be used for that | |
197 | $ hg up --clean 4 |
|
197 | $ hg up --clean 4 | |
198 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
198 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
199 | $ echo This is file localignored4 > localignored |
|
199 | $ echo This is file localignored4 > localignored | |
200 | also test other conflicting files to see we output the full set of warnings |
|
200 | also test other conflicting files to see we output the full set of warnings | |
201 | $ echo This is file b2 > b |
|
201 | $ echo This is file b2 > b | |
202 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=abort |
|
202 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=abort | |
203 | b: untracked file differs |
|
203 | b: untracked file differs | |
204 | localignored: untracked file differs |
|
204 | localignored: untracked file differs | |
205 | abort: untracked files in working directory differ from files in requested revision |
|
205 | abort: untracked files in working directory differ from files in requested revision | |
206 | [255] |
|
206 | [255] | |
207 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore |
|
207 | $ hg merge 3 --config merge.checkignored=abort --config merge.checkunknown=ignore | |
208 | localignored: untracked file differs |
|
208 | localignored: untracked file differs | |
209 | abort: untracked files in working directory differ from files in requested revision |
|
209 | abort: untracked files in working directory differ from files in requested revision | |
210 | [255] |
|
210 | [255] | |
211 | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=abort |
|
211 | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=abort | |
212 | b: untracked file differs |
|
212 | b: untracked file differs | |
213 | abort: untracked files in working directory differ from files in requested revision |
|
213 | abort: untracked files in working directory differ from files in requested revision | |
214 | [255] |
|
214 | [255] | |
215 | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=warn |
|
215 | $ hg merge 3 --config merge.checkignored=warn --config merge.checkunknown=warn | |
216 | b: replacing untracked file |
|
216 | b: replacing untracked file | |
217 | localignored: replacing untracked file |
|
217 | localignored: replacing untracked file | |
218 | merging .hgignore |
|
218 | merging .hgignore | |
219 | merging for .hgignore |
|
219 | merging for .hgignore | |
220 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
220 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
221 | (branch merge, don't forget to commit) |
|
221 | (branch merge, don't forget to commit) | |
222 | $ cat localignored |
|
222 | $ cat localignored | |
223 | This is file localignored3 |
|
223 | This is file localignored3 | |
224 | $ cat localignored.orig |
|
224 | $ cat localignored.orig | |
225 | This is file localignored4 |
|
225 | This is file localignored4 | |
226 | $ rm localignored.orig |
|
226 | $ rm localignored.orig | |
227 |
|
227 | |||
228 | $ cat b.orig |
|
228 | $ cat b.orig | |
229 | This is file b2 |
|
229 | This is file b2 | |
230 | $ hg up --clean 2 |
|
230 | $ hg up --clean 2 | |
231 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
231 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved | |
232 | $ mv b.orig b |
|
232 | $ mv b.orig b | |
233 |
|
233 | |||
234 | this merge of b should work |
|
234 | this merge of b should work | |
235 | $ cat b |
|
235 | $ cat b | |
236 | This is file b2 |
|
236 | This is file b2 | |
237 | $ hg merge -f 1 |
|
237 | $ hg merge -f 1 | |
238 | merging b |
|
238 | merging b | |
239 | merging for b |
|
239 | merging for b | |
240 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
240 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
241 | (branch merge, don't forget to commit) |
|
241 | (branch merge, don't forget to commit) | |
242 | $ hg diff --nodates |
|
242 | $ hg diff --nodates | |
243 | diff -r 49035e18a8e6 b |
|
243 | diff -r 49035e18a8e6 b | |
244 | --- /dev/null |
|
244 | --- /dev/null | |
245 | +++ b/b |
|
245 | +++ b/b | |
246 | @@ -0,0 +1,1 @@ |
|
246 | @@ -0,0 +1,1 @@ | |
247 | +This is file b2 |
|
247 | +This is file b2 | |
248 | $ hg status |
|
248 | $ hg status | |
249 | M b |
|
249 | M b | |
250 | $ cd ..; rm -r t |
|
250 | $ cd ..; rm -r t | |
251 |
|
251 | |||
252 | $ hg init t |
|
252 | $ hg init t | |
253 | $ cd t |
|
253 | $ cd t | |
254 | $ echo This is file a1 > a |
|
254 | $ echo This is file a1 > a | |
255 | $ hg add a |
|
255 | $ hg add a | |
256 | $ hg commit -m "commit #0" |
|
256 | $ hg commit -m "commit #0" | |
257 | $ echo This is file b1 > b |
|
257 | $ echo This is file b1 > b | |
258 | $ hg add b |
|
258 | $ hg add b | |
259 | $ hg commit -m "commit #1" |
|
259 | $ hg commit -m "commit #1" | |
260 | $ echo This is file b22 > b |
|
260 | $ echo This is file b22 > b | |
261 | $ hg commit -m "commit #2" |
|
261 | $ hg commit -m "commit #2" | |
262 | $ hg update 1 |
|
262 | $ hg update 1 | |
263 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
263 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
264 | $ echo This is file c1 > c |
|
264 | $ echo This is file c1 > c | |
265 | $ hg add c |
|
265 | $ hg add c | |
266 | $ hg commit -m "commit #3" |
|
266 | $ hg commit -m "commit #3" | |
267 | created new head |
|
267 | created new head | |
268 |
|
268 | |||
269 | Contents of b should be "this is file b1" |
|
269 | Contents of b should be "this is file b1" | |
270 | $ cat b |
|
270 | $ cat b | |
271 | This is file b1 |
|
271 | This is file b1 | |
272 |
|
272 | |||
273 | $ echo This is file b22 > b |
|
273 | $ echo This is file b22 > b | |
274 | merge fails |
|
274 | merge fails | |
275 | $ hg merge 2 |
|
275 | $ hg merge 2 | |
276 | abort: uncommitted changes |
|
276 | abort: uncommitted changes | |
277 | (use 'hg status' to list changes) |
|
277 | (use 'hg status' to list changes) | |
278 | [255] |
|
278 | [255] | |
279 | merge expected! |
|
279 | merge expected! | |
280 | $ hg merge -f 2 |
|
280 | $ hg merge -f 2 | |
281 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
281 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
282 | (branch merge, don't forget to commit) |
|
282 | (branch merge, don't forget to commit) | |
283 | $ hg diff --nodates |
|
283 | $ hg diff --nodates | |
284 | diff -r 85de557015a8 b |
|
284 | diff -r 85de557015a8 b | |
285 | --- a/b |
|
285 | --- a/b | |
286 | +++ b/b |
|
286 | +++ b/b | |
287 | @@ -1,1 +1,1 @@ |
|
287 | @@ -1,1 +1,1 @@ | |
288 | -This is file b1 |
|
288 | -This is file b1 | |
289 | +This is file b22 |
|
289 | +This is file b22 | |
290 | $ hg status |
|
290 | $ hg status | |
291 | M b |
|
291 | M b | |
292 | $ cd ..; rm -r t |
|
292 | $ cd ..; rm -r t | |
293 |
|
293 | |||
294 | $ hg init t |
|
294 | $ hg init t | |
295 | $ cd t |
|
295 | $ cd t | |
296 | $ echo This is file a1 > a |
|
296 | $ echo This is file a1 > a | |
297 | $ hg add a |
|
297 | $ hg add a | |
298 | $ hg commit -m "commit #0" |
|
298 | $ hg commit -m "commit #0" | |
299 | $ echo This is file b1 > b |
|
299 | $ echo This is file b1 > b | |
300 | $ hg add b |
|
300 | $ hg add b | |
301 | $ hg commit -m "commit #1" |
|
301 | $ hg commit -m "commit #1" | |
302 | $ echo This is file b22 > b |
|
302 | $ echo This is file b22 > b | |
303 | $ hg commit -m "commit #2" |
|
303 | $ hg commit -m "commit #2" | |
304 | $ hg update 1 |
|
304 | $ hg update 1 | |
305 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
305 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
306 | $ echo This is file c1 > c |
|
306 | $ echo This is file c1 > c | |
307 | $ hg add c |
|
307 | $ hg add c | |
308 | $ hg commit -m "commit #3" |
|
308 | $ hg commit -m "commit #3" | |
309 | created new head |
|
309 | created new head | |
310 | $ echo This is file b33 > b |
|
310 | $ echo This is file b33 > b | |
311 | merge of b should fail |
|
311 | merge of b should fail | |
312 | $ hg merge 2 |
|
312 | $ hg merge 2 | |
313 | abort: uncommitted changes |
|
313 | abort: uncommitted changes | |
314 | (use 'hg status' to list changes) |
|
314 | (use 'hg status' to list changes) | |
315 | [255] |
|
315 | [255] | |
316 | merge of b expected |
|
316 | merge of b expected | |
317 | $ hg merge -f 2 |
|
317 | $ hg merge -f 2 | |
318 | merging b |
|
318 | merging b | |
319 | merging for b |
|
319 | merging for b | |
320 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
320 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
321 | (branch merge, don't forget to commit) |
|
321 | (branch merge, don't forget to commit) | |
322 | $ hg diff --nodates |
|
322 | $ hg diff --nodates | |
323 | diff -r 85de557015a8 b |
|
323 | diff -r 85de557015a8 b | |
324 | --- a/b |
|
324 | --- a/b | |
325 | +++ b/b |
|
325 | +++ b/b | |
326 | @@ -1,1 +1,1 @@ |
|
326 | @@ -1,1 +1,1 @@ | |
327 | -This is file b1 |
|
327 | -This is file b1 | |
328 | +This is file b33 |
|
328 | +This is file b33 | |
329 | $ hg status |
|
329 | $ hg status | |
330 | M b |
|
330 | M b | |
331 |
|
331 | |||
332 | Test for issue2364 |
|
332 | Test for issue2364 | |
333 |
|
333 | |||
334 | $ hg up -qC . |
|
334 | $ hg up -qC . | |
335 | $ hg rm b |
|
335 | $ hg rm b | |
336 | $ hg ci -md |
|
336 | $ hg ci -md | |
337 | $ hg revert -r -2 b |
|
337 | $ hg revert -r -2 b | |
338 | $ hg up -q -- -2 |
|
338 | $ hg up -q -- -2 | |
339 |
|
339 | |||
340 | Test that updated files are treated as "modified", when |
|
340 | Test that updated files are treated as "modified", when | |
341 | 'merge.update()' is aborted before 'merge.recordupdates()' (= parents |
|
341 | 'merge.update()' is aborted before 'merge.recordupdates()' (= parents | |
342 | aren't changed), even if none of mode, size and timestamp of them |
|
342 | aren't changed), even if none of mode, size and timestamp of them | |
343 | isn't changed on the filesystem (see also issue4583). |
|
343 | isn't changed on the filesystem (see also issue4583). | |
344 |
|
344 | |||
345 | $ cat > $TESTTMP/abort.py <<EOF |
|
345 | $ cat > $TESTTMP/abort.py <<EOF | |
346 | > from __future__ import absolute_import |
|
346 | > from __future__ import absolute_import | |
347 | > # emulate aborting before "recordupdates()". in this case, files |
|
347 | > # emulate aborting before "recordupdates()". in this case, files | |
348 | > # are changed without updating dirstate |
|
348 | > # are changed without updating dirstate | |
349 | > from mercurial import ( |
|
349 | > from mercurial import ( | |
350 | > error, |
|
350 | > error, | |
351 | > extensions, |
|
351 | > extensions, | |
352 | > merge, |
|
352 | > merge, | |
353 | > ) |
|
353 | > ) | |
354 | > def applyupdates(orig, *args, **kwargs): |
|
354 | > def applyupdates(orig, *args, **kwargs): | |
355 | > orig(*args, **kwargs) |
|
355 | > orig(*args, **kwargs) | |
356 | > raise error.Abort('intentional aborting') |
|
356 | > raise error.Abort('intentional aborting') | |
357 | > def extsetup(ui): |
|
357 | > def extsetup(ui): | |
358 | > extensions.wrapfunction(merge, "applyupdates", applyupdates) |
|
358 | > extensions.wrapfunction(merge, "applyupdates", applyupdates) | |
359 | > EOF |
|
359 | > EOF | |
360 |
|
360 | |||
361 | $ cat >> .hg/hgrc <<EOF |
|
361 | $ cat >> .hg/hgrc <<EOF | |
362 | > [fakedirstatewritetime] |
|
362 | > [fakedirstatewritetime] | |
363 | > # emulate invoking dirstate.write() via repo.status() |
|
363 | > # emulate invoking dirstate.write() via repo.status() | |
364 | > # at 2000-01-01 00:00 |
|
364 | > # at 2000-01-01 00:00 | |
365 | > fakenow = 200001010000 |
|
365 | > fakenow = 200001010000 | |
366 | > EOF |
|
366 | > EOF | |
367 |
|
367 | |||
368 | (file gotten from other revision) |
|
368 | (file gotten from other revision) | |
369 |
|
369 | |||
370 | $ hg update -q -C 2 |
|
370 | $ hg update -q -C 2 | |
371 | $ echo 'THIS IS FILE B5' > b |
|
371 | $ echo 'THIS IS FILE B5' > b | |
372 | $ hg commit -m 'commit #5' |
|
372 | $ hg commit -m 'commit #5' | |
373 |
|
373 | |||
374 | $ hg update -q -C 3 |
|
374 | $ hg update -q -C 3 | |
375 | $ cat b |
|
375 | $ cat b | |
376 | This is file b1 |
|
376 | This is file b1 | |
377 | $ touch -t 200001010000 b |
|
377 | $ touch -t 200001010000 b | |
378 | $ hg debugrebuildstate |
|
378 | $ hg debugrebuildstate | |
379 |
|
379 | |||
380 | $ cat >> .hg/hgrc <<EOF |
|
380 | $ cat >> .hg/hgrc <<EOF | |
381 | > [extensions] |
|
381 | > [extensions] | |
382 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
382 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |
383 | > abort = $TESTTMP/abort.py |
|
383 | > abort = $TESTTMP/abort.py | |
384 | > EOF |
|
384 | > EOF | |
385 | $ hg merge 5 |
|
385 | $ hg merge 5 | |
386 | abort: intentional aborting |
|
386 | abort: intentional aborting | |
387 | [255] |
|
387 | [255] | |
388 | $ cat >> .hg/hgrc <<EOF |
|
388 | $ cat >> .hg/hgrc <<EOF | |
389 | > [extensions] |
|
389 | > [extensions] | |
390 | > fakedirstatewritetime = ! |
|
390 | > fakedirstatewritetime = ! | |
391 | > abort = ! |
|
391 | > abort = ! | |
392 | > EOF |
|
392 | > EOF | |
393 |
|
393 | |||
394 | $ cat b |
|
394 | $ cat b | |
395 | THIS IS FILE B5 |
|
395 | THIS IS FILE B5 | |
396 | $ touch -t 200001010000 b |
|
396 | $ touch -t 200001010000 b | |
397 | $ hg status -A b |
|
397 | $ hg status -A b | |
398 | M b |
|
398 | M b | |
399 |
|
399 | |||
400 | (file merged from other revision) |
|
400 | (file merged from other revision) | |
401 |
|
401 | |||
402 | $ hg update -q -C 3 |
|
402 | $ hg update -q -C 3 | |
403 | $ echo 'this is file b6' > b |
|
403 | $ echo 'this is file b6' > b | |
404 | $ hg commit -m 'commit #6' |
|
404 | $ hg commit -m 'commit #6' | |
405 | created new head |
|
405 | created new head | |
406 |
|
406 | |||
407 | $ cat b |
|
407 | $ cat b | |
408 | this is file b6 |
|
408 | this is file b6 | |
409 | $ touch -t 200001010000 b |
|
409 | $ touch -t 200001010000 b | |
410 | $ hg debugrebuildstate |
|
410 | $ hg debugrebuildstate | |
411 |
|
411 | |||
412 | $ cat >> .hg/hgrc <<EOF |
|
412 | $ cat >> .hg/hgrc <<EOF | |
413 | > [extensions] |
|
413 | > [extensions] | |
414 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
414 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py | |
415 | > abort = $TESTTMP/abort.py |
|
415 | > abort = $TESTTMP/abort.py | |
416 | > EOF |
|
416 | > EOF | |
417 | $ hg merge --tool internal:other 5 |
|
417 | $ hg merge --tool internal:other 5 | |
418 | abort: intentional aborting |
|
418 | abort: intentional aborting | |
419 | [255] |
|
419 | [255] | |
420 | $ cat >> .hg/hgrc <<EOF |
|
420 | $ cat >> .hg/hgrc <<EOF | |
421 | > [extensions] |
|
421 | > [extensions] | |
422 | > fakedirstatewritetime = ! |
|
422 | > fakedirstatewritetime = ! | |
423 | > abort = ! |
|
423 | > abort = ! | |
424 | > EOF |
|
424 | > EOF | |
425 |
|
425 | |||
426 | $ cat b |
|
426 | $ cat b | |
427 | THIS IS FILE B5 |
|
427 | THIS IS FILE B5 | |
428 | $ touch -t 200001010000 b |
|
428 | $ touch -t 200001010000 b | |
429 | $ hg status -A b |
|
429 | $ hg status -A b | |
430 | M b |
|
430 | M b | |
431 |
|
431 | |||
432 | $ cd .. |
|
432 | $ cd .. |
@@ -1,93 +1,93 b'' | |||||
1 | Test update logic when there are renames or weird same-name cases between dirs |
|
1 | Test update logic when there are renames or weird same-name cases between dirs | |
2 | and files |
|
2 | and files | |
3 |
|
3 | |||
4 | Update with local changes across a file rename |
|
4 | Update with local changes across a file rename | |
5 |
|
5 | |||
6 | $ hg init r1 && cd r1 |
|
6 | $ hg init r1 && cd r1 | |
7 |
|
7 | |||
8 | $ echo a > a |
|
8 | $ echo a > a | |
9 | $ hg add a |
|
9 | $ hg add a | |
10 | $ hg ci -m a |
|
10 | $ hg ci -m a | |
11 |
|
11 | |||
12 | $ hg mv a b |
|
12 | $ hg mv a b | |
13 | $ hg ci -m rename |
|
13 | $ hg ci -m rename | |
14 |
|
14 | |||
15 | $ echo b > b |
|
15 | $ echo b > b | |
16 | $ hg ci -m change |
|
16 | $ hg ci -m change | |
17 |
|
17 | |||
18 | $ hg up -q 0 |
|
18 | $ hg up -q 0 | |
19 |
|
19 | |||
20 | $ echo c > a |
|
20 | $ echo c > a | |
21 |
|
21 | |||
22 | $ hg up |
|
22 | $ hg up | |
23 | merging a and b to b |
|
23 | merging a and b to b | |
24 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
24 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
25 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
25 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
26 | use 'hg resolve' to retry unresolved file merges |
|
26 | use 'hg resolve' to retry unresolved file merges | |
27 | [1] |
|
27 | [1] | |
28 |
|
28 | |||
29 | Test update when local untracked directory exists with the same name as a |
|
29 | Test update when local untracked directory exists with the same name as a | |
30 | tracked file in a commit we are updating to |
|
30 | tracked file in a commit we are updating to | |
31 | $ hg init r2 && cd r2 |
|
31 | $ hg init r2 && cd r2 | |
32 | $ echo root > root && hg ci -Am root # rev 0 |
|
32 | $ echo root > root && hg ci -Am root # rev 0 | |
33 | adding root |
|
33 | adding root | |
34 | $ echo text > name && hg ci -Am "name is a file" # rev 1 |
|
34 | $ echo text > name && hg ci -Am "name is a file" # rev 1 | |
35 | adding name |
|
35 | adding name | |
36 | $ hg up 0 |
|
36 | $ hg up 0 | |
37 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
37 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
38 | $ mkdir name |
|
38 | $ mkdir name | |
39 | $ hg up 1 |
|
39 | $ hg up 1 | |
40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
41 |
|
41 | |||
42 | Test update when local untracked directory exists with some files in it and has |
|
42 | Test update when local untracked directory exists with some files in it and has | |
43 | the same name a tracked file in a commit we are updating to. In future this |
|
43 | the same name a tracked file in a commit we are updating to. In future this | |
44 | should be updated to give an friendlier error message, but now we should just |
|
44 | should be updated to give an friendlier error message, but now we should just | |
45 | make sure that this does not erase untracked data |
|
45 | make sure that this does not erase untracked data | |
46 | $ hg up 0 |
|
46 | $ hg up 0 | |
47 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
47 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
48 | $ mkdir name |
|
48 | $ mkdir name | |
49 | $ echo text > name/file |
|
49 | $ echo text > name/file | |
50 | $ hg st |
|
50 | $ hg st | |
51 | ? name/file |
|
51 | ? name/file | |
52 | $ hg up 1 |
|
52 | $ hg up 1 | |
53 | abort: Unlinking directory not permitted: '$TESTTMP/r1/r2/name' (windows !) |
|
53 | abort: Unlinking directory not permitted: '?$TESTTMP/r1/r2/name'? (re) (windows !) | |
54 | abort: Directory not empty: '$TESTTMP/r1/r2/name' (no-windows !) |
|
54 | abort: Directory not empty: '?\$TESTTMP/r1/r2/name'? (re) (no-windows !) | |
55 | [255] |
|
55 | [255] | |
56 | $ cat name/file |
|
56 | $ cat name/file | |
57 | text |
|
57 | text | |
58 | $ cd .. |
|
58 | $ cd .. | |
59 |
|
59 | |||
60 | #if symlink |
|
60 | #if symlink | |
61 |
|
61 | |||
62 | Test update when two commits have symlinks that point to different folders |
|
62 | Test update when two commits have symlinks that point to different folders | |
63 | $ hg init r3 && cd r3 |
|
63 | $ hg init r3 && cd r3 | |
64 | $ echo root > root && hg ci -Am root |
|
64 | $ echo root > root && hg ci -Am root | |
65 | adding root |
|
65 | adding root | |
66 | $ mkdir folder1 && mkdir folder2 |
|
66 | $ mkdir folder1 && mkdir folder2 | |
67 | $ ln -s folder1 folder |
|
67 | $ ln -s folder1 folder | |
68 | $ hg ci -Am "symlink to folder1" |
|
68 | $ hg ci -Am "symlink to folder1" | |
69 | adding folder |
|
69 | adding folder | |
70 | $ rm folder |
|
70 | $ rm folder | |
71 | $ ln -s folder2 folder |
|
71 | $ ln -s folder2 folder | |
72 | $ hg ci -Am "symlink to folder2" |
|
72 | $ hg ci -Am "symlink to folder2" | |
73 | $ hg up 1 |
|
73 | $ hg up 1 | |
74 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
74 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
75 | $ cd .. |
|
75 | $ cd .. | |
76 |
|
76 | |||
77 | #endif |
|
77 | #endif | |
78 |
|
78 | |||
79 | #if rmcwd |
|
79 | #if rmcwd | |
80 |
|
80 | |||
81 | Test that warning is printed if cwd is deleted during update |
|
81 | Test that warning is printed if cwd is deleted during update | |
82 | $ hg init r4 && cd r4 |
|
82 | $ hg init r4 && cd r4 | |
83 | $ mkdir dir |
|
83 | $ mkdir dir | |
84 | $ cd dir |
|
84 | $ cd dir | |
85 | $ echo a > a |
|
85 | $ echo a > a | |
86 | $ echo b > b |
|
86 | $ echo b > b | |
87 | $ hg add a b |
|
87 | $ hg add a b | |
88 | $ hg ci -m "file and dir" |
|
88 | $ hg ci -m "file and dir" | |
89 | $ hg up -q null |
|
89 | $ hg up -q null | |
90 | current directory was removed |
|
90 | current directory was removed | |
91 | (consider changing to repo root: $TESTTMP/r1/r4) |
|
91 | (consider changing to repo root: $TESTTMP/r1/r4) | |
92 |
|
92 | |||
93 | #endif |
|
93 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now