Commit 264fbd92 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

addremove: respect ui.relative-paths

I previously changed these code paths while trying to not change any
behavior to avoid inconsistencies between them in the intermediate
commits. They're now all ready to be switched over to respecting
ui.relative-paths.

Differential Revision: https://phab.mercurial-scm.org/D5936
parent a8d3a4be066e
......@@ -2401,7 +2401,7 @@ def commit(ui, repo, commitfunc, pats, opts):
with dsguard or util.nullcontextmanager():
if dsguard:
relative = scmutil.anypats(pats, opts)
uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=relative)
uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative)
if scmutil.addremove(repo, matcher, "", uipathfn, opts) != 0:
raise error.Abort(
_("failed to mark all new/missing files as added/removed"))
......@@ -2481,7 +2481,7 @@ def amend(ui, repo, old, extra, pats, opts):
# was specified.
matcher = scmutil.match(wctx, pats, opts)
relative = scmutil.anypats(pats, opts)
uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=relative)
uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative)
if (opts.get('addremove')
and scmutil.addremove(repo, matcher, "", uipathfn, opts)):
raise error.Abort(
......
......@@ -180,7 +180,7 @@ def add(ui, repo, *pats, **opts):
"""
m = scmutil.match(repo[None], pats, pycompat.byteskwargs(opts))
uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=True)
uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
rejected = cmdutil.add(ui, repo, m, "", uipathfn, False, **opts)
return rejected and 1 or 0
......@@ -256,7 +256,7 @@ def addremove(ui, repo, *pats, **opts):
opts['similarity'] = '100'
matcher = scmutil.match(repo[None], pats, opts)
relative = scmutil.anypats(pats, opts)
uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=relative)
uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative)
return scmutil.addremove(repo, matcher, "", uipathfn, opts)
@command('annotate|blame',
......@@ -2258,7 +2258,7 @@ def forget(ui, repo, *pats, **opts):
m = scmutil.match(repo[None], pats, opts)
dryrun, interactive = opts.get('dry_run'), opts.get('interactive')
uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=True)
uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
rejected = cmdutil.forget(ui, repo, m, prefix="", uipathfn=uipathfn,
explicitonly=False, dryrun=dryrun,
interactive=interactive)[0]
......@@ -4720,7 +4720,7 @@ def remove(ui, repo, *pats, **opts):
m = scmutil.match(repo[None], pats, opts)
subrepos = opts.get('subrepos')
uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=True)
uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
return cmdutil.remove(ui, repo, m, "", uipathfn, after, force, subrepos,
dryrun=dryrun)
......
......@@ -1125,7 +1125,7 @@ def marktouched(repo, files, similarity=0.0):
# TODO: We should probably have the caller pass in uipathfn and apply it to
# the messages above too. forcerelativevalue=True is consistent with how
# it used to work.
uipathfn = getuipathfn(repo, forcerelativevalue=True)
uipathfn = getuipathfn(repo, legacyrelativevalue=True)
renames = _findrenames(repo, m, added + unknown, removed + deleted,
similarity, uipathfn)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment