Commits

Anonymous committed 062ebaf

- Only show page source link if hgweb_url was given

  • Participants
  • Parent commits fd1d6ec

Comments (0)

Files changed (1)

         # XXX: HTTP experts: How do we short-circuit if the client's side is
         # up-to-date?
         if splitext(file_path)[1] == config.rst_extension:
-            # Add a link to the source text.
-            data += dedent("""\
+            if config.hgweb_url:
+                # Add a link to the source text.
+                data += dedent("""\
 
-                .. admonition:: Page source
+                    .. admonition:: Page source
 
-                    `<%s/file/%s/%s>`__.
-                """ % (config.hgweb_url, revision, file_path))
+                        `<%s/file/%s/%s>`__.
+                    """ % (config.hgweb_url, revision, file_path))
             hash = sha(data).hexdigest()
             # Look in cache first.
             cache_filename = join(config.cache_dir, '%s.html' % hash)