2
# Copyright (C) 2006 Robey Pointer <robey@lag.net>
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
from cherrypy import HTTPRedirect, session
27
from loggerhead.history import History
28
from loggerhead import util
32
while path.endswith('/'):
34
path = posixpath.dirname(path)
38
class InventoryUI (object):
40
@turbogears.expose(html='loggerhead.templates.inventory')
41
def default(self, *args, **kw):
42
h = History.from_folder(turbogears.config.get('loggerhead.folder'))
49
rev = h.get_revision(revid)
50
inv = h.get_inventory(revid)
52
raise HTTPRedirect(turbogears.url('/changes'))
54
path = kw.get('path', None)
59
file_id = inv.path2id(path)
62
('top', turbogears.url('/changes')),
63
('revision', turbogears.url([ '/revision', revid ])),
64
('history', turbogears.url([ '/changes', revid ])),
68
'branch_name': turbogears.config.get('loggerhead.branch_name'),
72
'change': h.get_change(revid),
74
'updir': dirname(path),
75
'filelist': h.get_filelist(inv, path),
77
'scan_url': '/revision',
79
'posixpath': posixpath,