Patchwork [19,of,19,pager] version: enable pager if --verbose is specified

login
register
mail settings
Submitter Augie Fackler
Date Feb. 19, 2017, 11:13 p.m.
Message ID <2a054d530fa6763f0cf9.1487545990@imladris.local>
Download mbox | patch
Permalink /patch/18674/
State Accepted
Headers show

Comments

Augie Fackler - Feb. 19, 2017, 11:13 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1486440529 18000
#      Mon Feb 06 23:08:49 2017 -0500
# Node ID 2a054d530fa6763f0cf97a6e7193870ff8f2378b
# Parent  190fc3b8c22dff15bf147ea74cc507757327251e
version: enable pager if --verbose is specified

`hg version` output is very short without --verbose, but with
--verbose it tends to scroll off the user's screen.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5413,6 +5413,8 @@  def verify(ui, repo):
 @command('version', [] + formatteropts, norepo=True)
 def version_(ui, **opts):
     """output version and copyright information"""
+    if ui.verbose:
+        ui.pager('version')
     fm = ui.formatter("version", opts)
     fm.startitem()
     fm.write("ver", _("Mercurial Distributed SCM (version %s)\n"),