##// 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 783 repo_init = self._factory.repo_libgit2(wire)
784 784 with repo_init as repo:
785 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 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 795 return _date(repo_id, commit_id)
789 796
790 797 @reraise_safe_exceptions
@@ -795,10 +802,16 b' class GitRemote(RemoteBase):'
795 802 repo_init = self._factory.repo_libgit2(wire)
796 803 with repo_init as repo:
797 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 815 return _author(repo_id, commit_id)
803 816
804 817 @reraise_safe_exceptions
@@ -820,7 +833,12 b' class GitRemote(RemoteBase):'
820 833 repo_init = self._factory.repo_libgit2(wire)
821 834 with repo_init as repo:
822 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 842 return _parents(repo_id, commit_id)
825 843
826 844 @reraise_safe_exceptions
General Comments 0
You need to be logged in to leave comments. Login now