Patchwork [1,of,8] paths: drop ui.status label from output of "hg paths name"

login
register
mail settings
Submitter Yuya Nishihara
Date Jan. 12, 2016, 10:33 p.m.
Message ID <c36fa631cb6ebfc15491.1452638039@waste.org>
Download mbox | patch
Permalink /patch/12711/
State Accepted
Commit c36fa631cb6ebfc1549127ab7f1d5cd542908283
Headers show

Comments

Yuya Nishihara - Jan. 12, 2016, 10:33 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1450011240 -32400
#      Sun Dec 13 21:54:00 2015 +0900
# Node ID c36fa631cb6ebfc1549127ab7f1d5cd542908283
# Parent  edd2615ad226c14f6904fc1738c3dc36431db223
paths: drop ui.status label from output of "hg paths name"

We just need to not print path if --quiet. ui.status label is unwanted.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5400,7 +5400,8 @@ 
     if search:
         for name, path in sorted(ui.paths.iteritems()):
             if name == search:
-                ui.status("%s\n" % util.hidepassword(path.rawloc))
+                if not ui.quiet:
+                    ui.write("%s\n" % util.hidepassword(path.rawloc))
                 return
         if not ui.quiet:
             ui.warn(_("not found!\n"))