Show More
@@ -650,25 +650,29 b' def reposetup(ui, repo):' | |||
|
650 | 650 | For the latter we have to follow the symlink to find out whether its |
|
651 | 651 | target is configured for expansion and we therefore must unexpand the |
|
652 | 652 | keywords in the destination.''' |
|
653 | orig(ui, repo, pats, opts, rename) | |
|
654 | if opts.get('dry_run'): | |
|
655 | return | |
|
656 | wctx = repo[None] | |
|
657 | cwd = repo.getcwd() | |
|
653 | wlock = repo.wlock() | |
|
654 | try: | |
|
655 | orig(ui, repo, pats, opts, rename) | |
|
656 | if opts.get('dry_run'): | |
|
657 | return | |
|
658 | wctx = repo[None] | |
|
659 | cwd = repo.getcwd() | |
|
658 | 660 | |
|
659 | def haskwsource(dest): | |
|
660 | '''Returns true if dest is a regular file and configured for | |
|
661 | expansion or a symlink which points to a file configured for | |
|
662 | expansion. ''' | |
|
663 | source = repo.dirstate.copied(dest) | |
|
664 | if 'l' in wctx.flags(source): | |
|
665 | source = scmutil.canonpath(repo.root, cwd, | |
|
666 | os.path.realpath(source)) | |
|
667 | return kwt.match(source) | |
|
661 | def haskwsource(dest): | |
|
662 | '''Returns true if dest is a regular file and configured for | |
|
663 | expansion or a symlink which points to a file configured for | |
|
664 | expansion. ''' | |
|
665 | source = repo.dirstate.copied(dest) | |
|
666 | if 'l' in wctx.flags(source): | |
|
667 | source = scmutil.canonpath(repo.root, cwd, | |
|
668 | os.path.realpath(source)) | |
|
669 | return kwt.match(source) | |
|
668 | 670 | |
|
669 | candidates = [f for f in repo.dirstate.copies() if | |
|
670 | 'l' not in wctx.flags(f) and haskwsource(f)] | |
|
671 | kwt.overwrite(wctx, candidates, False, False) | |
|
671 | candidates = [f for f in repo.dirstate.copies() if | |
|
672 | 'l' not in wctx.flags(f) and haskwsource(f)] | |
|
673 | kwt.overwrite(wctx, candidates, False, False) | |
|
674 | finally: | |
|
675 | wlock.release() | |
|
672 | 676 | |
|
673 | 677 | def kw_dorecord(orig, ui, repo, commitfunc, *pats, **opts): |
|
674 | 678 | '''Wraps record.dorecord expanding keywords after recording.''' |
General Comments 0
You need to be logged in to leave comments.
Login now