##// END OF EJS Templates
largefiles: for update -C, only update largefiles when necessary...
Mads Kiilerich -
r24787:9d5c2789 default
parent child Browse files
Show More
@@ -1318,45 +1318,37 b' def mergeupdate(orig, repo, node, branch'
1318 # (*) don't care
1318 # (*) don't care
1319 # (*1) deprecated, but used internally (e.g: "rebase --collapse")
1319 # (*1) deprecated, but used internally (e.g: "rebase --collapse")
1320
1320
1321 linearmerge = not branchmerge and not force and not partial
1321 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1322 unsure, s = lfdirstate.status(match_.always(repo.root,
1323 repo.getcwd()),
1324 [], False, False, False)
1325 pctx = repo['.']
1326 for lfile in unsure + s.modified:
1327 lfileabs = repo.wvfs.join(lfile)
1328 if not os.path.exists(lfileabs):
1329 continue
1330 lfhash = lfutil.hashrepofile(repo, lfile)
1331 standin = lfutil.standin(lfile)
1332 lfutil.writestandin(repo, standin, lfhash,
1333 lfutil.getexecutable(lfileabs))
1334 if (standin in pctx and
1335 lfhash == lfutil.readstandin(repo, lfile, '.')):
1336 lfdirstate.normal(lfile)
1337 for lfile in s.added:
1338 lfutil.updatestandin(repo, lfutil.standin(lfile))
1339 lfdirstate.write()
1322
1340
1323 if linearmerge or (branchmerge and force and not partial):
1341 oldstandins = lfutil.getstandinsstate(repo)
1324 # update standins for linear-merge or force-branch-merge,
1325 # because largefiles in the working directory may be modified
1326 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1327 unsure, s = lfdirstate.status(match_.always(repo.root,
1328 repo.getcwd()),
1329 [], False, False, False)
1330 pctx = repo['.']
1331 for lfile in unsure + s.modified:
1332 lfileabs = repo.wvfs.join(lfile)
1333 if not os.path.exists(lfileabs):
1334 continue
1335 lfhash = lfutil.hashrepofile(repo, lfile)
1336 standin = lfutil.standin(lfile)
1337 lfutil.writestandin(repo, standin, lfhash,
1338 lfutil.getexecutable(lfileabs))
1339 if (standin in pctx and
1340 lfhash == lfutil.readstandin(repo, lfile, '.')):
1341 lfdirstate.normal(lfile)
1342 for lfile in s.added:
1343 lfutil.updatestandin(repo, lfutil.standin(lfile))
1344 lfdirstate.write()
1345
1346 if linearmerge:
1347 # Only call updatelfiles on the standins that have changed
1348 # to save time
1349 oldstandins = lfutil.getstandinsstate(repo)
1350
1342
1351 result = orig(repo, node, branchmerge, force, partial, *args, **kwargs)
1343 result = orig(repo, node, branchmerge, force, partial, *args, **kwargs)
1352
1344
1353 filelist = None
1345 newstandins = lfutil.getstandinsstate(repo)
1354 if linearmerge:
1346 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1355 newstandins = lfutil.getstandinsstate(repo)
1347 if branchmerge or force or partial:
1356 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1348 filelist.extend(s.deleted + s.removed)
1357
1349
1358 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1350 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1359 normallookup=partial, checked=linearmerge)
1351 normallookup=partial, checked=True)
1360
1352
1361 return result
1353 return result
1362 finally:
1354 finally:
@@ -113,8 +113,6 b' Largefile in the working copy, keeping t'
113 $ echo "l" | hg merge --config ui.interactive=Yes
113 $ echo "l" | hg merge --config ui.interactive=Yes
114 remote turned local largefile foo into a normal file
114 remote turned local largefile foo into a normal file
115 keep (l)argefile or use (n)ormal file? l
115 keep (l)argefile or use (n)ormal file? l
116 getting changed largefiles
117 0 largefiles updated, 0 removed
118 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 (branch merge, don't forget to commit)
117 (branch merge, don't forget to commit)
120
118
@@ -249,8 +247,6 b' swap'
249
247
250 $ hg up -Cqr large
248 $ hg up -Cqr large
251 $ hg merge -r normal-id
249 $ hg merge -r normal-id
252 getting changed largefiles
253 0 largefiles updated, 0 removed
254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 (branch merge, don't forget to commit)
251 (branch merge, don't forget to commit)
256 $ cat f
252 $ cat f
@@ -271,8 +267,6 b' swap'
271
267
272 $ hg up -Cqr large
268 $ hg up -Cqr large
273 $ hg merge -r normal-same
269 $ hg merge -r normal-same
274 getting changed largefiles
275 0 largefiles updated, 0 removed
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 (branch merge, don't forget to commit)
271 (branch merge, don't forget to commit)
278 $ cat f
272 $ cat f
@@ -307,8 +301,6 b' swap'
307 $ hg merge -r normal2
301 $ hg merge -r normal2
308 remote turned local largefile f into a normal file
302 remote turned local largefile f into a normal file
309 keep (l)argefile or use (n)ormal file? l
303 keep (l)argefile or use (n)ormal file? l
310 getting changed largefiles
311 0 largefiles updated, 0 removed
312 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
313 (branch merge, don't forget to commit)
305 (branch merge, don't forget to commit)
314 $ cat f
306 $ cat f
@@ -372,8 +364,6 b' Ancestor: large Parent: large2 Paren'
372 $ hg merge -r normal
364 $ hg merge -r normal
373 remote turned local largefile f into a normal file
365 remote turned local largefile f into a normal file
374 keep (l)argefile or use (n)ormal file? l
366 keep (l)argefile or use (n)ormal file? l
375 getting changed largefiles
376 0 largefiles updated, 0 removed
377 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
378 (branch merge, don't forget to commit)
368 (branch merge, don't forget to commit)
379 $ cat f
369 $ cat f
@@ -364,8 +364,6 b' Test update with subrepos.'
364 $ hg update -C
364 $ hg update -C
365 getting changed largefiles
365 getting changed largefiles
366 1 largefiles updated, 0 removed
366 1 largefiles updated, 0 removed
367 getting changed largefiles
368 0 largefiles updated, 0 removed
369 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 $ hg status -S
368 $ hg status -S
371
369
@@ -805,8 +803,6 b" merge action 'd' for 'local renamed dire"
805 R d1/f
803 R d1/f
806 $ hg merge
804 $ hg merge
807 merging d2/f and d1/f to d2/f
805 merging d2/f and d1/f to d2/f
808 getting changed largefiles
809 0 largefiles updated, 0 removed
810 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
806 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
811 (branch merge, don't forget to commit)
807 (branch merge, don't forget to commit)
812 $ cd ..
808 $ cd ..
@@ -581,8 +581,6 b' Test 3507 (both normal files and largefi'
581 C sub2/large6
581 C sub2/large6
582 C sub2/large7
582 C sub2/large7
583 $ hg up -C '.^'
583 $ hg up -C '.^'
584 getting changed largefiles
585 0 largefiles updated, 0 removed
586 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 $ hg remove large
585 $ hg remove large
588 $ hg addremove --traceback
586 $ hg addremove --traceback
@@ -1431,8 +1429,6 b' Rollback on largefiles.'
1431
1429
1432 verify that largefile .orig file no longer is overwritten on every update -C:
1430 verify that largefile .orig file no longer is overwritten on every update -C:
1433 $ hg update --clean
1431 $ hg update --clean
1434 getting changed largefiles
1435 0 largefiles updated, 0 removed
1436 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1432 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1437 $ cat sub2/large7.orig
1433 $ cat sub2/large7.orig
1438 mistake
1434 mistake
General Comments 0
You need to be logged in to leave comments. Login now