Show More
@@ -517,53 +517,52 b' def updatelfiles(' | |||
|
517 | 517 | filelist = set(filelist) |
|
518 | 518 | lfiles = [f for f in lfiles if f in filelist] |
|
519 | 519 | |
|
520 | with lfdirstate.changing_parents(repo): | |
|
521 | update = {} | |
|
522 | dropped = set() | |
|
523 | updated, removed = 0, 0 | |
|
524 |
|
|
|
525 | wctx = repo[None] | |
|
526 | for lfile in lfiles: | |
|
527 | lfileorig = os.path.relpath( | |
|
528 | scmutil.backuppath(ui, repo, lfile), start=repo.root | |
|
529 | ) | |
|
530 | standin = lfutil.standin(lfile) | |
|
531 | standinorig = os.path.relpath( | |
|
532 | scmutil.backuppath(ui, repo, standin), start=repo.root | |
|
533 | ) | |
|
534 | if wvfs.exists(standin): | |
|
535 | if wvfs.exists(standinorig) and wvfs.exists(lfile): | |
|
536 | shutil.copyfile(wvfs.join(lfile), wvfs.join(lfileorig)) | |
|
537 | wvfs.unlinkpath(standinorig) | |
|
538 | expecthash = lfutil.readasstandin(wctx[standin]) | |
|
539 | if expecthash != b'': | |
|
540 | if lfile not in wctx: # not switched to normal file | |
|
541 | if repo.dirstate.get_entry(standin).any_tracked: | |
|
542 | wvfs.unlinkpath(lfile, ignoremissing=True) | |
|
543 |
|
|
|
544 | dropped.add(lfile) | |
|
520 | update = {} | |
|
521 | dropped = set() | |
|
522 | updated, removed = 0, 0 | |
|
523 | wvfs = repo.wvfs | |
|
524 | wctx = repo[None] | |
|
525 | for lfile in lfiles: | |
|
526 | lfileorig = os.path.relpath( | |
|
527 | scmutil.backuppath(ui, repo, lfile), start=repo.root | |
|
528 | ) | |
|
529 | standin = lfutil.standin(lfile) | |
|
530 | standinorig = os.path.relpath( | |
|
531 | scmutil.backuppath(ui, repo, standin), start=repo.root | |
|
532 | ) | |
|
533 | if wvfs.exists(standin): | |
|
534 | if wvfs.exists(standinorig) and wvfs.exists(lfile): | |
|
535 | shutil.copyfile(wvfs.join(lfile), wvfs.join(lfileorig)) | |
|
536 | wvfs.unlinkpath(standinorig) | |
|
537 | expecthash = lfutil.readasstandin(wctx[standin]) | |
|
538 | if expecthash != b'': | |
|
539 | if lfile not in wctx: # not switched to normal file | |
|
540 | if repo.dirstate.get_entry(standin).any_tracked: | |
|
541 | wvfs.unlinkpath(lfile, ignoremissing=True) | |
|
542 | else: | |
|
543 | dropped.add(lfile) | |
|
545 | 544 | |
|
546 |
|
|
|
547 |
|
|
|
548 |
|
|
|
549 |
|
|
|
550 |
|
|
|
551 |
|
|
|
552 |
|
|
|
553 |
|
|
|
554 |
|
|
|
555 |
|
|
|
556 |
|
|
|
557 |
|
|
|
558 |
|
|
|
559 |
|
|
|
560 |
|
|
|
561 |
|
|
|
562 |
|
|
|
563 |
|
|
|
564 |
|
|
|
565 |
|
|
|
566 |
|
|
|
545 | # allocate an entry in largefiles dirstate to prevent | |
|
546 | # lfilesrepo.status() from reporting missing files as | |
|
547 | # removed. | |
|
548 | lfdirstate.hacky_extension_update_file( | |
|
549 | lfile, | |
|
550 | p1_tracked=True, | |
|
551 | wc_tracked=True, | |
|
552 | possibly_dirty=True, | |
|
553 | ) | |
|
554 | update[lfile] = expecthash | |
|
555 | else: | |
|
556 | # Remove lfiles for which the standin is deleted, unless the | |
|
557 | # lfile is added to the repository again. This happens when a | |
|
558 | # largefile is converted back to a normal file: the standin | |
|
559 | # disappears, but a new (normal) file appears as the lfile. | |
|
560 | if ( | |
|
561 | wvfs.exists(lfile) | |
|
562 | and repo.dirstate.normalize(lfile) not in wctx | |
|
563 | ): | |
|
564 | wvfs.unlinkpath(lfile) | |
|
565 | removed += 1 | |
|
567 | 566 | |
|
568 | 567 | # largefile processing might be slow and be interrupted - be prepared |
|
569 | 568 | lfdirstate.write(repo.currenttransaction()) |
General Comments 0
You need to be logged in to leave comments.
Login now