diff --git a/pylons_app/config/middleware.py b/pylons_app/config/middleware.py
--- a/pylons_app/config/middleware.py
+++ b/pylons_app/config/middleware.py
@@ -12,7 +12,7 @@ from routes.middleware import RoutesMidd
from pylons_app.config.environment import load_environment
-def make_app(global_conf, full_stack = True, **app_conf):
+def make_app(global_conf, full_stack=True, **app_conf):
"""Create a Pylons WSGI application and return it
``global_conf``
diff --git a/pylons_app/controllers/hg.py b/pylons_app/controllers/hg.py
--- a/pylons_app/controllers/hg.py
+++ b/pylons_app/controllers/hg.py
@@ -10,7 +10,7 @@ import os
from mercurial import ui, hg
from mercurial.error import RepoError
from ConfigParser import ConfigParser
-
+import encodings
log = logging.getLogger(__name__)
class HgController(BaseController):
@@ -18,24 +18,28 @@ class HgController(BaseController):
def __before__(self):
c.repos_prefix = 'etelko'
-
def view(self, *args, **kwargs):
response = g.hgapp(request.environ, self.start_response)
- #for mercurial protocols we can't wrap into mako
- if request.environ['HTTP_ACCEPT'].find("mercurial") >= 0:
+ #for mercurial protocols and raw files we can't wrap into mako
+ if request.environ['HTTP_ACCEPT'].find("mercurial") != -1 or \
+ request.environ['PATH_INFO'].find('raw-file') != -1:
return response
- #wrap the murcurial response in a mako template.
- template = Template("".join(response),
- lookup = request.environ['pylons.pylons']\
+ tmpl = ''.join(response)
+
+ template = Template(tmpl, lookup=request.environ['pylons.pylons']\
.config['pylons.g'].mako_lookup)
- return template.render(g = g, c = c, session = session, h = h)
+ return template.render(g=g, c=c, session=session, h=h)
def manage_hgrc(self):
pass
+ def hgrc(self, dirname):
+ filename = os.path.join(dirname, '.hg', 'hgrc')
+ return filename
+
def add_repo(self, new_repo):
c.staticurl = g.statics
diff --git a/pylons_app/lib/app_globals.py b/pylons_app/lib/app_globals.py
--- a/pylons_app/lib/app_globals.py
+++ b/pylons_app/lib/app_globals.py
@@ -38,7 +38,16 @@ class Globals(object):
baseui.setconfig('web', k, v)
#magic trick to make our custom template dir working
templater.path.append(cfg.get('web', 'templates', None))
- hgwebapp = hgwebdir(paths, baseui = baseui)
+
+ #baseui.setconfig('web', 'description', '')
+ #baseui.setconfig('web', 'name', '')
+ #baseui.setconfig('web', 'contact', '')
+ #baseui.setconfig('web', 'allow_archive', '')
+ #baseui.setconfig('web', 'style', 'monoblue_plain')
+ #baseui.setconfig('web', 'baseurl', '')
+ #baseui.setconfig('web', 'staticurl', '')
+
+ hgwebapp = hgwebdir(paths, baseui=baseui)
return hgwebapp
diff --git a/pylons_app/templates/monoblue_custom/branches.tmpl b/pylons_app/templates/monoblue_custom/branches.tmpl
--- a/pylons_app/templates/monoblue_custom/branches.tmpl
+++ b/pylons_app/templates/monoblue_custom/branches.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: Branches
diff --git a/pylons_app/templates/monoblue_custom/changelog.tmpl b/pylons_app/templates/monoblue_custom/changelog.tmpl
--- a/pylons_app/templates/monoblue_custom/changelog.tmpl
+++ b/pylons_app/templates/monoblue_custom/changelog.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: changelog
diff --git a/pylons_app/templates/monoblue_custom/changelogentry.tmpl b/pylons_app/templates/monoblue_custom/changelogentry.tmpl
--- a/pylons_app/templates/monoblue_custom/changelogentry.tmpl
+++ b/pylons_app/templates/monoblue_custom/changelogentry.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
- {date|age}
diff --git a/pylons_app/templates/monoblue_custom/changeset.tmpl b/pylons_app/templates/monoblue_custom/changeset.tmpl
--- a/pylons_app/templates/monoblue_custom/changeset.tmpl
+++ b/pylons_app/templates/monoblue_custom/changeset.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: changeset {rev}:{node|short}
@@ -57,7 +58,9 @@
- {diff}
+ <%text filter="n">
+ {diff}
+ %text>
{footer}
diff --git a/pylons_app/templates/monoblue_custom/error.tmpl b/pylons_app/templates/monoblue_custom/error.tmpl
--- a/pylons_app/templates/monoblue_custom/error.tmpl
+++ b/pylons_app/templates/monoblue_custom/error.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: Error
diff --git a/pylons_app/templates/monoblue_custom/fileannotate.tmpl b/pylons_app/templates/monoblue_custom/fileannotate.tmpl
--- a/pylons_app/templates/monoblue_custom/fileannotate.tmpl
+++ b/pylons_app/templates/monoblue_custom/fileannotate.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: {file|escape}@{node|short} (annotated)
diff --git a/pylons_app/templates/monoblue_custom/filediff.tmpl b/pylons_app/templates/monoblue_custom/filediff.tmpl
--- a/pylons_app/templates/monoblue_custom/filediff.tmpl
+++ b/pylons_app/templates/monoblue_custom/filediff.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: diff {file|escape}
@@ -48,7 +49,9 @@
- {diff}
+ <%text filter="n">
+ {diff}
+ %text>
{footer}
diff --git a/pylons_app/templates/monoblue_custom/filelog.tmpl b/pylons_app/templates/monoblue_custom/filelog.tmpl
--- a/pylons_app/templates/monoblue_custom/filelog.tmpl
+++ b/pylons_app/templates/monoblue_custom/filelog.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: File revisions
diff --git a/pylons_app/templates/monoblue_custom/filerevision.tmpl b/pylons_app/templates/monoblue_custom/filerevision.tmpl
--- a/pylons_app/templates/monoblue_custom/filerevision.tmpl
+++ b/pylons_app/templates/monoblue_custom/filerevision.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-
{header}
{repo|escape}: {file|escape}@{node|short}
@@ -57,7 +58,9 @@
{desc|strip|escape|addbreaks|nonempty}
- {text%fileline}
+ <%text filter="n">
+ {text%fileline}
+ %text>
{footer}
diff --git a/pylons_app/templates/monoblue_custom/footer.tmpl b/pylons_app/templates/monoblue_custom/footer.tmpl
--- a/pylons_app/templates/monoblue_custom/footer.tmpl
+++ b/pylons_app/templates/monoblue_custom/footer.tmpl
@@ -1,3 +1,4 @@
+## -*- coding: utf-8 -*-