Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 32153:6f173560c7f4
py3: slice over bytes to prevent getting ascii values
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 05 May 2017 01:26:13 +0530 |
parents | 5f53c267e362 |
children | 52e222eef646 |
comparison
equal
deleted
inserted
replaced
32152:994b0b1c77d6 | 32153:6f173560c7f4 |
---|---|
1978 defaults = {} | 1978 defaults = {} |
1979 for part in ("d", "mb", "yY", "HI", "M", "S"): | 1979 for part in ("d", "mb", "yY", "HI", "M", "S"): |
1980 # this piece is for rounding the specific end of unknowns | 1980 # this piece is for rounding the specific end of unknowns |
1981 b = bias.get(part) | 1981 b = bias.get(part) |
1982 if b is None: | 1982 if b is None: |
1983 if part[0] in "HMS": | 1983 if part[0:1] in "HMS": |
1984 b = "00" | 1984 b = "00" |
1985 else: | 1985 else: |
1986 b = "0" | 1986 b = "0" |
1987 | 1987 |
1988 # this piece is for matching the generic end to today's date | 1988 # this piece is for matching the generic end to today's date |
1989 n = datestr(now, "%" + part[0]) | 1989 n = datestr(now, "%" + part[0:1]) |
1990 | 1990 |
1991 defaults[part] = (b, n) | 1991 defaults[part] = (b, n) |
1992 | 1992 |
1993 for format in formats: | 1993 for format in formats: |
1994 try: | 1994 try: |