view tests/test-context.py @ 10560:9134725caf1d stable

Add ElementPath to the list of package ignored by demand import The bzrlib try to import the ElementPath module but had a fallback in case the import fails. Lazy import of this module leads to later failure. The bzrlib is used by the convert extension.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 01 Mar 2010 14:15:55 +0100
parents 3b76321aa0de
children a1aad8333864
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.add(['foo'])
repo.commit(text='commit1', date="0 0")

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