summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
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 42001aa5..01bf7510 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):