comparison rhodecode/lib/vcs/backends/git/changeset.py @ 2232:49dc09e9f076 beta

Implements subrepos view inside filebrowser - fixes issue #434: Error when accessing files or changesets of a git repository with submodules
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 03 May 2012 23:15:47 +0200
parents 31ebf7010566
children 07fce1930417
comparison
equal deleted inserted replaced
2231:2cfaf199a5a7 2232:49dc09e9f076
8 from rhodecode.lib.vcs.exceptions import NodeDoesNotExistError 8 from rhodecode.lib.vcs.exceptions import NodeDoesNotExistError
9 from rhodecode.lib.vcs.exceptions import VCSError 9 from rhodecode.lib.vcs.exceptions import VCSError
10 from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError 10 from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError
11 from rhodecode.lib.vcs.exceptions import ImproperArchiveTypeError 11 from rhodecode.lib.vcs.exceptions import ImproperArchiveTypeError
12 from rhodecode.lib.vcs.backends.base import BaseChangeset 12 from rhodecode.lib.vcs.backends.base import BaseChangeset
13 from rhodecode.lib.vcs.nodes import FileNode, DirNode, NodeKind, RootNode, RemovedFileNode 13 from rhodecode.lib.vcs.nodes import FileNode, DirNode, NodeKind, RootNode, \
14 RemovedFileNode, SubModuleNode
14 from rhodecode.lib.vcs.utils import safe_unicode 15 from rhodecode.lib.vcs.utils import safe_unicode
15 from rhodecode.lib.vcs.utils import date_fromtimestamp 16 from rhodecode.lib.vcs.utils import date_fromtimestamp
16 from rhodecode.lib.vcs.utils.lazy import LazyProperty 17 from rhodecode.lib.vcs.utils.lazy import LazyProperty
17 18
18 19
327 path = self._fix_path(path) 328 path = self._fix_path(path)
328 id = self._get_id_for_path(path) 329 id = self._get_id_for_path(path)
329 tree = self.repository._repo[id] 330 tree = self.repository._repo[id]
330 dirnodes = [] 331 dirnodes = []
331 filenodes = [] 332 filenodes = []
333 als = self.repository.alias
332 for name, stat, id in tree.iteritems(): 334 for name, stat, id in tree.iteritems():
335 if objects.S_ISGITLINK(stat):
336 dirnodes.append(SubModuleNode(name, url=None, changeset=id,
337 alias=als))
338 continue
339
333 obj = self.repository._repo.get_object(id) 340 obj = self.repository._repo.get_object(id)
334 if path != '': 341 if path != '':
335 obj_path = '/'.join((path, name)) 342 obj_path = '/'.join((path, name))
336 else: 343 else:
337 obj_path = name 344 obj_path = name