incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [5/6] git commit: [#5120] ticket:297 Quote branch name in urls
Date Wed, 03 Apr 2013 22:20:04 GMT
[#5120] ticket:297 Quote branch name in urls


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/84e439c3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/84e439c3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/84e439c3

Branch: refs/heads/master
Commit: 84e439c37942807c425d578cf684f7e5be0c2afb
Parents: 464e9da
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Wed Mar 20 11:51:34 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Apr 3 22:16:57 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/repository.py   |    4 ++--
 Allura/allura/model/repository.py |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/84e439c3/Allura/allura/lib/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index d092377..79a6b33 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -122,7 +122,7 @@ class RepositoryApp(Application):
             links.append(SitemapEntry('Branches'))
             for b in self.repo.branches:
                 links.append(SitemapEntry(
-                        b.name, url('%sci/%s/tree/' % (c.app.url, b.name)),
+                        b.name, url('%sci/%s/tree/' % (c.app.url, quote(b.name, safe=''))),
                         small=b.count))
         if self.repo.repo_tags:
             links.append(SitemapEntry('Tags'))
@@ -130,7 +130,7 @@ class RepositoryApp(Application):
             for i, b in enumerate(self.repo.repo_tags):
                 if i < max_tags:
                     links.append(SitemapEntry(
-                            b.name, url('%sci/%s/tree/' % (c.app.url, b.name)),
+                            b.name, url('%sci/%s/tree/' % (c.app.url, quote(b.name, safe=''))),
                             small=b.count))
                 elif i == max_tags:
                     links.append(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/84e439c3/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 0c4dcbf..36781d6 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -12,6 +12,7 @@ from datetime import datetime
 from collections import defaultdict
 from itertools import izip
 from urlparse import urljoin
+from urllib import quote
 
 import tg
 from paste.deploy.converters import asbool
@@ -180,7 +181,7 @@ class RepositoryImplementation(object):
                     break
 
             if rev:
-                object_id = rev
+                object_id = quote(rev, safe='')
 
         return '%sci/%s/' % (self._repo.url(), object_id)
 


Mime
View raw message