aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/lib/vcs/backends/git/changeset.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-05-04 00:14:58 +0200
committerMarcin Kuzminski <marcin@python-works.com>2012-05-04 00:14:58 +0200
commit00c64a783f8f267cf8553dc1859b6f5c5e90be0b (patch)
tree8da9f36039f516b88d59ca4640b2f3eba83b1ee8 /rhodecode/lib/vcs/backends/git/changeset.py
parenta5aef18f79d3ebf9cfd2a78274e9e9fcf5c846b1 (diff)
fixed issues with gitsubmodule diffs
--HG-- branch : beta
Diffstat (limited to 'rhodecode/lib/vcs/backends/git/changeset.py')
-rw-r--r--rhodecode/lib/vcs/backends/git/changeset.py36
1 files changed, 21 insertions, 15 deletions
diff --git a/rhodecode/lib/vcs/backends/git/changeset.py b/rhodecode/lib/vcs/backends/git/changeset.py
index f7ea3e42..eadc2ce2 100644
--- a/rhodecode/lib/vcs/backends/git/changeset.py
+++ b/rhodecode/lib/vcs/backends/git/changeset.py
@@ -364,24 +364,31 @@ class GitChangeset(BaseChangeset):
path = self._fix_path(path)
if not path in self.nodes:
try:
- id = self._get_id_for_path(path)
+ id_ = self._get_id_for_path(path)
except ChangesetError:
raise NodeDoesNotExistError("Cannot find one of parents' "
"directories for a given path: %s" % path)
- obj = self.repository._repo.get_object(id)
- if isinstance(obj, objects.Tree):
- if path == '':
- node = RootNode(changeset=self)
- else:
- node = DirNode(path, changeset=self)
- node._tree = obj
- elif isinstance(obj, objects.Blob):
- node = FileNode(path, changeset=self)
- node._blob = obj
+
+ als = self.repository.alias
+ _GL = lambda m: m and objects.S_ISGITLINK(m)
+ if _GL(self._stat_modes.get(path)):
+ node = SubModuleNode(path, url=None, changeset=id_, alias=als)
else:
- raise NodeDoesNotExistError("There is no file nor directory "
- "at the given path %r at revision %r"
- % (path, self.short_id))
+ obj = self.repository._repo.get_object(id_)
+
+ if isinstance(obj, objects.Tree):
+ if path == '':
+ node = RootNode(changeset=self)
+ else:
+ node = DirNode(path, changeset=self)
+ node._tree = obj
+ elif isinstance(obj, objects.Blob):
+ node = FileNode(path, changeset=self)
+ node._blob = obj
+ else:
+ raise NodeDoesNotExistError("There is no file nor directory "
+ "at the given path %r at revision %r"
+ % (path, self.short_id))
# cache node
self.nodes[path] = node
return self.nodes[path]
@@ -423,7 +430,6 @@ class GitChangeset(BaseChangeset):
line))
_path = splitted[1].strip()
paths.add(_path)
-
return sorted(paths)
@LazyProperty