comparison tests/test-context.py @ 33664:3889cf955a62 stable

hg: tolerate long vs. int in test-context.py The file times here can be longs instead of ints on some platforms, which will cause a test failure due to these printing with an L suffix; instead always format with %d which will produce the same output in either case. Differential Revision: https://phab.mercurial-scm.org/D361
author Tristan Seligmann <mithrandi@mithrandi.net>
date Sat, 12 Aug 2017 14:24:25 +0200
parents bb628fc85b0e
children af20468eb0a4
comparison
equal deleted inserted replaced
33663:7686cbb0ba41 33664:3889cf955a62
22 22
23 # add+commit 'foo' 23 # add+commit 'foo'
24 repo[None].add(['foo']) 24 repo[None].add(['foo'])
25 repo.commit(text='commit1', date="0 0") 25 repo.commit(text='commit1', date="0 0")
26 26
27 d = repo[None]['foo'].date()
27 if os.name == 'nt': 28 if os.name == 'nt':
28 d = repo[None]['foo'].date() 29 d = d[:2]
29 print("workingfilectx.date = (%d, %d)" % (d[0], d[1])) 30 print("workingfilectx.date = (%d, %d)" % d)
30 else:
31 print("workingfilectx.date =", repo[None]['foo'].date())
32 31
33 # test memctx with non-ASCII commit message 32 # test memctx with non-ASCII commit message
34 33
35 def filectxfn(repo, memctx, path): 34 def filectxfn(repo, memctx, path):
36 return context.memfilectx(repo, "foo", "") 35 return context.memfilectx(repo, "foo", "")