From c2c9c271553775e9481e8a8f70ddc25bc3273eac Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 21 Feb 2007 00:17:17 -0800 Subject: misc forgot to -a --- bn_django/git_browse/views.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'bn_django/git_browse/views.py') diff --git a/bn_django/git_browse/views.py b/bn_django/git_browse/views.py index e27d949..f28aa76 100644 --- a/bn_django/git_browse/views.py +++ b/bn_django/git_browse/views.py @@ -66,7 +66,7 @@ def view_tree(request, repo, hash=None,branch=None): hash=hash, all_objs=tree_objs+blob_objs,)) -def view_log(request, repo, tree_hash=None, branch=None): +def view_log(request, repo, hash=None): therepo = get_object_or_404(Repository, slug=repo) (GITPREFIX, heads, tags) = therepo.scan() @@ -96,17 +96,30 @@ def view_log(request, repo, tree_hash=None, branch=None): return render_to_response('git_browse/full_log.html', dict(object=therepo, log_objs=log_objs,)) -def view_blob(request, repo, hash, branch=None): + +def view_blob(request, repo, hash): therepo = get_object_or_404(Repository, slug=repo) (GITPREFIX, heads, tags) = therepo.scan() - blob = Blob(hash=hash,repo=therepo) - blob.update() + b = Blob(id=hash,repo=therepo) + b.update() - return render_to_response('git_browse/obj.html', + return render_to_response('git_browse/blob.html', dict(object=therepo, - hash=blob.id, - size=blob.size, - contents=blob.contents)) + heads=heads, + tags=tags, + hash=b.id, + size=b.size, + contents=b.contents)) + +def view_commit(request, repo, hash): + therepo = get_object_or_404(Repository, slug=repo) + (GITPREFIX, heads, tags) = therepo.scan() + c = Commit(id=hash,repo=therepo) + c.update() + + return render_to_response('git_browse/commit.html', + dict(object=therepo, heads=heads, tags=tags, + commit=c)) def view_obj(request, repo, hash, branch=None): therepo = get_object_or_404(Repository, slug=repo) -- cgit v1.2.3