author | Eric Sunshine
<sunshine@sunshineco.com> 2014-12-31 09:50:09 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2015-01-11 21:18:22 UTC |
parent | 93b161c23ea90f2dd9f7329a1afac51e23ebe3aa |
git-arr | +20 | -20 |
diff --git a/git-arr b/git-arr index 95455ec..66b49ba 100755 --- a/git-arr +++ b/git-arr @@ -214,13 +214,6 @@ def index(): def summary(repo): return dict(repo = repo) -@bottle.route('/r/<repo:repo>/b/<bname>/') -@bottle.route('/r/<repo:repo>/b/<bname>/<offset:int>.html') -@bottle.view('branch') -@with_utils -def branch(repo, bname, offset = 0): - return dict(repo = repo.new_in_branch(bname), offset = offset) - @bottle.route('/r/<repo:repo>/c/<cid:re:[0-9a-f]{5,40}>/') @bottle.view('commit') @with_utils @@ -231,19 +224,6 @@ def commit(repo, cid): return dict(repo = repo, c=c) -@bottle.route('/r/<repo:repo>/b/<bname>/t/') -@bottle.route('/r/<repo:repo>/b/<bname>/t/<dirname:path>/') -@bottle.view('tree') -@with_utils -def tree(repo, bname, dirname = ''): - if dirname and not dirname.endswith('/'): - dirname = dirname + '/' - - dirname = git.smstr.from_url(dirname) - - r = repo.new_in_branch(bname) - return dict(repo = r, tree = r.tree(), dirname = dirname) - @bottle.route('/r/<repo:repo>/b/<bname>/t/f=<fname:path>.html') @bottle.route('/r/<repo:repo>/b/<bname>/t/<dirname:path>/f=<fname:path>.html') @bottle.view('blob') @@ -264,6 +244,26 @@ def blob(repo, bname, fname, dirname = ''): return dict(repo = r, dirname = dirname, fname = fname, blob = content) +@bottle.route('/r/<repo:repo>/b/<bname>/t/') +@bottle.route('/r/<repo:repo>/b/<bname>/t/<dirname:path>/') +@bottle.view('tree') +@with_utils +def tree(repo, bname, dirname = ''): + if dirname and not dirname.endswith('/'): + dirname = dirname + '/' + + dirname = git.smstr.from_url(dirname) + + r = repo.new_in_branch(bname) + return dict(repo = r, tree = r.tree(), dirname = dirname) + +@bottle.route('/r/<repo:repo>/b/<bname>/') +@bottle.route('/r/<repo:repo>/b/<bname>/<offset:int>.html') +@bottle.view('branch') +@with_utils +def branch(repo, bname, offset = 0): + return dict(repo = repo.new_in_branch(bname), offset = offset) + @bottle.route('/static/<path:path>') def static(path): return bottle.static_file(path, root = static_path)