<div dir="ltr">It looks like Yuya is sending an new version of this series, so I'll drop the patches I queued from the clowncopter.<br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 12, 2016 at 12:44 PM Matt Mackall <<a href="mailto:mpm@selenic.com">mpm@selenic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, 2016-01-09 at 18:45 +0900, Yuya Nishihara wrote:<br>
> # HG changeset patch<br>
> # User Yuya Nishihara <<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>><br>
> # Date 1450011240 -32400<br>
> #      Sun Dec 13 21:54:00 2015 +0900<br>
> # Node ID 16099841acaa4fa42dffa994b9ac9e16c89a43be<br>
> # Parent  0db7943a4e1f843814865dc1b2cb22b994acc74f<br>
> paths: drop ui.status label from output of "hg paths name"<br>
><br>
> We just need to not print path if --quiet. ui.status label is unwanted.<br>
<br>
Why?<br>
<br>
My guess is: we don't have a problem with the label but the formatter doesn't<br>
support "status" and "note" output levels. That's probably a weakness of the<br>
formatter API. Yep:<br>
<br>
$ hgrep condwrite<br>
mercurial/commands.py:            fm.condwrite(not ui.quiet, 'rev node', pad + '<br>
%d:%s',<br>
mercurial/commands.py:        fm.condwrite(not ui.quiet, 'rev node', fmt, rev,<br>
hexfunc(ctx.node()),<br>
mercurial/commands.py:        fm.condwrite(ui.verbose and extsource, 'source',<br>
mercurial/commands.py:        fm.condwrite(ui.verbose and exttestedwith,<br>
'testedwith',<br>
mercurial/commands.py:        fm.condwrite(ui.verbose and extbuglink, 'buglink',<br>
mercurial/commands.py:        fm.condwrite(ui.debugflag, 'hash', '%s ',<br>
hex(mf[f]))<br>
mercurial/commands.py:        fm.condwrite(ui.verbose, 'mode type', '%s %1s ',<br>
mode[fl], char[fl])<br>
mercurial/commands.py:            fm.condwrite(not nostatus, 'status', '%s ',<br>
ms[f].upper(), label=l)<br>
mercurial/commands.py:                fm.condwrite(showchar, 'status', '%s ',<br>
char, label=label)<br>
mercurial/commands.py:        fm.condwrite(not ui.quiet, 'rev node', fmt,<br>
mercurial/commands.py:        fm.condwrite(ui.verbose and tagtype, 'type', '<br>
%s',<br>
<br>
Most of the use of fm.condwrite is to deal with the lack of ui.status/ui.note<br>
equivalents.<br>
<br>
We should probably actually have these components available to the templater<br>
regardless of verbosity level (though debug is a different matter, because it's<br>
usually expensive). We should probably do something like this:<br>
<br>
diff -r c36fa631cb6e mercurial/formatter.py<br>
--- a/mercurial/formatter.py    Sun Dec 13 21:54:00 2015 +0900<br>
+++ b/mercurial/formatter.py    Tue Jan 12 14:45:00 2016 -0600<br>
@@ -51,6 +51,12 @@<br>
         fieldkeys = fields.split()<br>
         assert len(fieldkeys) == len(fielddata)<br>
         self._item.update(zip(fieldkeys, fielddata))<br>
+    def status(self, fields, deftext, *fielddata, **opts):<br>
+        '''do status-level text output while assigning data to item'''<br>
+        self.write(fields, deftext, *fielddata, **opts)<br>
+    def note(self, fields, deftext, *fielddata, **opts):<br>
+        '''do verbose text output while assigning data to item'''<br>
+        self.write(fields, deftext, *fielddata, **opts)<br>
     def condwrite(self, cond, fields, deftext, *fielddata, **opts):<br>
         '''do conditional write (primarily for plain formatter)'''<br>
         fieldkeys = fields.split()<br>
@@ -80,6 +86,10 @@<br>
         pass<br>
     def write(self, fields, deftext, *fielddata, **opts):<br>
         self._ui.write(deftext % fielddata, **opts)<br>
+    def status(self, fields, deftext, *fielddata, **opts):<br>
+        self._ui.status(deftext % fielddata, **opts)<br>
+    def note(self, fields, deftext, *fielddata, **opts):<br>
+        self._ui.note(deftext % fielddata, **opts)<br>
     def condwrite(self, cond, fields, deftext, *fielddata, **opts):<br>
         '''do conditional write'''<br>
         if cond:<br>
-- <br>
Mathematics is the supreme nostalgia of our time.<br>
<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com" target="_blank">Mercurial-devel@selenic.com</a><br>
<a href="https://selenic.com/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://selenic.com/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div></div>