# # # patch "ChangeLog" # from [c4ca52a6b1aa76740f0f94f5ddb69582bd35bc55] # to [030269c240a248138d6c362d54dfac61f15d5485] # # patch "common.py" # from [2504e01f69f99347d0e8706fb7c344c6a6471e43] # to [9251a160e0b985356bc4198c4d05dedc169a3479] # ============================================================ --- ChangeLog c4ca52a6b1aa76740f0f94f5ddb69582bd35bc55 +++ ChangeLog 030269c240a248138d6c362d54dfac61f15d5485 @@ -1,3 +1,9 @@ +2007-07-04 Grahame Bowland + + * merge patch from Ludovic Brenta + to handle times + with microseconds in them. + 2007-05-01 Grahame Bowland * patch from Rob Schoening fixing a hardcoded ============================================================ --- common.py 2504e01f69f99347d0e8706fb7c344c6a6471e43 +++ common.py 9251a160e0b985356bc4198c4d05dedc169a3479 @@ -17,8 +17,16 @@ def parse_timecert(value): import traceback def parse_timecert(value): + # The datetime may contain microseconds which time.strptime cannot parse. + # Drop them. This is easy because Monotone keeps timestamps in ISO 8601 + # format, so microseconds necessarily start with a period. + index_of_period = value.find ('.') + if index_of_period > -1: + value = value[0:index_of_period] return apply(datetime.datetime, time.strptime(value, "%Y-%m-%dT%H:%M:%S")[:6]) + return apply(datetime.datetime, time.strptime(value, "%Y-%m-%dT%H:%M:%S")[:6]) + def set_nonblocking(fd): fl = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NDELAY)