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