test-context: conditionalize the workingfilectx date printing for Windows
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 09 Nov 2015 17:15:36 -0500
changeset 27056 01489fa0bbbe
parent 27055 5a0ffa245920
child 27057 c281c20ad0ad
test-context: conditionalize the workingfilectx date printing for Windows Starting with 13272104bb07, the output changed on Windows: --- e:/Projects/hg/tests/test-context.py.out +++ e:/Projects/hg/tests/test-context.py.err @@ -1,4 +1,4 @@ -workingfilectx.date = (1000, 0) +workingfilectx.date = (1000L, 0) ASCII : Gr?ezi! Latin-1 : Grⁿezi! UTF-8 : Gr├╝ezi! Since int and long are both 32 bit on Windows, this seems harmless in practice other than the previous test failure.
tests/test-context.py
--- a/tests/test-context.py	Mon Nov 16 14:37:03 2015 -0500
+++ b/tests/test-context.py	Mon Nov 09 17:15:36 2015 -0500
@@ -16,7 +16,11 @@
 repo[None].add(['foo'])
 repo.commit(text='commit1', date="0 0")
 
-print "workingfilectx.date =", repo[None]['foo'].date()
+if os.name == 'nt':
+    d = repo[None]['foo'].date()
+    print "workingfilectx.date = (%d, %d)" % (d[0], d[1])
+else:
+    print "workingfilectx.date =", repo[None]['foo'].date()
 
 # test memctx with non-ASCII commit message