Show More
@@ -14,9 +14,6 b' def testdispatch(cmd):' | |||||
14 | result = dispatch.dispatch(req) |
|
14 | result = dispatch.dispatch(req) | |
15 | print("result: %r" % (result,)) |
|
15 | print("result: %r" % (result,)) | |
16 |
|
16 | |||
17 | testdispatch("init test1") |
|
|||
18 | os.chdir('test1') |
|
|||
19 |
|
||||
20 | # create file 'foo', add and commit |
|
17 | # create file 'foo', add and commit | |
21 | f = open('foo', 'wb') |
|
18 | f = open('foo', 'wb') | |
22 | f.write('foo\n') |
|
19 | f.write('foo\n') | |
@@ -28,6 +25,10 b' testdispatch("commit -m commit1 -d 2000-' | |||||
28 | f = open('foo', 'ab') |
|
25 | f = open('foo', 'ab') | |
29 | f.write('bar\n') |
|
26 | f.write('bar\n') | |
30 | f.close() |
|
27 | f.close() | |
|
28 | # remove blackbox.log directory (proxy for readonly log file) | |||
|
29 | os.rmdir(".hg/blackbox.log") | |||
|
30 | # replace it with the real blackbox.log file | |||
|
31 | os.rename(".hg/blackbox.log-", ".hg/blackbox.log") | |||
31 | testdispatch("commit -m commit2 -d 2000-01-02 foo") |
|
32 | testdispatch("commit -m commit2 -d 2000-01-02 foo") | |
32 |
|
33 | |||
33 | # check 88803a69b24 (fancyopts modified command table) |
|
34 | # check 88803a69b24 (fancyopts modified command table) |
@@ -157,7 +157,7 b' log rotation' | |||||
157 | $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\ |
|
157 | $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\ | |
158 | > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\ |
|
158 | > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\ | |
159 | > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py |
|
159 | > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py | |
160 |
$ python |
|
160 | $ python $TESTDIR/blackbox-readonly-dispatch.py | |
161 | running: add foo |
|
161 | running: add foo | |
162 | result: 0 |
|
162 | result: 0 | |
163 | running: commit -m commit1 -d 2000-01-01 foo |
|
163 | running: commit -m commit1 -d 2000-01-01 foo |
General Comments 0
You need to be logged in to leave comments.
Login now