Mercurial > hg
annotate tests/test-context.py @ 5264:0fc16031bb45
Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 28 Aug 2007 22:48:25 -0300 |
parents | ce21f76751f4 |
children | e75aab656f46 |
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 |
20af6a2f0b0e
Fixed workingfilectx.date() (found by Thomas Waldmann) with test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
2 from mercurial import hg, ui, commands |
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() |