change default strftime format for better portability
authorTK Soh <teekaysoh@yahoo.com>
Tue, 14 Mar 2006 22:01:30 -0800
changeset 1953 379ab45b91b7
parent 1951 696230e52e4d
child 1954 34d0e2e559ff
change default strftime format for better portability On some systems, such as Solaris and HP-UX, "%c" format give output without the leading zero on the single-digit month-day.
mercurial/util.py
tests/test-remove
tests/test-remove.out
--- a/mercurial/util.py	Tue Mar 14 21:40:46 2006 -0800
+++ b/mercurial/util.py	Tue Mar 14 22:01:30 2006 -0800
@@ -742,7 +742,7 @@
         tz = time.timezone
     return time.mktime(lt), tz
 
-def datestr(date=None, format='%c'):
+def datestr(date=None, format='%a %b %d %H:%M:%S %Y'):
     """represent a (unixtime, offset) tuple as a localized time.
     unixtime is seconds since the epoch, and offset is the time zone's
     number of seconds away from UTC."""
--- a/tests/test-remove	Tue Mar 14 21:40:46 2006 -0800
+++ b/tests/test-remove	Tue Mar 14 22:01:30 2006 -0800
@@ -8,10 +8,10 @@
 rm foo
 hg remove foo
 hg commit -m 2 -d "1000000 0"
-hg export 0 | sed -e "s/Thu Jan 01/Thu Jan  1/"
-hg export 1 | sed -e "s/Thu Jan 01/Thu Jan  1/"
-hg log -p -r 0 | sed -e "s/Thu Jan 01/Thu Jan  1/"
-hg log -p -r 1 | sed -e "s/Thu Jan 01/Thu Jan  1/"
+hg export 0
+hg export 1
+hg log -p -r 0
+hg log -p -r 1
 
 cd ..
 hg clone a b
--- a/tests/test-remove.out	Tue Mar 14 21:40:46 2006 -0800
+++ b/tests/test-remove.out	Tue Mar 14 22:01:30 2006 -0800
@@ -5,7 +5,7 @@
 1
 
 diff -r 000000000000 -r 8ba83d44753d foo
---- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 +++ b/foo	Mon Jan 12 13:46:40 1970 +0000
 @@ -0,0 +1,1 @@
 +a
@@ -17,7 +17,7 @@
 
 diff -r 8ba83d44753d -r a1fce69c50d9 foo
 --- a/foo	Mon Jan 12 13:46:40 1970 +0000
-+++ /dev/null	Thu Jan  1 00:00:00 1970 +0000
++++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
 @@ -1,1 +0,0 @@
 -a
 changeset:   0:8ba83d44753d
@@ -26,7 +26,7 @@
 summary:     1
 
 diff -r 000000000000 -r 8ba83d44753d foo
---- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 +++ b/foo	Mon Jan 12 13:46:40 1970 +0000
 @@ -0,0 +1,1 @@
 +a
@@ -40,7 +40,7 @@
 
 diff -r 8ba83d44753d -r a1fce69c50d9 foo
 --- a/foo	Mon Jan 12 13:46:40 1970 +0000
-+++ /dev/null	Thu Jan  1 00:00:00 1970 +0000
++++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
 @@ -1,1 +0,0 @@
 -a