##// END OF EJS Templates
largefiles: test coverage of fatal interruption of update...
Mads Kiilerich -
r30189:4999c12c stable
parent child Browse files
Show More
@@ -1,744 +1,790 b''
1 This file focuses mainly on updating largefiles in the working
1 This file focuses mainly on updating largefiles in the working
2 directory (and ".hg/largefiles/dirstate")
2 directory (and ".hg/largefiles/dirstate")
3
3
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
5 > [ui]
5 > [ui]
6 > merge = internal:fail
6 > merge = internal:fail
7 > [extensions]
7 > [extensions]
8 > largefiles =
8 > largefiles =
9 > [extdiff]
9 > [extdiff]
10 > # for portability:
10 > # for portability:
11 > pdiff = sh "$RUNTESTDIR/pdiff"
11 > pdiff = sh "$RUNTESTDIR/pdiff"
12 > EOF
12 > EOF
13
13
14 $ hg init repo
14 $ hg init repo
15 $ cd repo
15 $ cd repo
16
16
17 $ echo large1 > large1
17 $ echo large1 > large1
18 $ echo large2 > large2
18 $ echo large2 > large2
19 $ hg add --large large1 large2
19 $ hg add --large large1 large2
20 $ echo normal1 > normal1
20 $ echo normal1 > normal1
21 $ hg add normal1
21 $ hg add normal1
22 $ hg commit -m '#0'
22 $ hg commit -m '#0'
23 $ echo 'large1 in #1' > large1
23 $ echo 'large1 in #1' > large1
24 $ echo 'normal1 in #1' > normal1
24 $ echo 'normal1 in #1' > normal1
25 $ hg commit -m '#1'
25 $ hg commit -m '#1'
26 $ hg pdiff -r '.^' --config extensions.extdiff=
26 $ hg pdiff -r '.^' --config extensions.extdiff=
27 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
27 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
28 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
28 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
29 +++ repo/.hglf/large1 * (glob)
29 +++ repo/.hglf/large1 * (glob)
30 @@ -1* +1* @@ (glob)
30 @@ -1* +1* @@ (glob)
31 -4669e532d5b2c093a78eca010077e708a071bb64
31 -4669e532d5b2c093a78eca010077e708a071bb64
32 +58e24f733a964da346e2407a2bee99d9001184f5
32 +58e24f733a964da346e2407a2bee99d9001184f5
33 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
33 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
34 --- repo.0d9d9b8dc9a3/normal1 * (glob)
34 --- repo.0d9d9b8dc9a3/normal1 * (glob)
35 +++ repo/normal1 * (glob)
35 +++ repo/normal1 * (glob)
36 @@ -1* +1* @@ (glob)
36 @@ -1* +1* @@ (glob)
37 -normal1
37 -normal1
38 +normal1 in #1
38 +normal1 in #1
39 [1]
39 [1]
40 $ hg update -q -C 0
40 $ hg update -q -C 0
41 $ echo 'large2 in #2' > large2
41 $ echo 'large2 in #2' > large2
42 $ hg commit -m '#2'
42 $ hg commit -m '#2'
43 created new head
43 created new head
44
44
45 Test that update also updates the lfdirstate of 'unsure' largefiles after
45 Test that update also updates the lfdirstate of 'unsure' largefiles after
46 hashing them:
46 hashing them:
47
47
48 The previous operations will usually have left us with largefiles with a mtime
48 The previous operations will usually have left us with largefiles with a mtime
49 within the same second as the dirstate was written.
49 within the same second as the dirstate was written.
50 The lfdirstate entries will thus have been written with an invalidated/unset
50 The lfdirstate entries will thus have been written with an invalidated/unset
51 mtime to make sure further changes within the same second is detected.
51 mtime to make sure further changes within the same second is detected.
52 We will however occasionally be "lucky" and get a tick between writing
52 We will however occasionally be "lucky" and get a tick between writing
53 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
53 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
54 following verification is thus disabled but can be verified manually.
54 following verification is thus disabled but can be verified manually.
55
55
56 #if false
56 #if false
57 $ hg debugdirstate --large --nodate
57 $ hg debugdirstate --large --nodate
58 n 644 7 unset large1
58 n 644 7 unset large1
59 n 644 13 unset large2
59 n 644 13 unset large2
60 #endif
60 #endif
61
61
62 Wait to make sure we get a tick so the mtime of the largefiles become valid.
62 Wait to make sure we get a tick so the mtime of the largefiles become valid.
63
63
64 $ sleep 1
64 $ sleep 1
65
65
66 A linear merge will update standins before performing the actual merge. It will
66 A linear merge will update standins before performing the actual merge. It will
67 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
67 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
68 update the corresponding standins.
68 update the corresponding standins.
69 Verify that it actually marks the clean files as clean in lfdirstate so
69 Verify that it actually marks the clean files as clean in lfdirstate so
70 we don't have to hash them again next time we update.
70 we don't have to hash them again next time we update.
71
71
72 $ hg up
72 $ hg up
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 1 other heads for branch "default"
74 1 other heads for branch "default"
75 $ hg debugdirstate --large --nodate
75 $ hg debugdirstate --large --nodate
76 n 644 7 set large1
76 n 644 7 set large1
77 n 644 13 set large2
77 n 644 13 set large2
78
78
79 Test that lfdirstate keeps track of last modification of largefiles and
79 Test that lfdirstate keeps track of last modification of largefiles and
80 prevents unnecessary hashing of content - also after linear/noop update
80 prevents unnecessary hashing of content - also after linear/noop update
81
81
82 $ sleep 1
82 $ sleep 1
83 $ hg st
83 $ hg st
84 $ hg debugdirstate --large --nodate
84 $ hg debugdirstate --large --nodate
85 n 644 7 set large1
85 n 644 7 set large1
86 n 644 13 set large2
86 n 644 13 set large2
87 $ hg up
87 $ hg up
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 1 other heads for branch "default"
89 1 other heads for branch "default"
90 $ hg debugdirstate --large --nodate
90 $ hg debugdirstate --large --nodate
91 n 644 7 set large1
91 n 644 7 set large1
92 n 644 13 set large2
92 n 644 13 set large2
93
93
94 Test that "hg merge" updates largefiles from "other" correctly
94 Test that "hg merge" updates largefiles from "other" correctly
95
95
96 (getting largefiles from "other" normally)
96 (getting largefiles from "other" normally)
97
97
98 $ hg status -A large1
98 $ hg status -A large1
99 C large1
99 C large1
100 $ cat large1
100 $ cat large1
101 large1
101 large1
102 $ cat .hglf/large1
102 $ cat .hglf/large1
103 4669e532d5b2c093a78eca010077e708a071bb64
103 4669e532d5b2c093a78eca010077e708a071bb64
104 $ hg merge --config debug.dirstate.delaywrite=2
104 $ hg merge --config debug.dirstate.delaywrite=2
105 getting changed largefiles
105 getting changed largefiles
106 1 largefiles updated, 0 removed
106 1 largefiles updated, 0 removed
107 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 (branch merge, don't forget to commit)
108 (branch merge, don't forget to commit)
109 $ hg status -A large1
109 $ hg status -A large1
110 M large1
110 M large1
111 $ cat large1
111 $ cat large1
112 large1 in #1
112 large1 in #1
113 $ cat .hglf/large1
113 $ cat .hglf/large1
114 58e24f733a964da346e2407a2bee99d9001184f5
114 58e24f733a964da346e2407a2bee99d9001184f5
115 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
115 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
116 -4669e532d5b2c093a78eca010077e708a071bb64
116 -4669e532d5b2c093a78eca010077e708a071bb64
117 +58e24f733a964da346e2407a2bee99d9001184f5
117 +58e24f733a964da346e2407a2bee99d9001184f5
118
118
119 (getting largefiles from "other" via conflict prompt)
119 (getting largefiles from "other" via conflict prompt)
120
120
121 $ hg update -q -C 2
121 $ hg update -q -C 2
122 $ echo 'large1 in #3' > large1
122 $ echo 'large1 in #3' > large1
123 $ echo 'normal1 in #3' > normal1
123 $ echo 'normal1 in #3' > normal1
124 $ hg commit -m '#3'
124 $ hg commit -m '#3'
125 $ cat .hglf/large1
125 $ cat .hglf/large1
126 e5bb990443d6a92aaf7223813720f7566c9dd05b
126 e5bb990443d6a92aaf7223813720f7566c9dd05b
127 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
127 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
128 > o
128 > o
129 > EOF
129 > EOF
130 largefile large1 has a merge conflict
130 largefile large1 has a merge conflict
131 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
131 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
132 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
132 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
133 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
133 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
134 merging normal1
134 merging normal1
135 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
135 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
136 getting changed largefiles
136 getting changed largefiles
137 1 largefiles updated, 0 removed
137 1 largefiles updated, 0 removed
138 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
138 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
139 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
139 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
140 [1]
140 [1]
141 $ hg status -A large1
141 $ hg status -A large1
142 M large1
142 M large1
143 $ cat large1
143 $ cat large1
144 large1 in #1
144 large1 in #1
145 $ cat .hglf/large1
145 $ cat .hglf/large1
146 58e24f733a964da346e2407a2bee99d9001184f5
146 58e24f733a964da346e2407a2bee99d9001184f5
147 $ rm normal1.orig
147
148
148 (merge non-existing largefiles from "other" via conflict prompt -
149 (merge non-existing largefiles from "other" via conflict prompt -
149 make sure the following commit doesn't abort in a confusing way when trying to
150 make sure the following commit doesn't abort in a confusing way when trying to
150 mark the non-existing file as normal in lfdirstate)
151 mark the non-existing file as normal in lfdirstate)
151
152
152 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
153 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
153 $ hg update -q -C 3
154 $ hg update -q -C 3
154 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
155 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
155 > o
156 > o
156 > EOF
157 > EOF
157 largefile large1 has a merge conflict
158 largefile large1 has a merge conflict
158 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
159 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
159 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
160 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
160 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
161 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
161 getting changed largefiles
162 getting changed largefiles
162 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
163 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
163 0 largefiles updated, 0 removed
164 0 largefiles updated, 0 removed
164 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
165 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
165 (branch merge, don't forget to commit)
166 (branch merge, don't forget to commit)
166 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
167 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
167 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
168 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
168 $ hg up -C . --config largefiles.usercache=not
169 $ hg up -C . --config largefiles.usercache=not
169 getting changed largefiles
170 getting changed largefiles
170 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
171 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
171 0 largefiles updated, 0 removed
172 0 largefiles updated, 0 removed
172 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 $ hg st large1
174 $ hg st large1
174 ! large1
175 ! large1
175 $ hg rollback -q
176 $ hg rollback -q
176 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
177 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
177
178
178 Test that "hg revert -r REV" updates largefiles from "REV" correctly
179 Test that "hg revert -r REV" updates largefiles from "REV" correctly
179
180
180 $ hg update -q -C 3
181 $ hg update -q -C 3
181 $ hg status -A large1
182 $ hg status -A large1
182 C large1
183 C large1
183 $ cat large1
184 $ cat large1
184 large1 in #3
185 large1 in #3
185 $ cat .hglf/large1
186 $ cat .hglf/large1
186 e5bb990443d6a92aaf7223813720f7566c9dd05b
187 e5bb990443d6a92aaf7223813720f7566c9dd05b
187 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
188 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
188 -4669e532d5b2c093a78eca010077e708a071bb64
189 -4669e532d5b2c093a78eca010077e708a071bb64
189 +58e24f733a964da346e2407a2bee99d9001184f5
190 +58e24f733a964da346e2407a2bee99d9001184f5
190 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
191 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
191 $ hg status -A large1
192 $ hg status -A large1
192 M large1
193 M large1
193 $ cat large1
194 $ cat large1
194 large1 in #1
195 large1 in #1
195 $ cat .hglf/large1
196 $ cat .hglf/large1
196 58e24f733a964da346e2407a2bee99d9001184f5
197 58e24f733a964da346e2407a2bee99d9001184f5
197
198
198 Test that "hg rollback" restores status of largefiles correctly
199 Test that "hg rollback" restores status of largefiles correctly
199
200
200 $ hg update -C -q
201 $ hg update -C -q
201 $ hg remove large1
202 $ hg remove large1
202 $ test -f .hglf/large1
203 $ test -f .hglf/large1
203 [1]
204 [1]
204 $ hg forget large2
205 $ hg forget large2
205 $ test -f .hglf/large2
206 $ test -f .hglf/large2
206 [1]
207 [1]
207 $ echo largeX > largeX
208 $ echo largeX > largeX
208 $ hg add --large largeX
209 $ hg add --large largeX
209 $ cat .hglf/largeX
210 $ cat .hglf/largeX
210
211
211 $ hg commit -m 'will be rollback-ed soon'
212 $ hg commit -m 'will be rollback-ed soon'
212 $ echo largeY > largeY
213 $ echo largeY > largeY
213 $ hg add --large largeY
214 $ hg add --large largeY
214 #if windows
215 #if windows
215 $ hg status -A large1
216 $ hg status -A large1
216 large1: * (glob)
217 large1: * (glob)
217 #else
218 #else
218 $ hg status -A large1
219 $ hg status -A large1
219 large1: No such file or directory
220 large1: No such file or directory
220 #endif
221 #endif
221 $ hg status -A large2
222 $ hg status -A large2
222 ? large2
223 ? large2
223 $ hg status -A largeX
224 $ hg status -A largeX
224 C largeX
225 C largeX
225 $ hg status -A largeY
226 $ hg status -A largeY
226 A largeY
227 A largeY
227 $ hg rollback
228 $ hg rollback
228 repository tip rolled back to revision 3 (undo commit)
229 repository tip rolled back to revision 3 (undo commit)
229 working directory now based on revision 3
230 working directory now based on revision 3
230 $ hg status -A large1
231 $ hg status -A large1
231 R large1
232 R large1
232 $ test -f .hglf/large1
233 $ test -f .hglf/large1
233 [1]
234 [1]
234 $ hg status -A large2
235 $ hg status -A large2
235 R large2
236 R large2
236 $ test -f .hglf/large2
237 $ test -f .hglf/large2
237 [1]
238 [1]
238 $ hg status -A largeX
239 $ hg status -A largeX
239 A largeX
240 A largeX
240 $ cat .hglf/largeX
241 $ cat .hglf/largeX
241
242
242 $ hg status -A largeY
243 $ hg status -A largeY
243 ? largeY
244 ? largeY
244 $ test -f .hglf/largeY
245 $ test -f .hglf/largeY
245 [1]
246 [1]
247 $ rm largeY
246
248
247 Test that "hg rollback" restores standins correctly
249 Test that "hg rollback" restores standins correctly
248
250
249 $ hg commit -m 'will be rollback-ed soon'
251 $ hg commit -m 'will be rollback-ed soon'
250 $ hg update -q -C 2
252 $ hg update -q -C 2
251 $ cat large1
253 $ cat large1
252 large1
254 large1
253 $ cat .hglf/large1
255 $ cat .hglf/large1
254 4669e532d5b2c093a78eca010077e708a071bb64
256 4669e532d5b2c093a78eca010077e708a071bb64
255 $ cat large2
257 $ cat large2
256 large2 in #2
258 large2 in #2
257 $ cat .hglf/large2
259 $ cat .hglf/large2
258 3cfce6277e7668985707b6887ce56f9f62f6ccd9
260 3cfce6277e7668985707b6887ce56f9f62f6ccd9
259
261
260 $ hg rollback -q -f
262 $ hg rollback -q -f
261 $ cat large1
263 $ cat large1
262 large1
264 large1
263 $ cat .hglf/large1
265 $ cat .hglf/large1
264 4669e532d5b2c093a78eca010077e708a071bb64
266 4669e532d5b2c093a78eca010077e708a071bb64
265 $ cat large2
267 $ cat large2
266 large2 in #2
268 large2 in #2
267 $ cat .hglf/large2
269 $ cat .hglf/large2
268 3cfce6277e7668985707b6887ce56f9f62f6ccd9
270 3cfce6277e7668985707b6887ce56f9f62f6ccd9
269
271
270 (rollback the parent of the working directory, when the parent of it
272 (rollback the parent of the working directory, when the parent of it
271 is not branch-tip)
273 is not branch-tip)
272
274
273 $ hg update -q -C 1
275 $ hg update -q -C 1
274 $ cat .hglf/large1
276 $ cat .hglf/large1
275 58e24f733a964da346e2407a2bee99d9001184f5
277 58e24f733a964da346e2407a2bee99d9001184f5
276 $ cat .hglf/large2
278 $ cat .hglf/large2
277 1deebade43c8c498a3c8daddac0244dc55d1331d
279 1deebade43c8c498a3c8daddac0244dc55d1331d
278
280
279 $ echo normalX > normalX
281 $ echo normalX > normalX
280 $ hg add normalX
282 $ hg add normalX
281 $ hg commit -m 'will be rollback-ed soon'
283 $ hg commit -m 'will be rollback-ed soon'
282 $ hg rollback -q
284 $ hg rollback -q
283
285
284 $ cat .hglf/large1
286 $ cat .hglf/large1
285 58e24f733a964da346e2407a2bee99d9001184f5
287 58e24f733a964da346e2407a2bee99d9001184f5
286 $ cat .hglf/large2
288 $ cat .hglf/large2
287 1deebade43c8c498a3c8daddac0244dc55d1331d
289 1deebade43c8c498a3c8daddac0244dc55d1331d
290 $ rm normalX
288
291
289 Test that "hg status" shows status of largefiles correctly just after
292 Test that "hg status" shows status of largefiles correctly just after
290 automated commit like rebase/transplant
293 automated commit like rebase/transplant
291
294
292 $ cat >> .hg/hgrc <<EOF
295 $ cat >> .hg/hgrc <<EOF
293 > [extensions]
296 > [extensions]
294 > rebase =
297 > rebase =
295 > strip =
298 > strip =
296 > transplant =
299 > transplant =
297 > EOF
300 > EOF
298 $ hg update -q -C 1
301 $ hg update -q -C 1
299 $ hg remove large1
302 $ hg remove large1
300 $ echo largeX > largeX
303 $ echo largeX > largeX
301 $ hg add --large largeX
304 $ hg add --large largeX
302 $ hg commit -m '#4'
305 $ hg commit -m '#4'
303
306
304 $ hg rebase -s 1 -d 2 --keep
307 $ hg rebase -s 1 -d 2 --keep
305 rebasing 1:72518492caa6 "#1"
308 rebasing 1:72518492caa6 "#1"
306 rebasing 4:07d6153b5c04 "#4" (tip)
309 rebasing 4:07d6153b5c04 "#4" (tip)
307 #if windows
310 #if windows
308 $ hg status -A large1
311 $ hg status -A large1
309 large1: * (glob)
312 large1: * (glob)
310 #else
313 #else
311 $ hg status -A large1
314 $ hg status -A large1
312 large1: No such file or directory
315 large1: No such file or directory
313 #endif
316 #endif
314 $ hg status -A largeX
317 $ hg status -A largeX
315 C largeX
318 C largeX
316 $ hg strip -q 5
319 $ hg strip -q 5
317
320
318 $ hg update -q -C 2
321 $ hg update -q -C 2
319 $ hg transplant -q 1 4
322 $ hg transplant -q 1 4
320 #if windows
323 #if windows
321 $ hg status -A large1
324 $ hg status -A large1
322 large1: * (glob)
325 large1: * (glob)
323 #else
326 #else
324 $ hg status -A large1
327 $ hg status -A large1
325 large1: No such file or directory
328 large1: No such file or directory
326 #endif
329 #endif
327 $ hg status -A largeX
330 $ hg status -A largeX
328 C largeX
331 C largeX
329 $ hg strip -q 5
332 $ hg strip -q 5
330
333
331 $ hg update -q -C 2
334 $ hg update -q -C 2
332 $ hg transplant -q --merge 1 --merge 4
335 $ hg transplant -q --merge 1 --merge 4
333 #if windows
336 #if windows
334 $ hg status -A large1
337 $ hg status -A large1
335 large1: * (glob)
338 large1: * (glob)
336 #else
339 #else
337 $ hg status -A large1
340 $ hg status -A large1
338 large1: No such file or directory
341 large1: No such file or directory
339 #endif
342 #endif
340 $ hg status -A largeX
343 $ hg status -A largeX
341 C largeX
344 C largeX
342 $ hg strip -q 5
345 $ hg strip -q 5
343
346
344 Test that linear merge can detect modification (and conflict) correctly
347 Test that linear merge can detect modification (and conflict) correctly
345
348
346 (linear merge without conflict)
349 (linear merge without conflict)
347
350
348 $ echo 'large2 for linear merge (no conflict)' > large2
351 $ echo 'large2 for linear merge (no conflict)' > large2
349 $ hg update 3 --config debug.dirstate.delaywrite=2
352 $ hg update 3 --config debug.dirstate.delaywrite=2
350 getting changed largefiles
353 getting changed largefiles
351 1 largefiles updated, 0 removed
354 1 largefiles updated, 0 removed
352 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
353 $ hg status -A large2
356 $ hg status -A large2
354 M large2
357 M large2
355 $ cat large2
358 $ cat large2
356 large2 for linear merge (no conflict)
359 large2 for linear merge (no conflict)
357 $ cat .hglf/large2
360 $ cat .hglf/large2
358 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
361 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
359
362
360 (linear merge with conflict, choosing "other")
363 (linear merge with conflict, choosing "other")
361
364
362 $ hg update -q -C 2
365 $ hg update -q -C 2
363 $ echo 'large1 for linear merge (conflict)' > large1
366 $ echo 'large1 for linear merge (conflict)' > large1
364 $ hg update 3 --config ui.interactive=True <<EOF
367 $ hg update 3 --config ui.interactive=True <<EOF
365 > o
368 > o
366 > EOF
369 > EOF
367 largefile large1 has a merge conflict
370 largefile large1 has a merge conflict
368 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
371 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
369 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
372 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
370 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
373 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
371 getting changed largefiles
374 getting changed largefiles
372 1 largefiles updated, 0 removed
375 1 largefiles updated, 0 removed
373 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
376 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
374 $ hg status -A large1
377 $ hg status -A large1
375 C large1
378 C large1
376 $ cat large1
379 $ cat large1
377 large1 in #3
380 large1 in #3
378 $ cat .hglf/large1
381 $ cat .hglf/large1
379 e5bb990443d6a92aaf7223813720f7566c9dd05b
382 e5bb990443d6a92aaf7223813720f7566c9dd05b
380
383
381 (linear merge with conflict, choosing "local")
384 (linear merge with conflict, choosing "local")
382
385
383 $ hg update -q -C 2
386 $ hg update -q -C 2
384 $ echo 'large1 for linear merge (conflict)' > large1
387 $ echo 'large1 for linear merge (conflict)' > large1
385 $ hg update 3 --config debug.dirstate.delaywrite=2
388 $ hg update 3 --config debug.dirstate.delaywrite=2
386 largefile large1 has a merge conflict
389 largefile large1 has a merge conflict
387 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
390 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
388 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
391 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
389 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
392 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
390 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
393 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
391 $ hg status -A large1
394 $ hg status -A large1
392 M large1
395 M large1
393 $ cat large1
396 $ cat large1
394 large1 for linear merge (conflict)
397 large1 for linear merge (conflict)
395 $ cat .hglf/large1
398 $ cat .hglf/large1
396 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
399 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
397
400
398 Test a linear merge to a revision containing same-name normal file
401 Test a linear merge to a revision containing same-name normal file
399
402
400 $ hg update -q -C 3
403 $ hg update -q -C 3
401 $ hg remove large2
404 $ hg remove large2
402 $ echo 'large2 as normal file' > large2
405 $ echo 'large2 as normal file' > large2
403 $ hg add large2
406 $ hg add large2
404 $ echo 'large3 as normal file' > large3
407 $ echo 'large3 as normal file' > large3
405 $ hg add large3
408 $ hg add large3
406 $ hg commit -m '#5'
409 $ hg commit -m '#5'
407 $ hg manifest
410 $ hg manifest
408 .hglf/large1
411 .hglf/large1
409 large2
412 large2
410 large3
413 large3
411 normal1
414 normal1
412
415
413 (modified largefile is already switched to normal)
416 (modified largefile is already switched to normal)
414
417
415 $ hg update -q -C 2
418 $ hg update -q -C 2
416 $ echo 'modified large2 for linear merge' > large2
419 $ echo 'modified large2 for linear merge' > large2
417 $ hg update -q 5
420 $ hg update -q 5
418 remote turned local largefile large2 into a normal file
421 remote turned local largefile large2 into a normal file
419 keep (l)argefile or use (n)ormal file? l
422 keep (l)argefile or use (n)ormal file? l
420 $ hg debugdirstate --nodates | grep large2
423 $ hg debugdirstate --nodates | grep large2
421 a 0 -1 unset .hglf/large2
424 a 0 -1 unset .hglf/large2
422 r 0 0 set large2
425 r 0 0 set large2
423 $ hg status -A large2
426 $ hg status -A large2
424 A large2
427 A large2
425 $ cat large2
428 $ cat large2
426 modified large2 for linear merge
429 modified large2 for linear merge
427
430
428 (added largefile is already committed as normal)
431 (added largefile is already committed as normal)
429
432
430 $ hg update -q -C 2
433 $ hg update -q -C 2
431 $ echo 'large3 as large file for linear merge' > large3
434 $ echo 'large3 as large file for linear merge' > large3
432 $ hg add --large large3
435 $ hg add --large large3
433 $ hg update -q 5
436 $ hg update -q 5
434 remote turned local largefile large3 into a normal file
437 remote turned local largefile large3 into a normal file
435 keep (l)argefile or use (n)ormal file? l
438 keep (l)argefile or use (n)ormal file? l
436 $ hg debugdirstate --nodates | grep large3
439 $ hg debugdirstate --nodates | grep large3
437 a 0 -1 unset .hglf/large3
440 a 0 -1 unset .hglf/large3
438 r 0 0 set large3
441 r 0 0 set large3
439 $ hg status -A large3
442 $ hg status -A large3
440 A large3
443 A large3
441 $ cat large3
444 $ cat large3
442 large3 as large file for linear merge
445 large3 as large file for linear merge
443 $ rm -f large3 .hglf/large3
446 $ rm -f large3 .hglf/large3
444
447
445 Test that the internal linear merging works correctly
448 Test that the internal linear merging works correctly
446 (both heads are stripped to keep pairing of revision number and commit log)
449 (both heads are stripped to keep pairing of revision number and commit log)
447
450
448 $ hg update -q -C 2
451 $ hg update -q -C 2
449 $ hg strip 3 4
452 $ hg strip 3 4
450 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob)
453 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob)
451 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
454 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
452
455
453 (internal linear merging at "hg pull --update")
456 (internal linear merging at "hg pull --update")
454
457
455 $ echo 'large1 for linear merge (conflict)' > large1
458 $ echo 'large1 for linear merge (conflict)' > large1
456 $ echo 'large2 for linear merge (conflict with normal file)' > large2
459 $ echo 'large2 for linear merge (conflict with normal file)' > large2
457 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
460 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
458 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob)
461 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob)
459 searching for changes
462 searching for changes
460 adding changesets
463 adding changesets
461 adding manifests
464 adding manifests
462 adding file changes
465 adding file changes
463 added 3 changesets with 5 changes to 5 files
466 added 3 changesets with 5 changes to 5 files
464 remote turned local largefile large2 into a normal file
467 remote turned local largefile large2 into a normal file
465 keep (l)argefile or use (n)ormal file? l
468 keep (l)argefile or use (n)ormal file? l
466 largefile large1 has a merge conflict
469 largefile large1 has a merge conflict
467 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
470 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
468 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
471 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
469 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
472 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
470 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
473 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
471 1 other heads for branch "default"
474 1 other heads for branch "default"
472
475
473 $ hg status -A large1
476 $ hg status -A large1
474 M large1
477 M large1
475 $ cat large1
478 $ cat large1
476 large1 for linear merge (conflict)
479 large1 for linear merge (conflict)
477 $ cat .hglf/large1
480 $ cat .hglf/large1
478 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
481 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
479 $ hg status -A large2
482 $ hg status -A large2
480 A large2
483 A large2
481 $ cat large2
484 $ cat large2
482 large2 for linear merge (conflict with normal file)
485 large2 for linear merge (conflict with normal file)
483 $ cat .hglf/large2
486 $ cat .hglf/large2
484 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
487 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
485
488
486 (internal linear merging at "hg unbundle --update")
489 (internal linear merging at "hg unbundle --update")
487
490
488 $ hg update -q -C 2
491 $ hg update -q -C 2
489 $ hg rollback -q
492 $ hg rollback -q
490
493
491 $ echo 'large1 for linear merge (conflict)' > large1
494 $ echo 'large1 for linear merge (conflict)' > large1
492 $ echo 'large2 for linear merge (conflict with normal file)' > large2
495 $ echo 'large2 for linear merge (conflict with normal file)' > large2
493 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
496 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
494 adding changesets
497 adding changesets
495 adding manifests
498 adding manifests
496 adding file changes
499 adding file changes
497 added 3 changesets with 5 changes to 5 files
500 added 3 changesets with 5 changes to 5 files
498 remote turned local largefile large2 into a normal file
501 remote turned local largefile large2 into a normal file
499 keep (l)argefile or use (n)ormal file? l
502 keep (l)argefile or use (n)ormal file? l
500 largefile large1 has a merge conflict
503 largefile large1 has a merge conflict
501 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
504 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
502 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
505 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
503 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
506 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
504 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
507 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
505 1 other heads for branch "default"
508 1 other heads for branch "default"
506
509
507 $ hg status -A large1
510 $ hg status -A large1
508 M large1
511 M large1
509 $ cat large1
512 $ cat large1
510 large1 for linear merge (conflict)
513 large1 for linear merge (conflict)
511 $ cat .hglf/large1
514 $ cat .hglf/large1
512 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
515 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
513 $ hg status -A large2
516 $ hg status -A large2
514 A large2
517 A large2
515 $ cat large2
518 $ cat large2
516 large2 for linear merge (conflict with normal file)
519 large2 for linear merge (conflict with normal file)
517 $ cat .hglf/large2
520 $ cat .hglf/large2
518 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
521 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
519
522
520 (internal linear merging in subrepo at "hg update")
523 (internal linear merging in subrepo at "hg update")
521
524
522 $ cd ..
525 $ cd ..
523 $ hg init subparent
526 $ hg init subparent
524 $ cd subparent
527 $ cd subparent
525
528
526 $ hg clone -q -u 2 ../repo sub
529 $ hg clone -q -u 2 ../repo sub
527 $ cat > .hgsub <<EOF
530 $ cat > .hgsub <<EOF
528 > sub = sub
531 > sub = sub
529 > EOF
532 > EOF
530 $ hg add .hgsub
533 $ hg add .hgsub
531 $ hg commit -m '#0@parent'
534 $ hg commit -m '#0@parent'
532 $ cat .hgsubstate
535 $ cat .hgsubstate
533 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
536 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
534 $ hg -R sub update -q
537 $ hg -R sub update -q
535 $ hg commit -m '#1@parent'
538 $ hg commit -m '#1@parent'
536 $ cat .hgsubstate
539 $ cat .hgsubstate
537 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
540 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
538 $ hg update -q 0
541 $ hg update -q 0
539
542
540 $ echo 'large1 for linear merge (conflict)' > sub/large1
543 $ echo 'large1 for linear merge (conflict)' > sub/large1
541 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
544 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
542 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
545 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
543 > m
546 > m
544 > r
547 > r
545 > l
548 > l
546 > l
549 > l
547 > EOF
550 > EOF
548 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
551 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
549 (M)erge, keep (l)ocal or keep (r)emote? m
552 (M)erge, keep (l)ocal or keep (r)emote? m
550 subrepository sources for sub differ (in checked out version)
553 subrepository sources for sub differ (in checked out version)
551 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
554 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
552 remote turned local largefile large2 into a normal file
555 remote turned local largefile large2 into a normal file
553 keep (l)argefile or use (n)ormal file? l
556 keep (l)argefile or use (n)ormal file? l
554 largefile large1 has a merge conflict
557 largefile large1 has a merge conflict
555 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
558 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
556 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
559 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
557 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
560 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
558 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
561 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
559 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
562 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
560
563
561 $ hg -R sub status -A sub/large1
564 $ hg -R sub status -A sub/large1
562 M sub/large1
565 M sub/large1
563 $ cat sub/large1
566 $ cat sub/large1
564 large1 for linear merge (conflict)
567 large1 for linear merge (conflict)
565 $ cat sub/.hglf/large1
568 $ cat sub/.hglf/large1
566 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
569 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
567 $ hg -R sub status -A sub/large2
570 $ hg -R sub status -A sub/large2
568 A sub/large2
571 A sub/large2
569 $ cat sub/large2
572 $ cat sub/large2
570 large2 for linear merge (conflict with normal file)
573 large2 for linear merge (conflict with normal file)
571 $ cat sub/.hglf/large2
574 $ cat sub/.hglf/large2
572 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
575 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
573
576
574 $ cd ..
577 $ cd ..
575 $ cd repo
578 $ cd repo
576
579
577 Test that rebase updates largefiles in the working directory even if
580 Test that rebase updates largefiles in the working directory even if
578 it is aborted by conflict.
581 it is aborted by conflict.
579
582
580 $ hg update -q -C 3
583 $ hg update -q -C 3
581 $ cat .hglf/large1
584 $ cat .hglf/large1
582 e5bb990443d6a92aaf7223813720f7566c9dd05b
585 e5bb990443d6a92aaf7223813720f7566c9dd05b
583 $ cat large1
586 $ cat large1
584 large1 in #3
587 large1 in #3
585 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
588 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
586 > o
589 > o
587 > EOF
590 > EOF
588 rebasing 1:72518492caa6 "#1"
591 rebasing 1:72518492caa6 "#1"
589 largefile large1 has a merge conflict
592 largefile large1 has a merge conflict
590 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
593 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
591 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
594 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
592 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
595 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
593 merging normal1
596 merging normal1
594 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
597 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
595 unresolved conflicts (see hg resolve, then hg rebase --continue)
598 unresolved conflicts (see hg resolve, then hg rebase --continue)
596 [1]
599 [1]
597 $ cat .hglf/large1
600 $ cat .hglf/large1
598 58e24f733a964da346e2407a2bee99d9001184f5
601 58e24f733a964da346e2407a2bee99d9001184f5
599 $ cat large1
602 $ cat large1
600 large1 in #1
603 large1 in #1
604 $ rm normal1.orig
601
605
602 Test that rebase updates standins for manually modified largefiles at
606 Test that rebase updates standins for manually modified largefiles at
603 the 1st commit of resuming.
607 the 1st commit of resuming.
604
608
605 $ echo "manually modified before 'hg rebase --continue'" > large1
609 $ echo "manually modified before 'hg rebase --continue'" > large1
606 $ hg resolve -m normal1
610 $ hg resolve -m normal1
607 (no more unresolved files)
611 (no more unresolved files)
608 continue: hg rebase --continue
612 continue: hg rebase --continue
609 $ hg rebase --continue --config ui.interactive=True <<EOF
613 $ hg rebase --continue --config ui.interactive=True <<EOF
610 > c
614 > c
611 > EOF
615 > EOF
612 rebasing 1:72518492caa6 "#1"
616 rebasing 1:72518492caa6 "#1"
613 rebasing 4:07d6153b5c04 "#4"
617 rebasing 4:07d6153b5c04 "#4"
614 local changed .hglf/large1 which remote deleted
618 local changed .hglf/large1 which remote deleted
615 use (c)hanged version, (d)elete, or leave (u)nresolved? c
619 use (c)hanged version, (d)elete, or leave (u)nresolved? c
616
620
617 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
621 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
618 -e5bb990443d6a92aaf7223813720f7566c9dd05b
622 -e5bb990443d6a92aaf7223813720f7566c9dd05b
619 +8a4f783556e7dea21139ca0466eafce954c75c13
623 +8a4f783556e7dea21139ca0466eafce954c75c13
620 $ rm -f large1
624 $ rm -f large1
621 $ hg update -q -C tip
625 $ hg update -q -C tip
622 $ cat large1
626 $ cat large1
623 manually modified before 'hg rebase --continue'
627 manually modified before 'hg rebase --continue'
624
628
625 Test that transplant updates largefiles, of which standins are safely
629 Test that transplant updates largefiles, of which standins are safely
626 changed, even if it is aborted by conflict of other.
630 changed, even if it is aborted by conflict of other.
627
631
628 $ hg update -q -C 5
632 $ hg update -q -C 5
629 $ cat .hglf/large1
633 $ cat .hglf/large1
630 e5bb990443d6a92aaf7223813720f7566c9dd05b
634 e5bb990443d6a92aaf7223813720f7566c9dd05b
631 $ cat large1
635 $ cat large1
632 large1 in #3
636 large1 in #3
633 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
637 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
634 +fa44618ea25181aff4f48b70428294790cec9f61
638 +fa44618ea25181aff4f48b70428294790cec9f61
635 $ hg transplant 4
639 $ hg transplant 4
636 applying 07d6153b5c04
640 applying 07d6153b5c04
637 patching file .hglf/large1
641 patching file .hglf/large1
638 Hunk #1 FAILED at 0
642 Hunk #1 FAILED at 0
639 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
643 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
640 patch failed to apply
644 patch failed to apply
641 abort: fix up the working directory and run hg transplant --continue
645 abort: fix up the working directory and run hg transplant --continue
642 [255]
646 [255]
643 $ hg status -A large1
647 $ hg status -A large1
644 C large1
648 C large1
645 $ cat .hglf/large1
649 $ cat .hglf/large1
646 e5bb990443d6a92aaf7223813720f7566c9dd05b
650 e5bb990443d6a92aaf7223813720f7566c9dd05b
647 $ cat large1
651 $ cat large1
648 large1 in #3
652 large1 in #3
649 $ hg status -A largeX
653 $ hg status -A largeX
650 A largeX
654 A largeX
651 $ cat .hglf/largeX
655 $ cat .hglf/largeX
652 fa44618ea25181aff4f48b70428294790cec9f61
656 fa44618ea25181aff4f48b70428294790cec9f61
653 $ cat largeX
657 $ cat largeX
654 largeX
658 largeX
655
659
656 Test that transplant updates standins for manually modified largefiles
660 Test that transplant updates standins for manually modified largefiles
657 at the 1st commit of resuming.
661 at the 1st commit of resuming.
658
662
659 $ echo "manually modified before 'hg transplant --continue'" > large1
663 $ echo "manually modified before 'hg transplant --continue'" > large1
660 $ hg transplant --continue
664 $ hg transplant --continue
661 07d6153b5c04 transplanted as f1bf30eb88cc
665 07d6153b5c04 transplanted as f1bf30eb88cc
662 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
666 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
663 -e5bb990443d6a92aaf7223813720f7566c9dd05b
667 -e5bb990443d6a92aaf7223813720f7566c9dd05b
664 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
668 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
665 $ rm -f large1
669 $ rm -f large1
666 $ hg update -q -C tip
670 $ hg update -q -C tip
667 $ cat large1
671 $ cat large1
668 manually modified before 'hg transplant --continue'
672 manually modified before 'hg transplant --continue'
669
673
670 Test that "hg status" doesn't show removal of largefiles not managed
674 Test that "hg status" doesn't show removal of largefiles not managed
671 in the target context.
675 in the target context.
672
676
673 $ hg update -q -C 4
677 $ hg update -q -C 4
674 $ hg remove largeX
678 $ hg remove largeX
675 $ hg status -A largeX
679 $ hg status -A largeX
676 R largeX
680 R largeX
677 $ hg status -A --rev '.^1' largeX
681 $ hg status -A --rev '.^1' largeX
678
682
679 #if execbit
683 #if execbit
680
684
681 Test that "hg status" against revisions other than parent notices exec
685 Test that "hg status" against revisions other than parent notices exec
682 bit changes of largefiles.
686 bit changes of largefiles.
683
687
684 $ hg update -q -C 4
688 $ hg update -q -C 4
685
689
686 (the case that large2 doesn't have exec bit in the target context but
690 (the case that large2 doesn't have exec bit in the target context but
687 in the working context)
691 in the working context)
688
692
689 $ chmod +x large2
693 $ chmod +x large2
690 $ hg status -A --rev 0 large2
694 $ hg status -A --rev 0 large2
691 M large2
695 M large2
692 $ hg commit -m 'chmod +x large2'
696 $ hg commit -m 'chmod +x large2'
693
697
694 (the case that large2 has exec bit in the target context but not in
698 (the case that large2 has exec bit in the target context but not in
695 the working context)
699 the working context)
696
700
697 $ echo dummy > dummy
701 $ echo dummy > dummy
698 $ hg add dummy
702 $ hg add dummy
699 $ hg commit -m 'revision for separation'
703 $ hg commit -m 'revision for separation'
700 $ chmod -x large2
704 $ chmod -x large2
701 $ hg status -A --rev '.^1' large2
705 $ hg status -A --rev '.^1' large2
702 M large2
706 M large2
703
707
704 #else
708 #else
705
709
706 Test that "hg status" against revisions other than parent ignores exec
710 Test that "hg status" against revisions other than parent ignores exec
707 bit correctly on the platform being unaware of it.
711 bit correctly on the platform being unaware of it.
708
712
709 $ hg update -q -C 4
713 $ hg update -q -C 4
710
714
711 $ cat > exec-bit.patch <<EOF
715 $ cat > exec-bit.patch <<EOF
712 > # HG changeset patch
716 > # HG changeset patch
713 > # User test
717 > # User test
714 > # Date 0 0
718 > # Date 0 0
715 > # Thu Jan 01 00:00:00 1970 +0000
719 > # Thu Jan 01 00:00:00 1970 +0000
716 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
720 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
717 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
721 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
718 > chmod +x large2
722 > chmod +x large2
719 >
723 >
720 > diff --git a/.hglf/large2 b/.hglf/large2
724 > diff --git a/.hglf/large2 b/.hglf/large2
721 > old mode 100644
725 > old mode 100644
722 > new mode 100755
726 > new mode 100755
723 > EOF
727 > EOF
724 $ hg import --exact --bypass exec-bit.patch
728 $ hg import --exact --bypass exec-bit.patch
725 applying exec-bit.patch
729 applying exec-bit.patch
726 $ hg status -A --rev tip large2
730 $ hg status -A --rev tip large2
727 C large2
731 C large2
728
732
729 #endif
733 #endif
730
734
735 Test a fatal error interrupting an update. lfdirstate doesn't realize that
736 .hglf has been updated while the largefile hasn't. Status thus shows a clean
737 state ... but rebuilding lfdirstate and checking all hashes reveals it isn't
738 clean.
739
740 Start with clean dirstates:
741 $ hg up -qcr "8^"
742 $ sleep 1
743 $ hg st
744 Update standins without updating largefiles:
745 $ cat << EOF > ../crashupdatelfiles.py
746 > import hgext.largefiles.lfutil
747 > def getlfilestoupdate(oldstandins, newstandins):
748 > raise SystemExit(7)
749 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
750 > EOF
751 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
752 [7]
753 Check large1 content and status:
754 BUG: largeX is R and large1 is not M and update does nothing
755 $ cat large1
756 large1 in #3
757 $ hg st
758 R largeX
759 $ hg up -Cr .
760 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 $ hg st
762 R largeX
763 Force largefiles rehashing and check again - revealing modifications that
764 update now can remove:
765 $ rm .hg/largefiles/dirstate
766 $ hg st
767 M large1
768 ! largeX
769 $ hg up -Cr .
770 getting changed largefiles
771 2 largefiles updated, 0 removed
772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 $ hg st
774 $ cat large1
775 manually modified before 'hg transplant --continue'
776
731 $ cd ..
777 $ cd ..
732
778
733 Test that "hg convert" avoids copying largefiles from the working
779 Test that "hg convert" avoids copying largefiles from the working
734 directory into store, because "hg convert" doesn't update largefiles
780 directory into store, because "hg convert" doesn't update largefiles
735 in the working directory (removing files under ".cache/largefiles"
781 in the working directory (removing files under ".cache/largefiles"
736 forces "hg convert" to copy corresponding largefiles)
782 forces "hg convert" to copy corresponding largefiles)
737
783
738 $ cat >> $HGRCPATH <<EOF
784 $ cat >> $HGRCPATH <<EOF
739 > [extensions]
785 > [extensions]
740 > convert =
786 > convert =
741 > EOF
787 > EOF
742
788
743 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
789 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
744 $ hg convert -q repo repo.converted
790 $ hg convert -q repo repo.converted
General Comments 0
You need to be logged in to leave comments. Login now