Commits

Dan Villiom Podlaski Christiansen committed cb3c2e8

Fix tests.

  • Participants
  • Parent commits adac15e

Comments (0)

Files changed (2)

File highlight-docutils.diff

 # HG changeset patch
+# Parent 308c5ccce31774c6a5ba0ec58334dbeeefc4f8fc
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
 highlight: use docutils for generating help if possible
 
  testedwith = 'internal'
  
  def filerevision_highlight(orig, web, tmpl, fctx):
-@@ -48,6 +52,23 @@ def annotate_highlight(orig, web, req, t
+@@ -48,6 +52,24 @@ def annotate_highlight(orig, web, req, t
          highlight.pygmentize('annotateline', fctx, style, tmpl)
      return orig(web, req, tmpl)
  
 +    if opts.get('style') == 'html':
 +        try:
 +            return rst.publish(args[0])
-+        except:
++        except Exception:
++            # silently fallback to minirst
 +            tb = traceback.format_exc()
 +
 +            return '\n'.join(['<!--',
  def generate_css(web, req, tmpl):
      pg_style = web.config('web', 'pygments_style', 'colorful')
      fmter = highlight.HtmlFormatter(style = pg_style)
-@@ -60,5 +81,6 @@ def extsetup():
+@@ -60,5 +82,6 @@ def extsetup():
      extensions.wrapfunction(webcommands, '_filerevision',
                              filerevision_highlight)
      extensions.wrapfunction(webcommands, 'annotate', annotate_highlight)

File minirst-html.diff

 # HG changeset patch
+# Parent ee07ef5dbabd59c8baceeafa13c0712fcdceef90
 # User Dan Villiom Podlaski Christiansen  <danchr@gmail.com>
 minirst: HTML formatter tweaks
 
 - output table rows on distinct lines
 - don't make the first row a table header
 
-
 diff --git a/mercurial/minirst.py b/mercurial/minirst.py
 --- a/mercurial/minirst.py
 +++ b/mercurial/minirst.py
              out.append('<table>\n%s</table>\n' % ''.join(t))
          elif btype == 'definition':
              openlist('dl', level)
+diff --git a/tests/test-minirst.py.out b/tests/test-minirst.py.out
+--- a/tests/test-minirst.py.out
++++ b/tests/test-minirst.py.out
+@@ -758,9 +758,15 @@ 30 column format:
+ html format:
+ ----------------------------------------------------------------------
+ <table>
+- <tr><th>a</th><th>b</th><th>c</th></tr>
+- <tr><td>1</td><td>2</td><td>3</td></tr>
+- <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
++ <tr><td>a</td>
++<td>b</td>
++<td>c</td></tr>
++ <tr><td>1</td>
++<td>2</td>
++<td>3</td></tr>
++ <tr><td>foo</td>
++<td>bar</td>
++<td>baz this list is very very very long man</td></tr>
+ </table>
+ ----------------------------------------------------------------------
+