summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorEvangelos Foutras <evangelos@foutrelis.com>2011-09-01 18:56:05 +0200
committerDan McGee <dan@archlinux.org>2011-09-01 20:15:22 +0200
commit25a15d4c570823c6e28693d68d57b803dc2673fa (patch)
treec1324ba3d299464824f1ec769720d55324fa4c40 /packages
parent2ed3676f61af821e71a5c070e65419cd60906cb8 (diff)
downloadarchweb-25a15d4c570823c6e28693d68d57b803dc2673fa.tar.gz
archweb-25a15d4c570823c6e28693d68d57b803dc2673fa.tar.xz
Use package branches to display commit history
We now have one link pointing to the tree of /trunk, and another pointing to the log of /trunk. Both links specify a package branch. Signed-off-by: Evangelos Foutras <evangelos@foutrelis.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/templatetags/package_extras.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index 42001aa..01bf751 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -61,20 +61,13 @@ def userpkgs(user):
)
return ''
-def svn_link(package, svnpath):
- '''Helper function for the two real SVN link methods.'''
- parts = (package.repo.svn_root, package.pkgbase, svnpath)
- linkbase = "http://projects.archlinux.org/svntogit/%s.git/tree/%s/%s/"
- return linkbase % tuple(urlquote(part) for part in parts)
-
@register.simple_tag
-def svn_arch(package):
- repo = package.repo.name.lower()
- return svn_link(package, "repos/%s-%s" % (repo, package.arch.name))
-
-@register.simple_tag
-def svn_trunk(package):
- return svn_link(package, "trunk")
+def scm_link(package, operation):
+ parts = (package.repo.svn_root, operation, package.pkgbase)
+ linkbase = (
+ "http://projects.archlinux.org/svntogit/%s.git/%s/trunk?"
+ "h=packages/%s")
+ return linkbase % tuple(urlquote(part) for part in parts)
@register.simple_tag
def get_wiki_link(package):