Show More
@@ -1295,8 +1295,21 b' def mergeupdate(orig, repo, node, branch' | |||||
1295 | unsure, s = lfdirstate.status(match_.always(repo.root, |
|
1295 | unsure, s = lfdirstate.status(match_.always(repo.root, | |
1296 | repo.getcwd()), |
|
1296 | repo.getcwd()), | |
1297 | [], False, False, False) |
|
1297 | [], False, False, False) | |
1298 | for lfile in unsure + s.modified + s.added: |
|
1298 | pctx = repo['.'] | |
|
1299 | for lfile in unsure + s.modified: | |||
|
1300 | lfileabs = repo.wvfs.join(lfile) | |||
|
1301 | if not os.path.exists(lfileabs): | |||
|
1302 | continue | |||
|
1303 | lfhash = lfutil.hashrepofile(repo, lfile) | |||
|
1304 | standin = lfutil.standin(lfile) | |||
|
1305 | lfutil.writestandin(repo, standin, lfhash, | |||
|
1306 | lfutil.getexecutable(lfileabs)) | |||
|
1307 | if (standin in pctx and | |||
|
1308 | lfhash == lfutil.readstandin(repo, lfile, '.')): | |||
|
1309 | lfdirstate.normal(lfile) | |||
|
1310 | for lfile in s.added: | |||
1299 | lfutil.updatestandin(repo, lfutil.standin(lfile)) |
|
1311 | lfutil.updatestandin(repo, lfutil.standin(lfile)) | |
|
1312 | lfdirstate.write() | |||
1300 |
|
1313 | |||
1301 | if linearmerge: |
|
1314 | if linearmerge: | |
1302 | # Only call updatelfiles on the standins that have changed |
|
1315 | # Only call updatelfiles on the standins that have changed |
@@ -25,6 +25,39 b' directory (and ".hg/largefiles/dirstate"' | |||||
25 | $ hg commit -m '#2' |
|
25 | $ hg commit -m '#2' | |
26 | created new head |
|
26 | created new head | |
27 |
|
27 | |||
|
28 | Test that update also updates the lfdirstate of 'unsure' largefiles after | |||
|
29 | hashing them: | |||
|
30 | ||||
|
31 | The previous operations will usually have left us with largefiles with a mtime | |||
|
32 | within the same second as the dirstate was written. | |||
|
33 | The lfdirstate entries will thus have been written with an invalidated/unset | |||
|
34 | mtime to make sure further changes within the same second is detected. | |||
|
35 | We will however occasionally be "lucky" and get a tick between writing | |||
|
36 | largefiles and writing dirstate so we get valid lfdirstate timestamps. The | |||
|
37 | following verification is thus disabled but can be verified manually. | |||
|
38 | ||||
|
39 | #if false | |||
|
40 | $ hg debugdirstate --large --nodate | |||
|
41 | n 644 7 unset large1 | |||
|
42 | n 644 13 unset large2 | |||
|
43 | #endif | |||
|
44 | ||||
|
45 | Wait to make sure we get a tick so the mtime of the largefiles become valid. | |||
|
46 | ||||
|
47 | $ sleep 1 | |||
|
48 | ||||
|
49 | A linear merge will update standins before performing the actual merge. It will | |||
|
50 | do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and | |||
|
51 | update the corresponding standins. | |||
|
52 | Verify that it actually marks the clean files as clean in lfdirstate so | |||
|
53 | we don't have to hash them again next time we update. | |||
|
54 | ||||
|
55 | $ hg up | |||
|
56 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
57 | $ hg debugdirstate --large --nodate | |||
|
58 | n 644 7 set large1 | |||
|
59 | n 644 13 set large2 | |||
|
60 | ||||
28 | Test that lfdirstate keeps track of last modification of largefiles and |
|
61 | Test that lfdirstate keeps track of last modification of largefiles and | |
29 | prevents unnecessary hashing of content - also after linear/noop update |
|
62 | prevents unnecessary hashing of content - also after linear/noop update | |
30 |
|
63 |
General Comments 0
You need to be logged in to leave comments.
Login now