view tests/test-context.py @ 11674:c29012a73518 stable

i18n: safety writing into non-ASCII named files on any shell implementation some shell implementation (e.g.: dash) can not handle redirection into non-ASCII UTF-8 named file correctly.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 22 Jul 2010 23:18:38 +0900
parents a1aad8333864
children bd23d5f28bbb
line wrap: on
line source

import os
from mercurial import hg, ui

u = ui.ui()

repo = hg.repository(u, 'test1', create=1)
os.chdir('test1')

# create 'foo' with fixed time stamp
f = open('foo', 'w')
f.write('foo\n')
f.close()
os.utime('foo', (1000, 1000))

# add+commit 'foo'
repo[None].add(['foo'])
repo.commit(text='commit1', date="0 0")

print "workingfilectx.date =", repo[None]['foo'].date()