# HG changeset patch # User Martin von Zweigbergk # Date 1660340134 25200 # Node ID cdfba684b6a11fb4875e2a054d22e70394e9449d # Parent 744b341782f4cd5f4f75a215135c3cc63e45288f status: include `repo` in template context also for resolved paths The `repo` object needs to be in the templater context when using e.g. `relpath`. It has been missing there since it was the unresolved files were added to the templated output in 07ebb567e8bb. diff -r 744b341782f4 -r cdfba684b6a1 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Aug 24 15:15:04 2022 -0400 +++ b/mercurial/cmdutil.py Fri Aug 12 14:35:34 2022 -0700 @@ -832,7 +832,7 @@ @attr.s(frozen=True) class morestatus: - reporoot = attr.ib() + repo = attr.ib() unfinishedop = attr.ib() unfinishedmsg = attr.ib() activemerge = attr.ib() @@ -876,7 +876,7 @@ mergeliststr = b'\n'.join( [ b' %s' - % util.pathto(self.reporoot, encoding.getcwd(), path) + % util.pathto(self.repo.root, encoding.getcwd(), path) for path in self.unresolvedpaths ] ) @@ -898,6 +898,7 @@ # Already output. continue fm.startitem() + fm.context(repo=self.repo) # We can't claim to know the status of the file - it may just # have been in one of the states that were not requested for # display, so it could be anything. @@ -923,7 +924,7 @@ if activemerge: unresolved = sorted(mergestate.unresolved()) return morestatus( - repo.root, unfinishedop, unfinishedmsg, activemerge, unresolved + repo, unfinishedop, unfinishedmsg, activemerge, unresolved ) diff -r 744b341782f4 -r cdfba684b6a1 tests/test-update-branches.t --- a/tests/test-update-branches.t Wed Aug 24 15:15:04 2022 -0400 +++ b/tests/test-update-branches.t Fri Aug 12 14:35:34 2022 -0700 @@ -633,6 +633,10 @@ # # To mark files as resolved: hg resolve --mark FILE + $ hg status -T '{status} {path} - {relpath(path)}\n' + M foo - foo + a - a + $ hg status -Tjson [ {