Rev 5715: (vila) Activate the sphinx tests again. (Vincent Ladeuil) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Mar 11 15:19:08 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5715 [merge]
revision-id: pqm at pqm.ubuntu.com-20110311151905-7pxltfhwqqhgwa5c
parent: pqm at pqm.ubuntu.com-20110311120534-mzt6xi5s7onrlrio
parent: v.ladeuil+lp at free.fr-20110311122410-ury8y8n19zr1m4ru
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-03-11 15:19:05 +0000
message:
  (vila) Activate the sphinx tests again. (Vincent Ladeuil)
modified:
  bzrlib/doc_generate/writers/texinfo.py texinfo_writer.py-20100428165123-pgxf99nm4uc2iux4-1
  bzrlib/tests/doc_generate/builders/test_texinfo.py test_texinfo.py-20100429153416-rrbyt0aljyz1mgl8-1
  bzrlib/tests/doc_generate/writers/test_texinfo.py test_texinfo.py-20100706132149-5xascqycp14tbyci-1
=== modified file 'bzrlib/doc_generate/writers/texinfo.py'
--- a/bzrlib/doc_generate/writers/texinfo.py	2010-07-21 08:07:14 +0000
+++ b/bzrlib/doc_generate/writers/texinfo.py	2011-03-11 12:24:10 +0000
@@ -123,6 +123,17 @@
     def depart_topic(self, node):
         pass
 
+    def visit_compound(self, node):
+        # compound is new in sphinx >= 1.0 and just add a optional layer so we
+        # relay the text to the parent when it occurs. This may requires a
+        # cleaner approach once we settle on which sphinx versions we want to
+        # support.
+        set_item_list_collector(node, 'text')
+
+    def depart_compound(self, node):
+        text = ''.join(node['text'])
+        node.parent.collect_text(text)
+
     def visit_paragraph(self, node):
         set_item_list_collector(node, 'text')
 
@@ -143,9 +154,10 @@
         # FIXME: Using a different visitor specific to toctree may be a better
         # design and makes code clearer. -- vila 20100708
         if node.has_key('toctree'):
-            node.parent.collect_text('@menu\n')
-            node.parent.collect_text(''.join(node['text']))
-            node.parent.collect_text('@end menu\n')
+            if node['text']:
+                node.parent.collect_text('@menu\n')
+                node.parent.collect_text(''.join(node['text']))
+                node.parent.collect_text('@end menu\n')
             self.in_toctree = False
         elif self.in_toctree:
             # * FIRST-ENTRY-NAME:(FILENAME)NODENAME.     DESCRIPTION

=== modified file 'bzrlib/tests/doc_generate/builders/test_texinfo.py'
--- a/bzrlib/tests/doc_generate/builders/test_texinfo.py	2011-01-10 22:20:12 +0000
+++ b/bzrlib/tests/doc_generate/builders/test_texinfo.py	2011-03-11 11:33:33 +0000
@@ -43,8 +43,6 @@
 class TestFileProduction(test_dg.TestSphinx):
 
     def test_files_generated(self):
-        if self.sphinx_version() >= (1, 0):
-            raise tests.TestSkipped('Not compatible with sphinx >= 1.0')
         self.build_tree_contents(
             [('index.txt', """
 Table of Contents

=== modified file 'bzrlib/tests/doc_generate/writers/test_texinfo.py'
--- a/bzrlib/tests/doc_generate/writers/test_texinfo.py	2011-01-10 22:20:12 +0000
+++ b/bzrlib/tests/doc_generate/writers/test_texinfo.py	2011-03-11 11:33:33 +0000
@@ -177,8 +177,6 @@
 class TestTocTreeGeneration(test_dg.TestSphinx):
 
     def test_toctree(self):
-        if self.sphinx_version() >= (1, 0):
-            raise tests.TestSkipped('Not compatible with sphinx >= 1.0')
         self.build_tree_contents(
             [('index.txt', """
 Table of Contents
@@ -235,6 +233,29 @@
 """,
                              'bzr-0.0.8.texi')
 
+    def test_toctree_empty(self):
+        self.build_tree_contents(
+            [('index.txt', """
+Table of Contents
+=================
+
+.. toctree::
+   :maxdepth: 1
+""")])
+        app, out, err = self.make_sphinx()
+        self.build(app)
+        self.assertFileEqual("""\
+This file has been converted using a beta rst->texinfo converter. 
+Most of the info links are currently bogus, don't report bugs about them,
+this is currently worked on.
+ at node Top
+ at top Placeholder
+ at node table-of-contents
+ at chapter Table of Contents
+""",
+                             'index.texi')
+
+
 class TestSections(test_dg.TestSphinx):
 
     def test_sections(self):




More information about the bazaar-commits mailing list