Bug 1402154: Allow specifying an absolute path to mount sphinx docs. r=gps
authorTom Prince <mozilla@hocat.ca>
Mon, 20 Nov 2017 11:56:52 -0700
changeset 701821 d6a95c825821c9611f2224914b0e9c04ae0ad482
parent 701820 bc89bf67b38d97cfe57f714f8b0c29c535670ced
child 701822 49346c4e104631cea119dac4a219d4684d167956
push id90298
push userbmo:bpostelnicu@mozilla.com
push dateWed, 22 Nov 2017 10:54:01 +0000
reviewersgps
bugs1402154
milestone59.0a1
Bug 1402154: Allow specifying an absolute path to mount sphinx docs. r=gps MozReview-Commit-ID: 8OLCtwg8zXc
tools/docs/moztreedocs/__init__.py
--- a/tools/docs/moztreedocs/__init__.py
+++ b/tools/docs/moztreedocs/__init__.py
@@ -40,18 +40,21 @@ class SphinxManager(object):
         config = fakeconfig(self._topsrcdir)
         reader = BuildReader(config)
 
         for path, name, key, value in reader.find_sphinx_variables():
             reldir = os.path.dirname(path)
 
             if name == 'SPHINX_TREES':
                 assert key
-                self.add_tree(os.path.join(reldir, value),
-                    os.path.join(reldir, key))
+                if key.startswith('/'):
+                    key = key[1:]
+                else:
+                    key = os.path.join(reldir, key)
+                self.add_tree(os.path.join(reldir, value), key)
 
             if name == 'SPHINX_PYTHON_PACKAGE_DIRS':
                 self.add_python_package_dir(os.path.join(reldir, value))
 
     def add_tree(self, source_dir, dest_dir):
         """Add a directory from where docs should be sourced."""
         if dest_dir in self._trees:
             raise Exception('%s has already been registered as a destination.'