Mercurial > hg
annotate tests/test-context.py @ 6374:31a01e3d99cc
hgweb: fix breakage in python < 2.5 introduced in 2c370f08c486
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 24 Mar 2008 16:20:15 +0100 |
parents | e75aab656f46 |
children | b148e9099133 |
rev | line source |
---|---|
4110
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
1 import os |
6212 | 2 from mercurial import hg, ui |
4110
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
3 |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
4 u = ui.ui() |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
5 |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
6 repo = hg.repository(u, 'test1', create=1) |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
7 os.chdir('test1') |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
8 |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
9 # create 'foo' with fixed time stamp |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
10 f = file('foo', 'w') |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
11 f.write('foo\n') |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
12 f.close() |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
13 os.utime('foo', (1000, 1000)) |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
14 |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
15 # add+commit 'foo' |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
16 repo.add(['foo']) |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
17 repo.commit(text='commit1', date="0 0") |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
18 |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
19 print "workingfilectx.date =", repo.workingctx().filectx('foo').date() |