summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvangelos Foutras <evangelos@foutrelis.com>2011-09-01 19:56:05 +0300
committerDan McGee <dan@archlinux.org>2011-09-01 13:15:22 -0500
commit25a15d4c570823c6e28693d68d57b803dc2673fa (patch)
treec1324ba3d299464824f1ec769720d55324fa4c40
parent2ed3676f61af821e71a5c070e65419cd60906cb8 (diff)
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>
-rw-r--r--packages/templatetags/package_extras.py19
-rw-r--r--templates/packages/details.html6
2 files changed, 10 insertions, 15 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):
diff --git a/templates/packages/details.html b/templates/packages/details.html
index afbf9103..fa8283ed 100644
--- a/templates/packages/details.html
+++ b/templates/packages/details.html
@@ -16,8 +16,10 @@
<div id="actionlist">
<h4>Package Actions</h4>
<ul class="small">
- <li><a href="{% svn_arch pkg %}" title="View SVN entries in the {{pkg.repo|lower}}-{{pkg.arch}} branch">SVN Entries ({{pkg.repo|lower}}-{{pkg.arch}})</a></li>
- <li><a href="{% svn_trunk pkg %}" title="View SVN entries on trunk">SVN Entries (trunk)</a></li>
+ <li>
+ <a href="{% scm_link pkg 'tree' %}" title="View source files for {{ pkg.pkgname }}">Source Files</a> /
+ <a href="{% scm_link pkg 'log' %}" title="View changes for {{ pkg.pkgname }}">View Changes</a>
+ </li>
<li><a href="{% get_wiki_link pkg %}" title="Search wiki for {{ pkg.pkgname }}">Search Wiki</a></li>
<li><a href="{% bugs_list pkg %}" title="View existing bug tickets for {{ pkg.pkgname }}">Bug Reports</a></li>
<li><a href="{% bug_report pkg %}" title="Report bug for {{ pkg.pkgname }}">Report a Bug</a></li>