comparison mercurial/util.py @ 2546:8cb894370514

str.rsplit does not exist in python 2.3
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 30 Jun 2006 23:02:08 +0200
parents 4ab59a3acd16
children 0875cda033fd
comparison
equal deleted inserted replaced
2545:cff57cb5631e 2546:8cb894370514
866 return (string[-4:].isdigit() and 866 return (string[-4:].isdigit() and
867 (string[-5] == '+' or string[-5] == '-') and 867 (string[-5] == '+' or string[-5] == '-') and
868 string[-6].isspace()) 868 string[-6].isspace())
869 869
870 if hastimezone(string): 870 if hastimezone(string):
871 date, tz = string.rsplit(None, 1) 871 date, tz = string[:-6], string[-5:]
872 tz = int(tz) 872 tz = int(tz)
873 offset = - 3600 * (tz / 100) - 60 * (tz % 100) 873 offset = - 3600 * (tz / 100) - 60 * (tz % 100)
874 else: 874 else:
875 date, offset = string, 0 875 date, offset = string, 0
876 when = int(time.mktime(time.strptime(date, format))) + offset 876 when = int(time.mktime(time.strptime(date, format))) + offset