Show More
@@ -0,0 +1,32 b'' | |||
|
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") |
@@ -0,0 +1,23 b'' | |||
|
1 | running: init test1 | |
|
2 | result: None | |
|
3 | running: add foo | |
|
4 | result: None | |
|
5 | running: commit -m commit1 -d 2000-01-01 foo | |
|
6 | result: None | |
|
7 | running: commit -m commit2 -d 2000-01-02 foo | |
|
8 | result: None | |
|
9 | running: log -r 0 | |
|
10 | changeset: 0:0e4634943879 | |
|
11 | user: test | |
|
12 | date: Sat Jan 01 00:00:00 2000 +0000 | |
|
13 | summary: commit1 | |
|
14 | ||
|
15 | result: None | |
|
16 | running: log -r tip | |
|
17 | changeset: 1:45589e459b2e | |
|
18 | tag: tip | |
|
19 | user: test | |
|
20 | date: Sun Jan 02 00:00:00 2000 +0000 | |
|
21 | summary: commit2 | |
|
22 | ||
|
23 | result: None |
General Comments 0
You need to be logged in to leave comments.
Login now