##// END OF EJS Templates
ui: represent paths as classes...
ui: represent paths as classes Many have long wanted for paths to have expanded functionality and flexibility. In order to make that transition possible, we need to start representing paths as something more than simple strings. This patch introduces two classes: 1) "path" for representing a single path instance 2) "paths" for representing a collection of "paths" Since we don't like patches that introduce new code without any consumers, we convert ui.expandpath() to use the new APIs internally. Upcoming patches will start exposing "path" instances to consumers that currently interface with string paths. The new "paths" attribute of ui is populated from config data the first time it is accessed. Since it isn't updated when the configs are modified, this could lead to some inaccurate caching behavior. It shouldn't be an issue, as paths information is typically not accessed until command dispatch, which occurs after the repository config and extensions have been loaded. Time will tell if we need to refresh paths information when the underlying config changes.

File last commit:

r22768:66bf251e default
r24250:9c32eea2 default
Show More
map-cmdline.phases
73 lines | 2.6 KiB | text/plain | TextLexer
Jordi Gutiérrez Hermoso
log: add labels to the phase template...
r22767 # Base templates. Due to name clashes with existing keywords, we have
# to replace some keywords with 'lkeyword', for 'labelled keyword'
changeset = '{cset}{branches}{bookmarks}{tags}{lphase}{parents}{user}{ldate}{summary}\n'
changeset_quiet = '{node}'
Jordi Gutiérrez Hermoso
log: show phase in hg log -v with the phase template...
r22768 changeset_verbose = '{cset}{branches}{bookmarks}{tags}{lphase}{parents}{user}{ldate}{lfiles}{lfile_copies_switch}{description}\n'
Jordi Gutiérrez Hermoso
log: add labels to the phase template...
r22767 changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
# File templates
lfiles = '{if(files,
label("ui.note log.files",
"files: {files}\n"))}'
lfile_mods = '{if(file_mods,
label("ui.debug log.files",
"files: {file_mods}\n"))}'
lfile_adds = '{if(file_adds,
label("ui.debug log.files",
"files+: {file_adds}\n"))}'
lfile_dels = '{if(file_dels,
label("ui.debug log.files",
"files-: {file_dels}\n"))}'
lfile_copies_switch = '{if(file_copies_switch,
label("ui.note log.copies",
"copies: {file_copies_switch
% ' {name} ({source})'}\n"))}'
# General templates
cset = '{label("log.changeset changeset.{phase}",
"changeset: {rev}:{node|short}")}\n'
lphase = '{label("log.phase",
"phase: {phase}")}\n'
fullcset = '{label("log.changeset changeset.{phase}",
"changeset: {rev}:{node}")}\n'
parent = '{label("log.parent changeset.{phase}",
"parent: {rev}:{node|formatnode}")}\n'
node = '{label("log.node",
"{rev}:{node|short}")}\n'
manifest = '{label("ui.debug log.manifest",
"manifest: {rev}:{node}")}\n'
branch = '{label("log.branch",
"branch: {branch}")}\n'
tag = '{label("log.tag",
"tag: {tag}")}\n'
bookmark = '{label("log.bookmark",
"bookmark: {bookmark}")}\n'
user = '{label("log.user",
"user: {author}")}\n'
summary = '{label("log.summary",
"summary: {desc|firstline}")}\n'
ldate = '{label("log.date",
"date: {date|date}")}\n'
extra = '{label("ui.debug log.extra",
"extra: {key}={value|stringescape}")}\n'
description = '{label("ui.note log.description",
"description:")}
{label("ui.note log.description",
"{desc|strip}")}\n\n'