Commits

Joe Heck  committed d7fe153

fixing a tuple issue with templater returns in viewing the summary page.
putting back in the /u/ in the repos path which seems to be important for
processing viewings of the repo

  • Participants
  • Parent commits e887523

Comments (0)

Files changed (1)

File repos/views.py

     tip_hex = hexlify(hgrepo.changelog.tip())[:12]
 
     real_url = FreeHGConf.objects.all()[0]
-    clone_url = real_url.clone_url + "/" + username + "/" + reponame 
-    push_url = real_url.push_url + "/" + username + "/" + reponame 
+    clone_url = real_url.clone_url + "/u/" + username + "/" + reponame 
+    push_url = real_url.push_url + "/u/" + username + "/" + reponame 
 
     from mercurial.hgweb.hgweb_mod import hgweb
     from mercurial import templater
     def motd(**map):
         yield web.config("web", "motd", "")
     templatepath = settings.HG_TEMPLATE_PATH
-    mapfile = mapfile = templater.stylemap("freehg", templatepath)
+    mapfile = templater.stylemap("freehg", templatepath)[1]
+    # docs for templater.stylemap says it returns a path, but it really returns a tuple
+    # with the path as the second element. Added the [1] to discard the style name.
     tmpl = templater.templater(mapfile, common_filters,
                                      defaults={"url": clone_url,
                                                "staticurl": "/static/",
                                                "motd": motd,
                                                "rawfileheader": "FIXME",
                                                "sessionvars": tuple(),
-                                               })
+                                               })                                               
     from cStringIO import StringIO
     content = []
     def write(*things):
                 # FIXME I have a feeling that this isn't correct.
                 content.append(str(thing).decode('utf8'))
     write(summary(web, req=None, tmpl=tmpl))
-
     return render_to_response('repos/summary.html',
         dict(
             repo=repo,