hg site extension
 
(Arne Babenhauserheide)
2012-11-20: FIX: Crashed if there were no prettify.js and prettify.css in the 0.2.2

FIX: Crashed if there were no prettify.js and prettify.css in the top level of the repo.

diff --git a/staticsite.py b/staticsite.py
--- a/staticsite.py
+++ b/staticsite.py
@@ -751,7 +751,7 @@ def parsesite(ui, repo, target, **opts):
             f.write(templates["printstyle"])
     # add google code prettify for source code highlighting
     for pretty in ["prettify.js", "prettify.css"]:
-        highlightingsrc = pretty
+        highlightingsrc = os.path.join(os.path.dirname(__file__), pretty)
         highlightingfile = os.path.join(target, pretty)
         if not os.path.isfile(highlightingfile) or not samefilecontent(highlightingsrc, highlightingfile):
             shutil.copyfile(highlightingsrc, highlightingfile)