Mercurial > hg-stable
comparison hgext/convert/subversion.py @ 16514:363e808de349 stable
i18n: use locale insensitive format for datetimes as intermediate representation (issue3398)
on some non "en" locale environments, "hg convert" is aborted, because
"util.parsedate()" fails.
it fails in "memctx.__init__()" called by "putcommit()" of "convert".
in "hg convert", datetimes gotten from source repository
are usually formatted by "util.datestr()" with default format "%a %b
%d %H:%M:%S %Y %1%2".
but on some environments, "%a" and "%b" may cause locale sensitive
string, and such string may cause parse error in "util.parsedate()".
this path uses "%Y-%m-%d %H:%M:%S %1%2" as intermediate representation
format for datetimes, because it consists only of locale insensitive
elements.
datetimes in above format are only used for passing them from
conversion logic to memctx object, so it doesn't have to be formatted
by locale sensitive one.
this patch just avoids locale sensitivity problem of "datestr()" and
"parsedate()" combintion.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 26 Apr 2012 02:41:20 +0900 |
parents | ecd2fbe68b25 |
children | 525fdb738975 |
comparison
equal
deleted
inserted
replaced
16513:aa252059a98f | 16514:363e808de349 |
---|---|
803 branch = None | 803 branch = None |
804 except IndexError: | 804 except IndexError: |
805 branch = None | 805 branch = None |
806 | 806 |
807 cset = commit(author=author, | 807 cset = commit(author=author, |
808 date=util.datestr(date), | 808 date=util.datestr(date, '%Y-%m-%d %H:%M:%S %1%2'), |
809 desc=log, | 809 desc=log, |
810 parents=parents, | 810 parents=parents, |
811 branch=branch, | 811 branch=branch, |
812 rev=rev) | 812 rev=rev) |
813 | 813 |