##// END OF EJS Templates
git: handle pygit tags in cases they don't have required metadata.
marcink -
r763:d8a843fc default
parent child Browse files
Show More
@@ -783,8 +783,15 b' class GitRemote(RemoteBase):'
783 repo_init = self._factory.repo_libgit2(wire)
783 repo_init = self._factory.repo_libgit2(wire)
784 with repo_init as repo:
784 with repo_init as repo:
785 commit = repo[commit_id]
785 commit = repo[commit_id]
786
787 if hasattr(commit, 'commit_time'):
788 commit_time, commit_time_offset = commit.commit_time, commit.commit_time_offset
789 else:
790 commit = commit.get_object()
791 commit_time, commit_time_offset = commit.commit_time, commit.commit_time_offset
792
786 # TODO(marcink): check dulwich difference of offset vs timezone
793 # TODO(marcink): check dulwich difference of offset vs timezone
787 return [commit.commit_time, commit.commit_time_offset]
794 return [commit_time, commit_time_offset]
788 return _date(repo_id, commit_id)
795 return _date(repo_id, commit_id)
789
796
790 @reraise_safe_exceptions
797 @reraise_safe_exceptions
@@ -795,10 +802,16 b' class GitRemote(RemoteBase):'
795 repo_init = self._factory.repo_libgit2(wire)
802 repo_init = self._factory.repo_libgit2(wire)
796 with repo_init as repo:
803 with repo_init as repo:
797 commit = repo[commit_id]
804 commit = repo[commit_id]
798 if commit.author.email:
799 return u"{} <{}>".format(commit.author.name, commit.author.email)
800
805
801 return u"{}".format(commit.author.raw_name)
806 if hasattr(commit, 'author'):
807 author = commit.author
808 else:
809 author = commit.get_object().author
810
811 if author.email:
812 return u"{} <{}>".format(author.name, author.email)
813
814 return u"{}".format(author.raw_name)
802 return _author(repo_id, commit_id)
815 return _author(repo_id, commit_id)
803
816
804 @reraise_safe_exceptions
817 @reraise_safe_exceptions
@@ -820,7 +833,12 b' class GitRemote(RemoteBase):'
820 repo_init = self._factory.repo_libgit2(wire)
833 repo_init = self._factory.repo_libgit2(wire)
821 with repo_init as repo:
834 with repo_init as repo:
822 commit = repo[commit_id]
835 commit = repo[commit_id]
823 return [x.hex for x in commit.parent_ids]
836 if hasattr(commit, 'parent_ids'):
837 parent_ids = commit.parent_ids
838 else:
839 parent_ids = commit.get_object().parent_ids
840
841 return [x.hex for x in parent_ids]
824 return _parents(repo_id, commit_id)
842 return _parents(repo_id, commit_id)
825
843
826 @reraise_safe_exceptions
844 @reraise_safe_exceptions
General Comments 0
You need to be logged in to leave comments. Login now