diff 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
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/git/changeset.py	Thu May 03 21:17:30 2012 +0200
+++ b/rhodecode/lib/vcs/backends/git/changeset.py	Thu May 03 23:15:47 2012 +0200
@@ -10,7 +10,8 @@
 from rhodecode.lib.vcs.exceptions import ChangesetDoesNotExistError
 from rhodecode.lib.vcs.exceptions import ImproperArchiveTypeError
 from rhodecode.lib.vcs.backends.base import BaseChangeset
-from rhodecode.lib.vcs.nodes import FileNode, DirNode, NodeKind, RootNode, RemovedFileNode
+from rhodecode.lib.vcs.nodes import FileNode, DirNode, NodeKind, RootNode, \
+    RemovedFileNode, SubModuleNode
 from rhodecode.lib.vcs.utils import safe_unicode
 from rhodecode.lib.vcs.utils import date_fromtimestamp
 from rhodecode.lib.vcs.utils.lazy import LazyProperty
@@ -329,7 +330,13 @@
         tree = self.repository._repo[id]
         dirnodes = []
         filenodes = []
+        als = self.repository.alias
         for name, stat, id in tree.iteritems():
+            if objects.S_ISGITLINK(stat):
+                dirnodes.append(SubModuleNode(name, url=None, changeset=id,
+                                              alias=als))
+                continue
+
             obj = self.repository._repo.get_object(id)
             if path != '':
                 obj_path = '/'.join((path, name))