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