Show More
@@ -151,9 +151,8 b' class changelogrevision(object):' | |||||
151 | """ |
|
151 | """ | |
152 |
|
152 | |||
153 | __slots__ = ( |
|
153 | __slots__ = ( | |
154 | 'date', |
|
154 | '_rawdateextra', | |
155 | '_rawdesc', |
|
155 | '_rawdesc', | |
156 | 'extra', |
|
|||
157 | 'files', |
|
156 | 'files', | |
158 | '_rawmanifest', |
|
157 | '_rawmanifest', | |
159 | '_rawuser', |
|
158 | '_rawuser', | |
@@ -194,22 +193,10 b' class changelogrevision(object):' | |||||
194 | nl2 = text.index('\n', nl1 + 1) |
|
193 | nl2 = text.index('\n', nl1 + 1) | |
195 | self._rawuser = text[nl1 + 1:nl2] |
|
194 | self._rawuser = text[nl1 + 1:nl2] | |
196 |
|
195 | |||
197 |
l = text |
|
196 | nl3 = text.index('\n', nl2 + 1) | |
|
197 | self._rawdateextra = text[nl2 + 1:nl3] | |||
198 |
|
198 | |||
199 |
|
|
199 | l = text[:doublenl].split('\n') | |
200 | if len(tdata) != 3: |
|
|||
201 | time = float(tdata[0]) |
|
|||
202 | try: |
|
|||
203 | # various tools did silly things with the time zone field. |
|
|||
204 | timezone = int(tdata[1]) |
|
|||
205 | except ValueError: |
|
|||
206 | timezone = 0 |
|
|||
207 | self.extra = _defaultextra |
|
|||
208 | else: |
|
|||
209 | time, timezone = float(tdata[0]), int(tdata[1]) |
|
|||
210 | self.extra = decodeextra(tdata[2]) |
|
|||
211 |
|
||||
212 | self.date = (time, timezone) |
|
|||
213 | self.files = l[3:] |
|
200 | self.files = l[3:] | |
214 |
|
201 | |||
215 | return self |
|
202 | return self | |
@@ -223,6 +210,38 b' class changelogrevision(object):' | |||||
223 | return encoding.tolocal(self._rawuser) |
|
210 | return encoding.tolocal(self._rawuser) | |
224 |
|
211 | |||
225 | @property |
|
212 | @property | |
|
213 | def _rawdate(self): | |||
|
214 | return self._rawdateextra.split(' ', 2)[0:2] | |||
|
215 | ||||
|
216 | @property | |||
|
217 | def _rawextra(self): | |||
|
218 | fields = self._rawdateextra.split(' ', 2) | |||
|
219 | if len(fields) != 3: | |||
|
220 | return None | |||
|
221 | ||||
|
222 | return fields[2] | |||
|
223 | ||||
|
224 | @property | |||
|
225 | def date(self): | |||
|
226 | raw = self._rawdate | |||
|
227 | time = float(raw[0]) | |||
|
228 | # Various tools did silly things with the timezone. | |||
|
229 | try: | |||
|
230 | timezone = int(raw[1]) | |||
|
231 | except ValueError: | |||
|
232 | timezone = 0 | |||
|
233 | ||||
|
234 | return time, timezone | |||
|
235 | ||||
|
236 | @property | |||
|
237 | def extra(self): | |||
|
238 | raw = self._rawextra | |||
|
239 | if raw is None: | |||
|
240 | return _defaultextra | |||
|
241 | ||||
|
242 | return decodeextra(raw) | |||
|
243 | ||||
|
244 | @property | |||
226 | def description(self): |
|
245 | def description(self): | |
227 | return encoding.tolocal(self._rawdesc) |
|
246 | return encoding.tolocal(self._rawdesc) | |
228 |
|
247 |
General Comments 0
You need to be logged in to leave comments.
Login now