Show More
@@ -26,27 +26,24 b' class GitChangeset(BaseChangeset):' | |||||
26 | def __init__(self, repository, revision): |
|
26 | def __init__(self, repository, revision): | |
27 | self._stat_modes = {} |
|
27 | self._stat_modes = {} | |
28 | self.repository = repository |
|
28 | self.repository = repository | |
29 | self.raw_id = revision |
|
29 | ||
30 | self.short_id = self.raw_id[:12] |
|
|||
31 | self.id = self.raw_id |
|
|||
32 | try: |
|
30 | try: | |
33 |
commit = self.repository._repo.get_object( |
|
31 | commit = self.repository._repo.get_object(revision) | |
|
32 | if isinstance(commit, Tag): | |||
|
33 | revision = commit.object[1] | |||
|
34 | commit = self.repository._repo.get_object(commit.object[1]) | |||
34 | except KeyError: |
|
35 | except KeyError: | |
35 |
raise RepositoryError("Cannot get object with id %s" % |
|
36 | raise RepositoryError("Cannot get object with id %s" % revision) | |
|
37 | self.raw_id = revision | |||
|
38 | self.id = self.raw_id | |||
|
39 | self.short_id = self.raw_id[:12] | |||
36 | self._commit = commit |
|
40 | self._commit = commit | |
37 |
|
41 | |||
38 | if isinstance(commit, Commit): |
|
|||
39 |
|
|
42 | self._tree_id = commit.tree | |
40 |
|
|
43 | self._commiter_property = 'committer' | |
41 |
|
|
44 | self._date_property = 'commit_time' | |
42 |
|
|
45 | self._date_tz_property = 'commit_timezone' | |
43 |
|
|
46 | self.revision = repository.revisions.index(revision) | |
44 | elif isinstance(commit, Tag): |
|
|||
45 | self._commiter_property = 'tagger' |
|
|||
46 | self._tree_id = commit.id |
|
|||
47 | self._date_property = 'tag_time' |
|
|||
48 | self._date_tz_property = 'tag_timezone' |
|
|||
49 | self.revision = 'tag' |
|
|||
50 |
|
47 | |||
51 | self.message = safe_unicode(commit.message) |
|
48 | self.message = safe_unicode(commit.message) | |
52 | #self.branch = None |
|
49 | #self.branch = None | |
@@ -388,7 +385,7 b' class GitChangeset(BaseChangeset):' | |||||
388 | else: |
|
385 | else: | |
389 | obj = self.repository._repo.get_object(id_) |
|
386 | obj = self.repository._repo.get_object(id_) | |
390 |
|
387 | |||
391 |
if isinstance(obj, |
|
388 | if isinstance(obj, objects.Tree): | |
392 | if path == '': |
|
389 | if path == '': | |
393 | node = RootNode(changeset=self) |
|
390 | node = RootNode(changeset=self) | |
394 | else: |
|
391 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now