diff options
author | bnewbold <bnewbold@manus.(none)> | 2007-02-18 18:47:15 -0800 |
---|---|---|
committer | bnewbold <bnewbold@manus.(none)> | 2007-02-18 18:47:15 -0800 |
commit | de7fbaadb211650a73c68509f8b87cb93effdd2a (patch) | |
tree | a1ae85534c4716b10f94379148cb62115c5a1918 /bn_django/git_browse/views.py | |
parent | 0c7c01d4ff1635cb7f04bed3d099b30b967f44bd (diff) | |
download | bnewnet-de7fbaadb211650a73c68509f8b87cb93effdd2a.tar.gz bnewnet-de7fbaadb211650a73c68509f8b87cb93effdd2a.zip |
removed knowledge directory, filled in front page, continued git_browse
Diffstat (limited to 'bn_django/git_browse/views.py')
-rw-r--r-- | bn_django/git_browse/views.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bn_django/git_browse/views.py b/bn_django/git_browse/views.py index 9e3ba90..c8a7a40 100644 --- a/bn_django/git_browse/views.py +++ b/bn_django/git_browse/views.py @@ -27,20 +27,24 @@ def repo_info(request, repo,branch=None): GITPREFIX = 'cd ' + GITBROWSE_BASE + therepo.slug + '; ' + GITCOMMAND + ' --git-dir=' + GITBROWSE_BASE + therepo.slug + '/.git ' shortlog = commands.getoutput(GITPREFIX + ' log | ' + GITCOMMAND + '-shortlog') + filelist = commands.getoutput(GITPREFIX + ' ls-files') return render_to_response('git_browse/repository_info.html', dict(object=therepo, + filelist=filelist, shortlog=shortlog,)) -def view_tree(request, repo, tree_hash=None,branch=None): +def view_tree(request, repo, hash=None,branch=None): therepo = get_object_or_404(Repository, slug=repo) GITPREFIX = 'cd ' + GITBROWSE_BASE + therepo.slug + '; ' + GITCOMMAND + ' --git-dir=' + GITBROWSE_BASE + therepo.slug + '/.git ' - head_ref = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat HEAD') - head_ref = head_ref.split()[1] - head = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat ' + head_ref) - tree_ls = commands.getoutput(GITPREFIX + ' ls-tree ' + head) + if(hash == None): + head_ref = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat HEAD') + head_ref = head_ref.split()[1] + hash = commands.getoutput('cd ' + GITBROWSE_BASE + therepo.slug +'/.git; cat ' + head_ref) + + tree_ls = commands.getoutput(GITPREFIX + ' ls-tree ' + hash) tree_objs = list() blob_objs = list() for line in tree_ls.splitlines(): @@ -56,6 +60,7 @@ def view_tree(request, repo, tree_hash=None,branch=None): dict(object=therepo, blob_objs=blob_objs, tree_objs=tree_objs, + hash=hash, all_objs=tree_objs+blob_objs,)) def view_log(request, repo, tree_hash=None, branch=None): |