Changeset 1416 in tailor for vcpx/repository/darcs/source.py
- Timestamp:
- 07/01/07 21:11:51 (6 years ago)
- Hash name:
- 20070701191151-97f81-1a1ae73ef1f18fddd73b9a1e12f1ba239ebadf27
- File:
-
- 1 edited
-
vcpx/repository/darcs/source.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/repository/darcs/source.py
r1415 r1416 303 303 ## * Refix _getUpstreamChangesets for darcs 304 304 305 fsep = re.compile('[ :]+') 305 306 l = output.readline() 306 307 while not l.startswith('Making no changes: this is a dry run.'): 307 308 # Assume it's a line like 308 309 # Sun Jan 2 00:24:04 UTC 2005 lele@nautilus.homeip.net 309 # we used to split on the double space before the email, 310 # but in this case this is wrong. Then we assumed the date 311 # part to be exactly 28 chars long, but what about timezone 312 # names like 'CEST'? Waiting for xml output... 313 # We still assume there are *two* spaces before the email. 314 # The alternative is using some sort of a regex: Aaron Kaplan 315 # kindly suggested his own perl snippet 316 # /^(... ... .\d .\d:\d\d:\d\d ...?. \d\d\d\d) (.*)/ || die; 317 # my ($date, $author) = ($1, $2); 318 # but that assumes the two spaces as separator, so I find the 319 # following solution easier and by any chance faster too. 320 pieces = l.rstrip().split(' ') 321 assert len(pieces)>1, "Cannot parse %r as a patch timestamp" % l 322 323 # Even the author part may contain double spaces: so 324 # join the date and time with a single space, and the 325 # remaining pieces with a double space. 326 date = ' '.join(pieces[:2]) 327 author = ' '.join(pieces[2:]) 328 y,m,d,hh,mm,ss,d1,d2,d3 = strptime(date, "%a %b %d %H:%M:%S %Z %Y") 310 # Use a regular expression matching multiple spaces or colons 311 # to split it, and use the first 7 fields to build up a datetime. 312 pieces = fsep.split(l.rstrip(), 8) 313 assert len(pieces)>=7, "Cannot parse %r as a patch timestamp" % l 314 date = ' '.join(pieces[:8]) 315 author = pieces[8] 316 y,m,d,hh,mm,ss,d1,d2,d3 = strptime(date, "%a %b %d %H %M %S %Z %Y") 329 317 date = datetime(y,m,d,hh,mm,ss,0,UTC) 330 318 l = output.readline().rstrip()
Note: See TracChangeset
for help on using the changeset viewer.
