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