Patchwork [v2] show: make template option actually show up in help

login
register
mail settings
Submitter Ryan McElroy
Date April 13, 2017, 10:45 a.m.
Message ID <7b40e2f960e9b53ce3e9.1492080343@devbig314.prn1.facebook.com>
Download mbox | patch
Permalink /patch/20160/
State Accepted
Headers show

Comments

Ryan McElroy - April 13, 2017, 10:45 a.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@fb.com>
# Date 1492078673 25200
#      Thu Apr 13 03:17:53 2017 -0700
# Node ID 7b40e2f960e9b53ce3e9f0ae3a6fe22b4f921297
# Parent  3c77f03f16b386940c60af36d6a3ad83bee37ad4
show: make template option actually show up in help

Previously, the --template/-T option didn't show up in help because it's marked
as experimental. It's not really experimental for show, and its quite important
for show's funcationality, so let's make sure it always shows up.
Yuya Nishihara - April 13, 2017, 12:28 p.m.
On Thu, 13 Apr 2017 03:45:43 -0700, Ryan McElroy wrote:
> # HG changeset patch
> # User Ryan McElroy <rmcelroy@fb.com>
> # Date 1492078673 25200
> #      Thu Apr 13 03:17:53 2017 -0700
> # Node ID 7b40e2f960e9b53ce3e9f0ae3a6fe22b4f921297
> # Parent  3c77f03f16b386940c60af36d6a3ad83bee37ad4
> show: make template option actually show up in help

Queued this, thanks!

Patch

diff --git a/hgext/show.py b/hgext/show.py
--- a/hgext/show.py
+++ b/hgext/show.py
@@ -17,7 +17,6 @@  from __future__ import absolute_import
 from mercurial.i18n import _
 from mercurial import (
     cmdutil,
-    commands,
     error,
     formatter,
     pycompat,
@@ -53,7 +52,14 @@  class showcmdfunc(registrar._funcregistr
 
 showview = showcmdfunc()
 
-@command('show', commands.formatteropts, _('VIEW'))
+@command('show', [
+    # TODO: Switch this template flag to use commands.formatteropts if
+    # 'hg show' becomes stable before --template/-T is stable. For now,
+    # we are putting it here without the '(EXPERIMENTAL)' flag because it
+    # is an important part of the 'hg show' user experience and the entire
+    # 'hg show' experience is experimental.
+    ('T', 'template', '', ('display with template'), _('TEMPLATE')),
+    ], _('VIEW'))
 def show(ui, repo, view=None, template=None):
     """show various repository information
 
diff --git a/tests/test-show.t b/tests/test-show.t
--- a/tests/test-show.t
+++ b/tests/test-show.t
@@ -43,6 +43,8 @@  No arguments shows available views
   
   options:
   
+   -T --template TEMPLATE display with template
+  
   (some details hidden, use --verbose to show complete help)
 
 Unknown view prints error