comparison mercurial/cmdutil.py @ 41668:e41449818bee

copy: respect ui.relative-paths in copy/rename Differential Revision: https://phab.mercurial-scm.org/D5907
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 08 Feb 2019 13:00:05 -0800
parents 16a49c778bde
children 05433ad59c52
comparison
equal deleted inserted replaced
41667:dadbfcc63b3e 41668:e41449818bee
1133 targets = {} 1133 targets = {}
1134 after = opts.get("after") 1134 after = opts.get("after")
1135 dryrun = opts.get("dry_run") 1135 dryrun = opts.get("dry_run")
1136 wctx = repo[None] 1136 wctx = repo[None]
1137 1137
1138 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
1138 def walkpat(pat): 1139 def walkpat(pat):
1139 srcs = [] 1140 srcs = []
1140 if after: 1141 if after:
1141 badstates = '?' 1142 badstates = '?'
1142 else: 1143 else:
1143 badstates = '?r' 1144 badstates = '?r'
1144 m = scmutil.match(wctx, [pat], opts, globbed=True) 1145 m = scmutil.match(wctx, [pat], opts, globbed=True)
1145 for abs in wctx.walk(m): 1146 for abs in wctx.walk(m):
1146 state = repo.dirstate[abs] 1147 state = repo.dirstate[abs]
1147 rel = m.rel(abs) 1148 rel = uipathfn(abs)
1148 exact = m.exact(abs) 1149 exact = m.exact(abs)
1149 if state in badstates: 1150 if state in badstates:
1150 if exact and state == '?': 1151 if exact and state == '?':
1151 ui.warn(_('%s: not copying - file is not managed\n') % rel) 1152 ui.warn(_('%s: not copying - file is not managed\n') % rel)
1152 if exact and state == 'r': 1153 if exact and state == 'r':