##// END OF EJS Templates
largefiles: use "normallookup", if "mtime" of standin is unset...
FUJIWARA Katsunori -
r21932:21a2f31f stable
parent child Browse files
Show More
@@ -0,0 +1,53 b''
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:fail
7 > [extensions]
8 > largefiles =
9 > EOF
10
11 $ hg init repo
12 $ cd repo
13
14 $ echo large1 > large1
15 $ echo large2 > large2
16 $ hg add --large large1 large2
17 $ echo normal1 > normal1
18 $ hg add normal1
19 $ hg commit -m '#0'
20 $ echo 'large1 in #1' > large1
21 $ echo 'normal1 in #1' > normal1
22 $ hg commit -m '#1'
23 $ hg update -q -C 0
24 $ echo 'large2 in #2' > large2
25 $ hg commit -m '#2'
26 created new head
27
28 Test that "hg merge" updates largefiles from "other" correctly
29
30 (getting largefiles from "other" normally)
31
32 $ hg status -A large1
33 C large1
34 $ cat large1
35 large1
36 $ cat .hglf/large1
37 4669e532d5b2c093a78eca010077e708a071bb64
38 $ hg merge --config debug.dirstate.delaywrite=2
39 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 (branch merge, don't forget to commit)
41 getting changed largefiles
42 1 largefiles updated, 0 removed
43 $ hg status -A large1
44 M large1
45 $ cat large1
46 large1 in #1
47 $ cat .hglf/large1
48 58e24f733a964da346e2407a2bee99d9001184f5
49 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
50 -4669e532d5b2c093a78eca010077e708a071bb64
51 +58e24f733a964da346e2407a2bee99d9001184f5
52
53 $ cd ..
@@ -509,12 +509,15 b' def updatelfiles(ui, repo, filelist=None'
509
509
510 updated += update1
510 updated += update1
511
511
512 state = repo.dirstate[lfutil.standin(lfile)]
512 standin = lfutil.standin(lfile)
513 if standin in repo.dirstate:
514 stat = repo.dirstate._map[standin]
515 state, mtime = stat[0], stat[3]
516 else:
517 state, mtime = '?', -1
513 if state == 'n':
518 if state == 'n':
514 # When rebasing, we need to synchronize the standin and the
519 if mtime < 0:
515 # largefile, because otherwise the largefile will get reverted.
520 # state 'n' doesn't ensure 'clean' in this case
516 # But for commit's sake, we have to mark the file as unclean.
517 if getattr(repo, "_isrebasing", False):
518 lfdirstate.normallookup(lfile)
521 lfdirstate.normallookup(lfile)
519 else:
522 else:
520 lfdirstate.normal(lfile)
523 lfdirstate.normal(lfile)
General Comments 0
You need to be logged in to leave comments. Login now