Mercurial > hg > mercurial-crew-with-dirclash
comparison tests/test-dispatch.py @ 5161:24d306834de5
merge with -stable
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 14 Aug 2007 17:20:51 +0200 |
parents | f3f033def181 |
children | 18a9fbb5cd78 |
comparison
equal
deleted
inserted
replaced
5160:c13610d5642c | 5161:24d306834de5 |
---|---|
1 import os | |
2 from mercurial import commands | |
3 | |
4 def dispatch(cmd): | |
5 """Simple wrapper around commands.dispatch() | |
6 | |
7 Prints command and result value, but does not handle quoting. | |
8 """ | |
9 print "running: %s" % (cmd,) | |
10 result = commands.dispatch(cmd.split()) | |
11 print "result: %r" % (result,) | |
12 | |
13 | |
14 dispatch("init test1") | |
15 os.chdir('test1') | |
16 | |
17 # create file 'foo', add and commit | |
18 f = file('foo', 'wb') | |
19 f.write('foo\n') | |
20 f.close() | |
21 dispatch("add foo") | |
22 dispatch("commit -m commit1 -d 2000-01-01 foo") | |
23 | |
24 # append to file 'foo' and commit | |
25 f = file('foo', 'ab') | |
26 f.write('bar\n') | |
27 f.close() | |
28 dispatch("commit -m commit2 -d 2000-01-02 foo") | |
29 | |
30 # check 88803a69b24 (fancyopts modified command table) | |
31 dispatch("log -r 0") | |
32 dispatch("log -r tip") |