comparison hgext/keyword.py @ 39369:34ba47117164

formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC) Note that {path} in status is either relative-to-cwd or repository-absolute depending on the command argument and config knob, which can't be reproduced by using the {path|relpath} filter. The default template is updated to always use a relative path. .. bc:: ``{abspath}`` and ``{file}`` in generic templates are renamed to ``{path}``. Any ``{path}`` is a repository-absolute path. Use ``{path|relpath}`` to convert it to a filesystem path.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 05 Aug 2018 16:44:16 +0900
parents 67dc32d4e790
children 5bf99c27a7b6
comparison
equal deleted inserted replaced
39368:5b1d406b39f1 39369:34ba47117164
574 fmt = '%s %s\n' 574 fmt = '%s %s\n'
575 for kwstate, char, filenames in kwstates: 575 for kwstate, char, filenames in kwstates:
576 label = 'kwfiles.' + kwstate 576 label = 'kwfiles.' + kwstate
577 for f in filenames: 577 for f in filenames:
578 fm.startitem() 578 fm.startitem()
579 fm.write('kwstatus path', fmt, char, 579 fm.data(kwstatus=char, path=f)
580 repo.pathto(f, cwd), label=label) 580 fm.plain(fmt % (char, repo.pathto(f, cwd)), label=label)
581 fm.end() 581 fm.end()
582 582
583 @command('kwshrink', 583 @command('kwshrink',
584 cmdutil.walkopts, 584 cmdutil.walkopts,
585 _('hg kwshrink [OPTION]... [FILE]...'), 585 _('hg kwshrink [OPTION]... [FILE]...'),