##// END OF EJS Templates
root: add support for -Tformatter option...
Yuya Nishihara -
r42610:98033230 default
parent child Browse files
Show More
@@ -5225,16 +5225,19 b' def rollback(ui, repo, **opts):'
5225 force=opts.get(r'force'))
5225 force=opts.get(r'force'))
5226
5226
5227 @command(
5227 @command(
5228 'root', [], intents={INTENT_READONLY},
5228 'root', [] + formatteropts, intents={INTENT_READONLY},
5229 helpcategory=command.CATEGORY_WORKING_DIRECTORY)
5229 helpcategory=command.CATEGORY_WORKING_DIRECTORY)
5230 def root(ui, repo):
5230 def root(ui, repo, **opts):
5231 """print the root (top) of the current working directory
5231 """print the root (top) of the current working directory
5232
5232
5233 Print the root directory of the current repository.
5233 Print the root directory of the current repository.
5234
5234
5235 Returns 0 on success.
5235 Returns 0 on success.
5236 """
5236 """
5237 ui.write(repo.root + "\n")
5237 opts = pycompat.byteskwargs(opts)
5238 with ui.formatter('root', opts) as fm:
5239 fm.startitem()
5240 fm.write('reporoot', '%s\n', repo.root)
5238
5241
5239 @command('serve',
5242 @command('serve',
5240 [('A', 'accesslog', '', _('name of access log file to write to'),
5243 [('A', 'accesslog', '', _('name of access log file to write to'),
@@ -645,6 +645,10 b' invalid arguments'
645
645
646 alias for: hg root
646 alias for: hg root
647
647
648 options:
649
650 -T --template TEMPLATE display with template
651
648 (use 'hg rt -h' to show more help)
652 (use 'hg rt -h' to show more help)
649 [255]
653 [255]
650
654
@@ -98,6 +98,12 b' Repository root:'
98 $TESTTMP/t
98 $TESTTMP/t
99 $ hg log -l1 -T '{reporoot}\n'
99 $ hg log -l1 -T '{reporoot}\n'
100 $TESTTMP/t
100 $TESTTMP/t
101 $ hg root -Tjson | sed 's|\\\\|\\|g'
102 [
103 {
104 "reporoot": "$TESTTMP/t"
105 }
106 ]
101
107
102 At the end...
108 At the end...
103
109
@@ -338,7 +338,7 b' Show all commands + options'
338 resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
338 resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
339 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
339 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
340 rollback: dry-run, force
340 rollback: dry-run, force
341 root:
341 root: template
342 serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, print-url, subrepos
342 serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, print-url, subrepos
343 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
343 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
344 summary: remote
344 summary: remote
@@ -557,6 +557,10 b' Test the textwidth config option'
557
557
558 Returns 0 on success.
558 Returns 0 on success.
559
559
560 options:
561
562 -T --template TEMPLATE display with template
563
560 (some details hidden, use --verbose to show
564 (some details hidden, use --verbose to show
561 complete help)
565 complete help)
562
566
General Comments 0
You need to be logged in to leave comments. Login now