@@ -23,12 +23,14 @@ class Commit(base.Object, Iterable, diff.Diffable, utils.Traversable):
23
23
24
24
# object configuration
25
25
type = "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" )
28
30
_id_attribute_ = "sha"
29
31
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 ):
32
34
"""
33
35
Instantiate a new Commit. All keyword arguments taking None as default will
34
36
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,
51
53
is the authored DateTime - use time.gmtime() to convert it into a
52
54
different format
53
55
56
+ ``author_tz_offset``: int_seconds_west_of_utc
57
+ is the timezone that the authored_date is in
58
+
54
59
``committer`` : Actor
55
60
is the committer string
56
61
57
62
``committed_date`` : int_seconds_since_epoch
58
63
is the committed DateTime - use time.gmtime() to convert it into a
59
64
different format
60
65
66
+ ``committer_tz_offset``: int_seconds_west_of_utc
67
+ is the timezone that the authored_date is in
68
+
61
69
``message`` : string
62
70
is the commit message
63
71
@@ -94,8 +102,10 @@ def _set_cache_(self, attr):
94
102
self .tree = temp .tree
95
103
self .author = temp .author
96
104
self .authored_date = temp .authored_date
105
+ self .author_tz_offset = temp .author_tz_offset
97
106
self .committer = temp .committer
98
107
self .committed_date = temp .committed_date
108
+ self .committer_tz_offset = temp .committer_tz_offset
99
109
self .message = temp .message
100
110
else :
101
111
super (Commit , self )._set_cache_ (attr )
@@ -253,8 +263,8 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream, from_rev_list):
253
263
parents .append (parent_line .split ()[- 1 ])
254
264
# END for each parent line
255
265
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 ())
258
268
259
269
# empty line
260
270
stream .next ()
@@ -276,8 +286,10 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream, from_rev_list):
276
286
# END message parsing
277
287
message = '\n ' .join (message_lines )
278
288
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 )
281
293
# END for each line in stream
282
294
283
295
0 commit comments