aboutsummaryrefslogtreecommitdiff
path: root/lib/git/objects/tag.py
diff options
context:
space:
mode:
authorRick Copeland <rcopeland@geek.net>2010-04-27 16:34:39 -0400
committerRick Copeland <rcopeland@geek.net>2010-04-27 16:38:35 -0400
commitb48e4d3aa853687f420dc51969837734b70bfdec (patch)
tree6d33df26dffe527e9a2c3835f8cae379b836a1f4 /lib/git/objects/tag.py
parent82b8902e033430000481eb355733cd7065342037 (diff)
downloadGitPython-b48e4d3aa853687f420dc51969837734b70bfdec.tar.gz
GitPython-b48e4d3aa853687f420dc51969837734b70bfdec.zip
Add support for time zone information in tags and commits.
This commit includes - an update to git.objects.utils:parse_actor_and_date to parse the timezone offset - updates to the git.objects.Commit and git.objects.Tag objects to support *_tz_offset attributes - updates to tests in test.git.test_commit and test.git.test_refs to check for appropriate *_tz_offset attributes
Diffstat (limited to 'lib/git/objects/tag.py')
-rw-r--r--lib/git/objects/tag.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/git/objects/tag.py b/lib/git/objects/tag.py
index e880bbe5..96363db6 100644
--- a/lib/git/objects/tag.py
+++ b/lib/git/objects/tag.py
@@ -15,10 +15,10 @@ class TagObject(base.Object):
to.
"""
type = "tag"
- __slots__ = ( "object", "tag", "tagger", "tagged_date", "message" )
+ __slots__ = ( "object", "tag", "tagger", "tagged_date", "tagger_tz_offset", "message" )
def __init__(self, repo, sha, object=None, tag=None,
- tagger=None, tagged_date=None, message=None):
+ tagger=None, tagged_date=None, tagger_tz_offset=None, message=None):
"""
Initialize a tag object with additional data
@@ -40,6 +40,10 @@ class TagObject(base.Object):
``tagged_date`` : int_seconds_since_epoch
is the DateTime of the tag creation - use time.gmtime to convert
it into a different format
+
+ ``tagged_tz_offset``: int_seconds_west_of_utc
+ is the timezone that the authored_date is in
+
"""
super(TagObject, self).__init__(repo, sha )
self._set_self_from_args_(locals())
@@ -58,7 +62,7 @@ class TagObject(base.Object):
self.tag = lines[2][4:] # tag <tag name>
tagger_info = lines[3][7:]# tagger <actor> <date>
- self.tagger, self.tagged_date = utils.parse_actor_and_date(tagger_info)
+ self.tagger, self.tagged_date, self.tagger_tz_offset = utils.parse_actor_and_date(tagger_info)
# line 4 empty - it could mark the beginning of the next header
# in csse there really is no message, it would not exist. Otherwise