This is about to be become significantly more complicated as ui.path[x] will
become a list.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
This is about to be become significantly more complicated as ui.path[x] will
become a list.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/templatekw.py (5 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
31fe7140f7d8 | 29a906fed3ae | Pierre-Yves David | Apr 15 2021, 6:08 AM |
urls = util.sortdict((k, p.rawloc) for k, p in all_paths) | urls = util.sortdict((k, p.rawloc) for k, p in all_paths) | ||||
def makemap(k): | def makemap(k): | ||||
p = paths[k] | p = paths[k] | ||||
d = {b'name': k, b'url': p.rawloc} | d = {b'name': k, b'url': p.rawloc} | ||||
d.update((o, v) for o, v in sorted(pycompat.iteritems(p.suboptions))) | d.update((o, v) for o, v in sorted(pycompat.iteritems(p.suboptions))) | ||||
return d | return d | ||||
return _hybrid(None, urls, makemap, lambda k: b'%s=%s' % (k, urls[k])) | def format_one(k): | ||||
return b'%s=%s' % (k, urls[k]) | |||||
return _hybrid(None, urls, makemap, format_one) | |||||
@templatekeyword(b"predecessors", requires={b'repo', b'ctx'}) | @templatekeyword(b"predecessors", requires={b'repo', b'ctx'}) | ||||
def showpredecessors(context, mapping): | def showpredecessors(context, mapping): | ||||
"""Returns the list of the closest visible predecessors. (EXPERIMENTAL)""" | """Returns the list of the closest visible predecessors. (EXPERIMENTAL)""" | ||||
repo = context.resource(mapping, b'repo') | repo = context.resource(mapping, b'repo') | ||||
ctx = context.resource(mapping, b'ctx') | ctx = context.resource(mapping, b'ctx') | ||||
predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node())) | predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node())) |