2007-02-23 19:31:00 +03:00
|
|
|
import os
|
2008-03-07 00:23:41 +03:00
|
|
|
from mercurial import hg, ui
|
2007-02-23 19:31:00 +03:00
|
|
|
|
|
|
|
u = ui.ui()
|
|
|
|
|
|
|
|
repo = hg.repository(u, 'test1', create=1)
|
|
|
|
os.chdir('test1')
|
|
|
|
|
|
|
|
# create 'foo' with fixed time stamp
|
2009-07-05 13:01:30 +04:00
|
|
|
f = open('foo', 'w')
|
2007-02-23 19:31:00 +03:00
|
|
|
f.write('foo\n')
|
|
|
|
f.close()
|
|
|
|
os.utime('foo', (1000, 1000))
|
|
|
|
|
|
|
|
# add+commit 'foo'
|
2010-06-07 22:03:32 +04:00
|
|
|
repo[None].add(['foo'])
|
2007-02-23 19:31:00 +03:00
|
|
|
repo.commit(text='commit1', date="0 0")
|
|
|
|
|
2008-06-26 23:35:46 +04:00
|
|
|
print "workingfilectx.date =", repo[None]['foo'].date()
|