@@ -46,13 +46,13 @@ def __repr__(self):
46
46
def format (self ):
47
47
""":return: a string suitable to be placed in a reflog file"""
48
48
act = self .actor
49
- time = self .time
49
+ time_ = self .time_
50
50
return u"{} {} {} <{}> {!s} {}\t {}\n " .format (self .oldhexsha ,
51
51
self .newhexsha ,
52
52
act .name ,
53
53
act .email ,
54
- time [0 ],
55
- altz_to_utctz_str (time [1 ]),
54
+ time_ [0 ],
55
+ altz_to_utctz_str (time_ [1 ]),
56
56
self .message )
57
57
58
58
@property
@@ -71,7 +71,7 @@ def actor(self):
71
71
return self [2 ]
72
72
73
73
@property
74
- def time (self ):
74
+ def time_ (self ):
75
75
"""time as tuple:
76
76
77
77
* [0] = int(time)
@@ -84,12 +84,12 @@ def message(self):
84
84
return self [4 ]
85
85
86
86
@classmethod
87
- def new (cls , oldhexsha , newhexsha , actor , time , tz_offset , message ):
87
+ def new (cls , oldhexsha , newhexsha , actor , time_ , tz_offset , message ):
88
88
""":return: New instance of a RefLogEntry"""
89
89
if not isinstance (actor , Actor ):
90
90
raise ValueError ("Need actor instance, got %s" % actor )
91
91
# END check types
92
- return RefLogEntry ((oldhexsha , newhexsha , actor , (time , tz_offset ), message ))
92
+ return RefLogEntry ((oldhexsha , newhexsha , actor , (time_ , tz_offset ), message ))
93
93
94
94
@classmethod
95
95
def from_line (cls , line ):
@@ -121,9 +121,9 @@ def from_line(cls, line):
121
121
# END handle missing end brace
122
122
123
123
actor = Actor ._from_string (info [82 :email_end + 1 ])
124
- time , tz_offset = parse_date (info [email_end + 2 :])
124
+ time_ , tz_offset = parse_date (info [email_end + 2 :])
125
125
126
- return RefLogEntry ((oldhexsha , newhexsha , actor , (time , tz_offset ), msg ))
126
+ return RefLogEntry ((oldhexsha , newhexsha , actor , (time_ , tz_offset ), msg ))
127
127
128
128
129
129
class RefLog (list , Serializable ):
@@ -220,21 +220,20 @@ def entry_at(cls, filepath, index):
220
220
with open (filepath , 'rb' ) as fp :
221
221
if index < 0 :
222
222
return RefLogEntry .from_line (fp .readlines ()[index ].strip ())
223
- else :
224
- # read until index is reached
225
- for i in xrange (index + 1 ):
226
- line = fp .readline ()
227
- if not line :
228
- break
229
- # END abort on eof
230
- # END handle runup
231
-
232
- if i != index or not line : # skipcq:PYL-W0631
233
- raise IndexError
234
- # END handle exception
235
-
236
- return RefLogEntry .from_line (line .strip ())
237
- # END handle index
223
+ # read until index is reached
224
+ for i in xrange (index + 1 ):
225
+ line = fp .readline ()
226
+ if not line :
227
+ break
228
+ # END abort on eof
229
+ # END handle runup
230
+
231
+ if i != index or not line : # skipcq:PYL-W0631
232
+ raise IndexError
233
+ # END handle exception
234
+
235
+ return RefLogEntry .from_line (line .strip ())
236
+ # END handle index
238
237
239
238
def to_file (self , filepath ):
240
239
"""Write the contents of the reflog instance to a file at the given filepath.
0 commit comments