Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 49480:cdfba684b6a1
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.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 12 Aug 2022 14:35:34 -0700 |
parents | 53e9422a9b45 |
children | e78a41686464 |
line wrap: on
line diff
--- 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 )