Show More
@@ -2056,12 +2056,12 b' def parsedate(date, formats=None, bias=N' | |||
|
2056 | 2056 | The date may be a "unixtime offset" string or in one of the specified |
|
2057 | 2057 | formats. If the date already is a (unixtime, offset) tuple, it is returned. |
|
2058 | 2058 | |
|
2059 |
>>> parsedate(b' today ') == parsedate( |
|
|
2060 |
|
|
|
2059 | >>> parsedate(b' today ') == parsedate( | |
|
2060 | ... datetime.date.today().strftime('%b %d').encode('ascii')) | |
|
2061 | 2061 | True |
|
2062 |
>>> parsedate(b'yesterday ') == parsedate( |
|
|
2063 | datetime.timedelta(days=1)\ | |
|
2064 | ).strftime('%b %d')) | |
|
2062 | >>> parsedate(b'yesterday ') == parsedate( | |
|
2063 | ... (datetime.date.today() - datetime.timedelta(days=1) | |
|
2064 | ... ).strftime('%b %d').encode('ascii')) | |
|
2065 | 2065 | True |
|
2066 | 2066 | >>> now, tz = makedate() |
|
2067 | 2067 | >>> strnow, strtz = parsedate(b'now') |
@@ -2083,10 +2083,12 b' def parsedate(date, formats=None, bias=N' | |||
|
2083 | 2083 | if date == 'now' or date == _('now'): |
|
2084 | 2084 | return makedate() |
|
2085 | 2085 | if date == 'today' or date == _('today'): |
|
2086 | date = datetime.date.today().strftime('%b %d') | |
|
2086 | date = datetime.date.today().strftime(r'%b %d') | |
|
2087 | date = encoding.strtolocal(date) | |
|
2087 | 2088 | elif date == 'yesterday' or date == _('yesterday'): |
|
2088 | 2089 | date = (datetime.date.today() - |
|
2089 | datetime.timedelta(days=1)).strftime('%b %d') | |
|
2090 | datetime.timedelta(days=1)).strftime(r'%b %d') | |
|
2091 | date = encoding.strtolocal(date) | |
|
2090 | 2092 | |
|
2091 | 2093 | try: |
|
2092 | 2094 | when, offset = map(int, date.split(' ')) |
@@ -69,7 +69,7 b" testmod('mercurial.templatefilters')" | |||
|
69 | 69 | testmod('mercurial.templater') |
|
70 | 70 | testmod('mercurial.ui') |
|
71 | 71 | testmod('mercurial.url') |
|
72 | testmod('mercurial.util', py3=False) # py3: multiple bytes/unicode issues | |
|
72 | testmod('mercurial.util') | |
|
73 | 73 | testmod('mercurial.util', testtarget='platform') |
|
74 | 74 | testmod('hgext.convert.convcmd') |
|
75 | 75 | testmod('hgext.convert.cvsps') |
General Comments 0
You need to be logged in to leave comments.
Login now