@@ -23,12 +23,14 @@ class Commit(base.Object, Iterable, diff.Diffable, utils.Traversable):
2323
2424# object configuration
2525type = "commit"
26- __slots__ = ("tree" ,"author" ,"authored_date" ,"committer" ,"committed_date" ,
27- "message" ,"parents" )
26+ __slots__ = ("tree" ,
27+ "author" ,"authored_date" ,"author_tz_offset" ,
28+ "committer" ,"committed_date" ,"committer_tz_offset" ,
29+ "message" ,"parents" )
2830_id_attribute_ = "sha"
2931
30- def __init__ (self ,repo ,sha ,tree = None ,author = None ,authored_date = None ,
31- committer = None ,committed_date = None ,message = None ,parents = None ):
32+ def __init__ (self ,repo ,sha ,tree = None ,author = None ,authored_date = None ,author_tz_offset = None ,
33+ committer = None ,committed_date = None ,committer_tz_offset = None , message = None ,parents = None ):
3234"""
3335 Instantiate a new Commit. All keyword arguments taking None as default will
3436 be implicitly set if id names a valid sha.
@@ -51,13 +53,19 @@ def __init__(self, repo, sha, tree=None, author=None, authored_date=None,
5153 is the authored DateTime - use time.gmtime() to convert it into a
5254 different format
5355
56+ ``author_tz_offset``: int_seconds_west_of_utc
57+ is the timezone that the authored_date is in
58+
5459 ``committer`` : Actor
5560 is the committer string
5661
5762 ``committed_date`` : int_seconds_since_epoch
5863 is the committed DateTime - use time.gmtime() to convert it into a
5964 different format
6065
66+ ``committer_tz_offset``: int_seconds_west_of_utc
67+ is the timezone that the authored_date is in
68+
6169 ``message`` : string
6270 is the commit message
6371
@@ -94,8 +102,10 @@ def _set_cache_(self, attr):
94102self .tree = temp .tree
95103self .author = temp .author
96104self .authored_date = temp .authored_date
105+ self .author_tz_offset = temp .author_tz_offset
97106self .committer = temp .committer
98107self .committed_date = temp .committed_date
108+ self .committer_tz_offset = temp .committer_tz_offset
99109self .message = temp .message
100110else :
101111super (Commit ,self )._set_cache_ (attr )
@@ -253,8 +263,8 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream, from_rev_list):
253263parents .append (parent_line .split ()[- 1 ])
254264# END for each parent line
255265
256- author ,authored_date = utils .parse_actor_and_date (next_line )
257- committer ,committed_date = utils .parse_actor_and_date (stream .next ())
266+ author ,authored_date , author_tz_offset = utils .parse_actor_and_date (next_line )
267+ committer ,committed_date , committer_tz_offset = utils .parse_actor_and_date (stream .next ())
258268
259269# empty line
260270stream .next ()
@@ -276,8 +286,10 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream, from_rev_list):
276286# END message parsing
277287message = '\n ' .join (message_lines )
278288
279- yield Commit (repo ,id ,parents = tuple (parents ),tree = tree ,author = author ,authored_date = authored_date ,
280- committer = committer ,committed_date = committed_date ,message = message )
289+ yield Commit (repo ,id ,parents = tuple (parents ),tree = tree ,
290+ author = author ,authored_date = authored_date ,author_tz_offset = author_tz_offset ,
291+ committer = committer ,committed_date = committed_date ,committer_tz_offset = committer_tz_offset ,
292+ message = message )
281293# END for each line in stream
282294
283295