Show More
@@ -579,8 +579,7 b' def overridecopy(orig, ui, repo, pats, o' | |||
|
579 | 579 | # Standins are only updated (to match the hash of largefiles) before |
|
580 | 580 | # commits. Update the standins then run the original revert, changing |
|
581 | 581 | # the matcher to hit standins instead of largefiles. Based on the |
|
582 |
# resulting standins update the largefiles. |
|
|
583 | # to their proper state | |
|
582 | # resulting standins update the largefiles. | |
|
584 | 583 | def overriderevert(orig, ui, repo, *pats, **opts): |
|
585 | 584 | # Because we put the standins in a bad state (by updating them) |
|
586 | 585 | # and then return them to a correct state we need to lock to |
@@ -597,8 +596,9 b' def overriderevert(orig, ui, repo, *pats' | |||
|
597 | 596 | if (os.path.exists(repo.wjoin(lfutil.standin(lfile)))): |
|
598 | 597 | os.unlink(repo.wjoin(lfutil.standin(lfile))) |
|
599 | 598 | |
|
599 | oldstandins = lfutil.getstandinsstate(repo) | |
|
600 | ||
|
600 | 601 | try: |
|
601 | ctx = scmutil.revsingle(repo, opts.get('rev')) | |
|
602 | 602 | def overridematch(ctx, pats=[], opts={}, globbed=False, |
|
603 | 603 | default='relpath'): |
|
604 | 604 | match = oldmatch(ctx, pats, opts, globbed, default) |
@@ -616,50 +616,21 b' def overriderevert(orig, ui, repo, *pats' | |||
|
616 | 616 | origmatchfn = m.matchfn |
|
617 | 617 | def matchfn(f): |
|
618 | 618 | if lfutil.isstandin(f): |
|
619 | # We need to keep track of what largefiles are being | |
|
620 | # matched so we know which ones to update later -- | |
|
621 | # otherwise we accidentally revert changes to other | |
|
622 | # largefiles. This is repo-specific, so duckpunch the | |
|
623 | # repo object to keep the list of largefiles for us | |
|
624 | # later. | |
|
625 | if origmatchfn(lfutil.splitstandin(f)) and \ | |
|
626 | (f in repo[None] or f in ctx): | |
|
627 | lfileslist = getattr(repo, '_lfilestoupdate', []) | |
|
628 | lfileslist.append(lfutil.splitstandin(f)) | |
|
629 | repo._lfilestoupdate = lfileslist | |
|
630 | return True | |
|
631 | else: | |
|
632 | return False | |
|
619 | return (origmatchfn(lfutil.splitstandin(f)) and | |
|
620 | (f in repo[None] or f in ctx)) | |
|
633 | 621 | return origmatchfn(f) |
|
634 | 622 | m.matchfn = matchfn |
|
635 | 623 | return m |
|
636 | 624 | oldmatch = installmatchfn(overridematch) |
|
637 | scmutil.match | |
|
638 | matches = overridematch(repo[None], pats, opts) | |
|
625 | overridematch(repo[None], pats, opts) | |
|
639 | 626 | orig(ui, repo, *pats, **opts) |
|
640 | 627 | finally: |
|
641 | 628 | restorematchfn() |
|
642 | lfileslist = getattr(repo, '_lfilestoupdate', []) | |
|
643 | lfcommands.updatelfiles(ui, repo, filelist=lfileslist, | |
|
644 | printmessage=False) | |
|
645 | 629 | |
|
646 | # empty out the largefiles list so we start fresh next time | |
|
647 | repo._lfilestoupdate = [] | |
|
648 | for lfile in modified: | |
|
649 | if lfile in lfileslist: | |
|
650 | if os.path.exists(repo.wjoin(lfutil.standin(lfile))) and lfile\ | |
|
651 | in repo['.']: | |
|
652 | lfutil.writestandin(repo, lfutil.standin(lfile), | |
|
653 | repo['.'][lfile].data().strip(), | |
|
654 | 'x' in repo['.'][lfile].flags()) | |
|
655 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
|
656 | for lfile in added: | |
|
657 | standin = lfutil.standin(lfile) | |
|
658 | if standin not in ctx and (standin in matches or opts.get('all')): | |
|
659 | if lfile in lfdirstate: | |
|
660 | lfdirstate.drop(lfile) | |
|
661 | util.unlinkpath(repo.wjoin(standin)) | |
|
662 | lfdirstate.write() | |
|
630 | newstandins = lfutil.getstandinsstate(repo) | |
|
631 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) | |
|
632 | lfcommands.updatelfiles(ui, repo, filelist, printmessage=False) | |
|
633 | ||
|
663 | 634 | finally: |
|
664 | 635 | wlock.release() |
|
665 | 636 |
General Comments 0
You need to be logged in to leave comments.
Login now