Patchwork hgweb: make help verbose again (issue3899)

login
register
mail settings
Submitter Alexander Plavin
Date April 22, 2013, 8:53 a.m.
Message ID <535ef0450d4d28784def.1366620836@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1469/
State Superseded
Commit 1e433b5457fdfa290752a87f6f2b1e9de8e97c19
Headers show

Comments

Alexander Plavin - April 22, 2013, 8:53 a.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1366619276 -14400
#      Mon Apr 22 12:27:56 2013 +0400
# Branch stable
# Node ID 535ef0450d4d28784def15c4aca53f64260cc6a4
# Parent  292cd385856d98bacb2c3086f8897bc660c2beea
hgweb: make help verbose again (issue3899)

Due to regression introduced in f5db3092790f, help in hgweb
was rendered in non-verbose form (issue3899)
Matt Mackall - April 22, 2013, 5:05 p.m.
On Mon, 2013-04-22 at 11:48 -0500, Kevin Bullock wrote:
> On Apr 22, 2013, at 3:53 AM, Alexander Plavin wrote:
> 
> > # HG changeset patch
> > # User Alexander Plavin <me@aplavin.ru>
> > # Date 1366619276 -14400
> > #      Mon Apr 22 12:27:56 2013 +0400
> > # Branch stable
> > # Node ID 535ef0450d4d28784def15c4aca53f64260cc6a4
> > # Parent  292cd385856d98bacb2c3086f8897bc660c2beea
> > hgweb: make help verbose again (issue3899)
> > 
> > Due to regression introduced in f5db3092790f, help in hgweb
> > was rendered in non-verbose form (issue3899)
> 
> If this was a regression, how did an existing test case detect the fix but not the regression?

Because someone didn't notice the example disappearing when we switched
from plain text to HTML:

http://www.selenic.com/hg/rev/f5db3092790f

Patch

diff -r 292cd385856d -r 535ef0450d4d mercurial/templater.py
--- a/mercurial/templater.py	Thu Apr 18 23:46:26 2013 -0500
+++ b/mercurial/templater.py	Mon Apr 22 12:27:56 2013 +0400
@@ -299,7 +299,7 @@ 
     text = stringify(args[0][0](context, mapping, args[0][1]))
     style = stringify(args[1][0](context, mapping, args[1][1]))
 
-    return minirst.format(text, style=style)
+    return minirst.format(text, style=style, keep=['verbose'])
 
 methods = {
     "string": lambda e, c: (runstring, e[1]),
diff -r 292cd385856d -r 535ef0450d4d tests/test-help.t
--- a/tests/test-help.t	Thu Apr 18 23:46:26 2013 -0500
+++ b/tests/test-help.t	Mon Apr 22 12:27:56 2013 +0400
@@ -1525,6 +1525,20 @@ 
   If no names are given, add all files to the repository.
   </p>
   <p>
+  An example showing how new (unknown) files are added
+  automatically by &quot;hg add&quot;:
+  </p>
+  <pre>
+  $ ls
+  foo.c
+  $ hg status
+  ? foo.c
+  $ hg add
+  adding foo.c
+  $ hg status
+  A foo.c
+  </pre>
+  <p>
   Returns 0 if all files are successfully added.
   </p>
   <p>
@@ -1677,6 +1691,50 @@ 
   files, see &quot;hg forget&quot;.
   </p>
   <p>
+  -A/--after can be used to remove only files that have already
+  been deleted, -f/--force can be used to force deletion, and -Af
+  can be used to remove files from the next revision without
+  deleting them from the working directory.
+  </p>
+  <p>
+  The following table details the behavior of remove for different
+  file states (columns) and option combinations (rows). The file
+  states are Added [A], Clean [C], Modified [M] and Missing [!]
+  (as reported by &quot;hg status&quot;). The actions are Warn, Remove
+  (from branch) and Delete (from disk):
+  </p>
+  <table>
+  <tr><td></td>
+  <td>A</td>
+  <td>C</td>
+  <td>M</td>
+  <td>!</td></tr>
+  <tr><td>none</td>
+  <td>W</td>
+  <td>RD</td>
+  <td>W</td>
+  <td>R</td></tr>
+  <tr><td>-f</td>
+  <td>R</td>
+  <td>RD</td>
+  <td>RD</td>
+  <td>R</td></tr>
+  <tr><td>-A</td>
+  <td>W</td>
+  <td>W</td>
+  <td>W</td>
+  <td>R</td></tr>
+  <tr><td>-Af</td>
+  <td>R</td>
+  <td>R</td>
+  <td>R</td>
+  <td>R</td></tr>
+  </table>
+  <p>
+  Note that remove never deletes files in Added [A] state from the
+  working directory, not even if option --force is specified.
+  </p>
+  <p>
   Returns 0 on success, 1 if any warnings encountered.
   </p>
   <p>