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 |
@@ -9,7 +9,10 b' def fancyopts(args, options, state):' | |||||
9 | for s, l, d, c in options: |
|
9 | for s, l, d, c in options: | |
10 | pl = l.replace('-', '_') |
|
10 | pl = l.replace('-', '_') | |
11 | map['-'+s] = map['--'+l] = pl |
|
11 | map['-'+s] = map['--'+l] = pl | |
12 | state[pl] = d |
|
12 | if isinstance(d, list): | |
|
13 | state[pl] = d[:] | |||
|
14 | else: | |||
|
15 | state[pl] = d | |||
13 | dt[pl] = type(d) |
|
16 | dt[pl] = type(d) | |
14 | if (d is not None and d is not True and d is not False and |
|
17 | if (d is not None and d is not True and d is not False and | |
15 | not callable(d)): |
|
18 | not callable(d)): |
@@ -73,7 +73,7 b" if __name__ == '__main__':" | |||||
73 | negate = feature.startswith('no-') |
|
73 | negate = feature.startswith('no-') | |
74 | if negate: |
|
74 | if negate: | |
75 | feature = feature[3:] |
|
75 | feature = feature[3:] | |
76 |
|
76 | |||
77 | if feature not in checks: |
|
77 | if feature not in checks: | |
78 | error('hghave: unknown feature: ' + feature) |
|
78 | error('hghave: unknown feature: ' + feature) | |
79 | continue |
|
79 | continue | |
@@ -82,7 +82,7 b" if __name__ == '__main__':" | |||||
82 | if not negate and not check(): |
|
82 | if not negate and not check(): | |
83 | error('hghave: missing feature: ' + desc) |
|
83 | error('hghave: missing feature: ' + desc) | |
84 | elif negate and check(): |
|
84 | elif negate and check(): | |
85 |
error('hghave: |
|
85 | error('hghave: system supports %s' % desc) | |
86 |
|
86 | |||
87 | if failures != 0: |
|
87 | if failures != 0: | |
88 | sys.exit(1) |
|
88 | sys.exit(1) |
@@ -5,7 +5,6 b' u = ui.ui()' | |||||
5 |
|
5 | |||
6 | repo = hg.repository(u, 'test1', create=1) |
|
6 | repo = hg.repository(u, 'test1', create=1) | |
7 | os.chdir('test1') |
|
7 | os.chdir('test1') | |
8 | repo = hg.repository(u, '.') # FIXME: can't lock repo without doing this |
|
|||
9 |
|
8 | |||
10 | # create 'foo' with fixed time stamp |
|
9 | # create 'foo' with fixed time stamp | |
11 | f = file('foo', 'w') |
|
10 | f = file('foo', 'w') |
@@ -18,7 +18,7 b'' | |||||
18 | echo % unbundle |
|
18 | echo % unbundle | |
19 | hg init t |
|
19 | hg init t | |
20 | cd t |
|
20 | cd t | |
21 | hg pull "$TESTDIR/test-no-symlinks.hg" |
|
21 | hg pull -q "$TESTDIR/test-no-symlinks.hg" | |
22 | hg update |
|
22 | hg update | |
23 |
|
23 | |||
24 | cat a.lnk && echo |
|
24 | cat a.lnk && echo | |
@@ -44,4 +44,4 b' hg update' | |||||
44 |
|
44 | |||
45 | cat a.lnk && echo |
|
45 | cat a.lnk && echo | |
46 | cat d/a2.lnk && echo |
|
46 | cat d/a2.lnk && echo | |
47 | cat b2.lnk && echo No newline at end of file |
|
47 | cat b2.lnk && echo |
@@ -1,11 +1,4 b'' | |||||
1 | % unbundle |
|
1 | % unbundle | |
2 | pulling from C:\dev\mercurial\hg\hg-local-stable\tests/test-no-symlinks.hg |
|
|||
3 | requesting all changes |
|
|||
4 | adding changesets |
|
|||
5 | adding manifests |
|
|||
6 | adding file changes |
|
|||
7 | added 1 changesets with 4 changes to 4 files |
|
|||
8 | (run 'hg update' to get a working copy) |
|
|||
9 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
10 | a |
|
3 | a | |
11 | d/b |
|
4 | d/b |
General Comments 0
You need to be logged in to leave comments.
Login now