Show More
@@ -1,113 +1,113 | |||||
1 | Test the extensions.afterloaded() function |
|
1 | Test the extensions.afterloaded() function | |
2 |
|
2 | |||
3 | $ cat > foo.py <<EOF |
|
3 | $ cat > foo.py <<EOF | |
4 | > from mercurial import extensions |
|
4 | > from mercurial import extensions | |
5 | > def uisetup(ui): |
|
5 | > def uisetup(ui): | |
6 | > ui.write("foo.uisetup\\n") |
|
6 | > ui.write(b"foo.uisetup\\n") | |
7 | > ui.flush() |
|
7 | > ui.flush() | |
8 | > def bar_loaded(loaded): |
|
8 | > def bar_loaded(loaded): | |
9 | > ui.write("foo: bar loaded: %r\\n" % (loaded,)) |
|
9 | > ui.write(b"foo: bar loaded: %r\\n" % (loaded,)) | |
10 | > ui.flush() |
|
10 | > ui.flush() | |
11 | > extensions.afterloaded('bar', bar_loaded) |
|
11 | > extensions.afterloaded(b'bar', bar_loaded) | |
12 | > EOF |
|
12 | > EOF | |
13 | $ cat > bar.py <<EOF |
|
13 | $ cat > bar.py <<EOF | |
14 | > def uisetup(ui): |
|
14 | > def uisetup(ui): | |
15 | > ui.write("bar.uisetup\\n") |
|
15 | > ui.write(b"bar.uisetup\\n") | |
16 | > ui.flush() |
|
16 | > ui.flush() | |
17 | > EOF |
|
17 | > EOF | |
18 | $ basepath=`pwd` |
|
18 | $ basepath=`pwd` | |
19 |
|
19 | |||
20 | $ hg init basic |
|
20 | $ hg init basic | |
21 | $ cd basic |
|
21 | $ cd basic | |
22 | $ echo foo > file |
|
22 | $ echo foo > file | |
23 | $ hg add file |
|
23 | $ hg add file | |
24 | $ hg commit -m 'add file' |
|
24 | $ hg commit -m 'add file' | |
25 |
|
25 | |||
26 | $ echo '[extensions]' >> .hg/hgrc |
|
26 | $ echo '[extensions]' >> .hg/hgrc | |
27 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc |
|
27 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc | |
28 | $ echo "bar = $basepath/bar.py" >> .hg/hgrc |
|
28 | $ echo "bar = $basepath/bar.py" >> .hg/hgrc | |
29 | $ hg log -r. -T'{rev}\n' |
|
29 | $ hg log -r. -T'{rev}\n' | |
30 | foo.uisetup |
|
30 | foo.uisetup | |
31 | foo: bar loaded: True |
|
31 | foo: bar loaded: True | |
32 | bar.uisetup |
|
32 | bar.uisetup | |
33 | 0 |
|
33 | 0 | |
34 |
|
34 | |||
35 | Test afterloaded with the opposite extension load order |
|
35 | Test afterloaded with the opposite extension load order | |
36 |
|
36 | |||
37 | $ cd .. |
|
37 | $ cd .. | |
38 | $ hg init basic_reverse |
|
38 | $ hg init basic_reverse | |
39 | $ cd basic_reverse |
|
39 | $ cd basic_reverse | |
40 | $ echo foo > file |
|
40 | $ echo foo > file | |
41 | $ hg add file |
|
41 | $ hg add file | |
42 | $ hg commit -m 'add file' |
|
42 | $ hg commit -m 'add file' | |
43 |
|
43 | |||
44 | $ echo '[extensions]' >> .hg/hgrc |
|
44 | $ echo '[extensions]' >> .hg/hgrc | |
45 | $ echo "bar = $basepath/bar.py" >> .hg/hgrc |
|
45 | $ echo "bar = $basepath/bar.py" >> .hg/hgrc | |
46 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc |
|
46 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc | |
47 | $ hg log -r. -T'{rev}\n' |
|
47 | $ hg log -r. -T'{rev}\n' | |
48 | bar.uisetup |
|
48 | bar.uisetup | |
49 | foo.uisetup |
|
49 | foo.uisetup | |
50 | foo: bar loaded: True |
|
50 | foo: bar loaded: True | |
51 | 0 |
|
51 | 0 | |
52 |
|
52 | |||
53 | Test the extensions.afterloaded() function when the requested extension is not |
|
53 | Test the extensions.afterloaded() function when the requested extension is not | |
54 | loaded |
|
54 | loaded | |
55 |
|
55 | |||
56 | $ cd .. |
|
56 | $ cd .. | |
57 | $ hg init notloaded |
|
57 | $ hg init notloaded | |
58 | $ cd notloaded |
|
58 | $ cd notloaded | |
59 | $ echo foo > file |
|
59 | $ echo foo > file | |
60 | $ hg add file |
|
60 | $ hg add file | |
61 | $ hg commit -m 'add file' |
|
61 | $ hg commit -m 'add file' | |
62 |
|
62 | |||
63 | $ echo '[extensions]' >> .hg/hgrc |
|
63 | $ echo '[extensions]' >> .hg/hgrc | |
64 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc |
|
64 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc | |
65 | $ hg log -r. -T'{rev}\n' |
|
65 | $ hg log -r. -T'{rev}\n' | |
66 | foo.uisetup |
|
66 | foo.uisetup | |
67 | foo: bar loaded: False |
|
67 | foo: bar loaded: False | |
68 | 0 |
|
68 | 0 | |
69 |
|
69 | |||
70 | Test the extensions.afterloaded() function when the requested extension is not |
|
70 | Test the extensions.afterloaded() function when the requested extension is not | |
71 | configured but fails the minimum version check |
|
71 | configured but fails the minimum version check | |
72 |
|
72 | |||
73 | $ cd .. |
|
73 | $ cd .. | |
74 | $ cat > minvers.py <<EOF |
|
74 | $ cat > minvers.py <<EOF | |
75 | > minimumhgversion = '9999.9999' |
|
75 | > minimumhgversion = b'9999.9999' | |
76 | > def uisetup(ui): |
|
76 | > def uisetup(ui): | |
77 | > ui.write("minvers.uisetup\\n") |
|
77 | > ui.write(b"minvers.uisetup\\n") | |
78 | > ui.flush() |
|
78 | > ui.flush() | |
79 | > EOF |
|
79 | > EOF | |
80 | $ hg init minversion |
|
80 | $ hg init minversion | |
81 | $ cd minversion |
|
81 | $ cd minversion | |
82 | $ echo foo > file |
|
82 | $ echo foo > file | |
83 | $ hg add file |
|
83 | $ hg add file | |
84 | $ hg commit -m 'add file' |
|
84 | $ hg commit -m 'add file' | |
85 |
|
85 | |||
86 | $ echo '[extensions]' >> .hg/hgrc |
|
86 | $ echo '[extensions]' >> .hg/hgrc | |
87 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc |
|
87 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc | |
88 | $ echo "bar = $basepath/minvers.py" >> .hg/hgrc |
|
88 | $ echo "bar = $basepath/minvers.py" >> .hg/hgrc | |
89 | $ hg log -r. -T'{rev}\n' |
|
89 | $ hg log -r. -T'{rev}\n' | |
90 | (third party extension bar requires version 9999.9999 or newer of Mercurial; disabling) |
|
90 | (third party extension bar requires version 9999.9999 or newer of Mercurial; disabling) | |
91 | foo.uisetup |
|
91 | foo.uisetup | |
92 | foo: bar loaded: False |
|
92 | foo: bar loaded: False | |
93 | 0 |
|
93 | 0 | |
94 |
|
94 | |||
95 | Test the extensions.afterloaded() function when the requested extension is not |
|
95 | Test the extensions.afterloaded() function when the requested extension is not | |
96 | configured but fails the minimum version check, using the opposite load order |
|
96 | configured but fails the minimum version check, using the opposite load order | |
97 | for the two extensions. |
|
97 | for the two extensions. | |
98 |
|
98 | |||
99 | $ cd .. |
|
99 | $ cd .. | |
100 | $ hg init minversion_reverse |
|
100 | $ hg init minversion_reverse | |
101 | $ cd minversion_reverse |
|
101 | $ cd minversion_reverse | |
102 | $ echo foo > file |
|
102 | $ echo foo > file | |
103 | $ hg add file |
|
103 | $ hg add file | |
104 | $ hg commit -m 'add file' |
|
104 | $ hg commit -m 'add file' | |
105 |
|
105 | |||
106 | $ echo '[extensions]' >> .hg/hgrc |
|
106 | $ echo '[extensions]' >> .hg/hgrc | |
107 | $ echo "bar = $basepath/minvers.py" >> .hg/hgrc |
|
107 | $ echo "bar = $basepath/minvers.py" >> .hg/hgrc | |
108 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc |
|
108 | $ echo "foo = $basepath/foo.py" >> .hg/hgrc | |
109 | $ hg log -r. -T'{rev}\n' |
|
109 | $ hg log -r. -T'{rev}\n' | |
110 | (third party extension bar requires version 9999.9999 or newer of Mercurial; disabling) |
|
110 | (third party extension bar requires version 9999.9999 or newer of Mercurial; disabling) | |
111 | foo.uisetup |
|
111 | foo.uisetup | |
112 | foo: bar loaded: False |
|
112 | foo: bar loaded: False | |
113 | 0 |
|
113 | 0 |
General Comments 0
You need to be logged in to leave comments.
Login now