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