author | Mads Kiilerich <mads@kiilerich.com> |
Fri, 24 Jun 2011 00:18:06 +0200 | |
branch | stable |
changeset 14715 | a97ebfec8c29 |
parent 14327 | d943412e2fba |
child 14849 | d87814992728 |
permissions | -rw-r--r-- |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1 |
Test basic extension support |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
2 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
3 |
$ "$TESTDIR/hghave" no-outer-repo || exit 80 |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
4 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
5 |
$ cat > foobar.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
6 |
> import os |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
7 |
> from mercurial import commands |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
8 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
9 |
> def uisetup(ui): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
10 |
> ui.write("uisetup called\\n") |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
11 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
12 |
> def reposetup(ui, repo): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
13 |
> ui.write("reposetup called for %s\\n" % os.path.basename(repo.root)) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
14 |
> ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!")) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
15 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
16 |
> def foo(ui, *args, **kwargs): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
17 |
> ui.write("Foo\\n") |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
18 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
19 |
> def bar(ui, *args, **kwargs): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
20 |
> ui.write("Bar\\n") |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
21 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
22 |
> cmdtable = { |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
23 |
> "foo": (foo, [], "hg foo"), |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
24 |
> "bar": (bar, [], "hg bar"), |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
25 |
> } |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
26 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
27 |
> commands.norepo += ' bar' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
28 |
> EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
29 |
$ abspath=`pwd`/foobar.py |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
30 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
31 |
$ mkdir barfoo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
32 |
$ cp foobar.py barfoo/__init__.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
33 |
$ barfoopath=`pwd`/barfoo |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
34 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
35 |
$ hg init a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
36 |
$ cd a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
37 |
$ echo foo > file |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
38 |
$ hg add file |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
39 |
$ hg commit -m 'add file' |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
40 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
41 |
$ echo '[extensions]' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
42 |
$ echo "foobar = $abspath" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
43 |
$ hg foo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
44 |
uisetup called |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
45 |
reposetup called for a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
46 |
ui == repo.ui |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
47 |
Foo |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
48 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
49 |
$ cd .. |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
50 |
$ hg clone a b |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
51 |
uisetup called |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
52 |
reposetup called for a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
53 |
ui == repo.ui |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
54 |
reposetup called for b |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
55 |
ui == repo.ui |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
56 |
updating to branch default |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
57 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
4569
622d8ed78b47
extensions: load modules in module/__init__.py form.
Brendan Cully <brendan@kublai.com>
parents:
4074
diff
changeset
|
58 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
59 |
$ hg bar |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
60 |
uisetup called |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
61 |
Bar |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
62 |
$ echo 'foobar = !' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
63 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
64 |
module/__init__.py-style |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
65 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
66 |
$ echo "barfoo = $barfoopath" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
67 |
$ cd a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
68 |
$ hg foo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
69 |
uisetup called |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
70 |
reposetup called for a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
71 |
ui == repo.ui |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
72 |
Foo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
73 |
$ echo 'barfoo = !' >> $HGRCPATH |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
74 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
75 |
Check that extensions are loaded in phases: |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
76 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
77 |
$ cat > foo.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
78 |
> import os |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
79 |
> name = os.path.basename(__file__).rsplit('.', 1)[0] |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
80 |
> print "1) %s imported" % name |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
81 |
> def uisetup(ui): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
82 |
> print "2) %s uisetup" % name |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
83 |
> def extsetup(): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
84 |
> print "3) %s extsetup" % name |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
85 |
> def reposetup(ui, repo): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
86 |
> print "4) %s reposetup" % name |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
87 |
> EOF |
4569
622d8ed78b47
extensions: load modules in module/__init__.py form.
Brendan Cully <brendan@kublai.com>
parents:
4074
diff
changeset
|
88 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
89 |
$ cp foo.py bar.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
90 |
$ echo 'foo = foo.py' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
91 |
$ echo 'bar = bar.py' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
92 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
93 |
Command with no output, we just want to see the extensions loaded: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
94 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
95 |
$ hg paths |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
96 |
1) foo imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
97 |
1) bar imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
98 |
2) foo uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
99 |
2) bar uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
100 |
3) foo extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
101 |
3) bar extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
102 |
4) foo reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
103 |
4) bar reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
104 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
105 |
Check hgweb's load order: |
4738
c41a404ac387
Handle extensions with defined but empty cmdtable
Brendan Cully <brendan@kublai.com>
parents:
4569
diff
changeset
|
106 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
107 |
$ cat > hgweb.cgi <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
108 |
> #!/usr/bin/env python |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
109 |
> from mercurial import demandimport; demandimport.enable() |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
110 |
> from mercurial.hgweb import hgweb |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
111 |
> from mercurial.hgweb import wsgicgi |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
112 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
113 |
> application = hgweb('.', 'test repo') |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
114 |
> wsgicgi.launch(application) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
115 |
> EOF |
9410
1c83938b6a8e
extensions: load and configure extensions in well-defined phases
Martin Geisler <mg@lazybytes.net>
parents:
9128
diff
changeset
|
116 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
117 |
$ SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \ |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
118 |
> | grep '^[0-9]) ' # ignores HTML output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
119 |
1) foo imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
120 |
1) bar imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
121 |
2) foo uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
122 |
2) bar uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
123 |
3) foo extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
124 |
3) bar extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
125 |
4) foo reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
126 |
4) bar reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
127 |
4) foo reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
128 |
4) bar reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
129 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
130 |
$ echo 'foo = !' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
131 |
$ echo 'bar = !' >> $HGRCPATH |
9410
1c83938b6a8e
extensions: load and configure extensions in well-defined phases
Martin Geisler <mg@lazybytes.net>
parents:
9128
diff
changeset
|
132 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
133 |
$ cd .. |
9661
c4f6c02e33c4
hgweb: added test case for extension loading phases (issue1824)
Yuya Nishihara <yuya@tcha.org>
parents:
9410
diff
changeset
|
134 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
135 |
$ cat > empty.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
136 |
> '''empty cmdtable |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
137 |
> ''' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
138 |
> cmdtable = {} |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
139 |
> EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
140 |
$ emptypath=`pwd`/empty.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
141 |
$ echo "empty = $emptypath" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
142 |
$ hg help empty |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
143 |
empty extension - empty cmdtable |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
144 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
145 |
no commands defined |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
146 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
147 |
$ echo 'empty = !' >> $HGRCPATH |
9661
c4f6c02e33c4
hgweb: added test case for extension loading phases (issue1824)
Yuya Nishihara <yuya@tcha.org>
parents:
9410
diff
changeset
|
148 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
149 |
$ cat > debugextension.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
150 |
> '''only debugcommands |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
151 |
> ''' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
152 |
> def debugfoobar(ui, repo, *args, **opts): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
153 |
> "yet another debug command" |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
154 |
> pass |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
155 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
156 |
> def foo(ui, repo, *args, **opts): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
157 |
> """yet another foo command |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
158 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
159 |
> This command has been DEPRECATED since forever. |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
160 |
> """ |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
161 |
> pass |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
162 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
163 |
> cmdtable = { |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
164 |
> "debugfoobar": (debugfoobar, (), "hg debugfoobar"), |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
165 |
> "foo": (foo, (), "hg foo") |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
166 |
> } |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
167 |
> EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
168 |
$ debugpath=`pwd`/debugextension.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
169 |
$ echo "debugextension = $debugpath" >> $HGRCPATH |
9410
1c83938b6a8e
extensions: load and configure extensions in well-defined phases
Martin Geisler <mg@lazybytes.net>
parents:
9128
diff
changeset
|
170 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
171 |
$ hg help debugextension |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
172 |
debugextension extension - only debugcommands |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
173 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
174 |
no commands defined |
4950
93b7e2fa7ee3
help: avoid traceback if an extension has only debug commands
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4738
diff
changeset
|
175 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
176 |
$ hg --verbose help debugextension |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
177 |
debugextension extension - only debugcommands |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
178 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
179 |
list of commands: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
180 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
181 |
foo: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
182 |
yet another foo command |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
183 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
184 |
global options: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
185 |
-R --repository REPO repository root directory or name of overlay bundle |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
186 |
file |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
187 |
--cwd DIR change working directory |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
188 |
-y --noninteractive do not prompt, assume 'yes' for any required answers |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
189 |
-q --quiet suppress output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
190 |
-v --verbose enable additional output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
191 |
--config CONFIG [+] set/override config option (use 'section.name=value') |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
192 |
--debug enable debugging output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
193 |
--debugger start debugger |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
194 |
--encoding ENCODE set the charset encoding (default: ascii) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
195 |
--encodingmode MODE set the charset encoding mode (default: strict) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
196 |
--traceback always print a traceback on exception |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
197 |
--time time how long the command takes |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
198 |
--profile print command execution profile |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
199 |
--version output version information and exit |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
200 |
-h --help display help and exit |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
201 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
202 |
[+] marked option can be specified multiple times |
9128
98d90ad54749
commands: hide deprecated commands.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
8189
diff
changeset
|
203 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
204 |
$ hg --debug help debugextension |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
205 |
debugextension extension - only debugcommands |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
206 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
207 |
list of commands: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
208 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
209 |
debugfoobar: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
210 |
yet another debug command |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
211 |
foo: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
212 |
yet another foo command |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
213 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
214 |
global options: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
215 |
-R --repository REPO repository root directory or name of overlay bundle |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
216 |
file |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
217 |
--cwd DIR change working directory |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
218 |
-y --noninteractive do not prompt, assume 'yes' for any required answers |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
219 |
-q --quiet suppress output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
220 |
-v --verbose enable additional output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
221 |
--config CONFIG [+] set/override config option (use 'section.name=value') |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
222 |
--debug enable debugging output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
223 |
--debugger start debugger |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
224 |
--encoding ENCODE set the charset encoding (default: ascii) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
225 |
--encodingmode MODE set the charset encoding mode (default: strict) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
226 |
--traceback always print a traceback on exception |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
227 |
--time time how long the command takes |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
228 |
--profile print command execution profile |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
229 |
--version output version information and exit |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
230 |
-h --help display help and exit |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
231 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
232 |
[+] marked option can be specified multiple times |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
233 |
$ echo 'debugextension = !' >> $HGRCPATH |
7011
7da76778dbd7
Do not try to load extensions twice (issue811)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
234 |
|
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
235 |
Extension module help vs command help: |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
236 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
237 |
$ echo 'extdiff =' >> $HGRCPATH |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
238 |
$ hg help extdiff |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
239 |
hg extdiff [OPT]... [FILE]... |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
240 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
241 |
use external program to diff repository (or selected files) |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
242 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
243 |
Show differences between revisions for the specified files, using an |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
244 |
external program. The default program used is diff, with default options |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
245 |
"-Npru". |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
246 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
247 |
To select a different program, use the -p/--program option. The program |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
248 |
will be passed the names of two directories to compare. To pass additional |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
249 |
options to the program, use -o/--option. These will be passed before the |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
250 |
names of the directories to compare. |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
251 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
252 |
When two revision arguments are given, then changes are shown between |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
253 |
those revisions. If only one revision is specified then that revision is |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
254 |
compared to the working directory, and, when no revisions are specified, |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
255 |
the working directory files are compared to its parent. |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
256 |
|
14285
aa64a87b493d
help: give hint about 'hg help -e' when appropriate
Martin Geisler <mg@aragost.com>
parents:
14284
diff
changeset
|
257 |
use "hg help -e extdiff" to show help for the extdiff extension |
aa64a87b493d
help: give hint about 'hg help -e' when appropriate
Martin Geisler <mg@aragost.com>
parents:
14284
diff
changeset
|
258 |
|
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
259 |
options: |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
260 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
261 |
-p --program CMD comparison program to run |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
262 |
-o --option OPT [+] pass option to comparison program |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
263 |
-r --rev REV [+] revision |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
264 |
-c --change REV change made by revision |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
265 |
-I --include PATTERN [+] include names matching the given patterns |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
266 |
-X --exclude PATTERN [+] exclude names matching the given patterns |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
267 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
268 |
[+] marked option can be specified multiple times |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
269 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
270 |
use "hg -v help extdiff" to show global options |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
271 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
272 |
$ hg help --extension extdiff |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
273 |
extdiff extension - command to allow external programs to compare revisions |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
274 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
275 |
The extdiff Mercurial extension allows you to use external programs to compare |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
276 |
revisions, or revision with working directory. The external diff programs are |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
277 |
called with a configurable set of options and two non-option arguments: paths |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
278 |
to directories containing snapshots of files to compare. |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
279 |
|
14327
d943412e2fba
extdiff: grammar "allows to" -> "allows one to"
Javi Merino <cibervicho@gmail.com>
parents:
14286
diff
changeset
|
280 |
The extdiff extension also allows you to configure new diff commands, so you |
d943412e2fba
extdiff: grammar "allows to" -> "allows one to"
Javi Merino <cibervicho@gmail.com>
parents:
14286
diff
changeset
|
281 |
do not need to type "hg extdiff -p kdiff3" always. |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
282 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
283 |
[extdiff] |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
284 |
# add new command that runs GNU diff(1) in 'context diff' mode |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
285 |
cdiff = gdiff -Nprc5 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
286 |
## or the old way: |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
287 |
#cmd.cdiff = gdiff |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
288 |
#opts.cdiff = -Nprc5 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
289 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
290 |
# add new command called vdiff, runs kdiff3 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
291 |
vdiff = kdiff3 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
292 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
293 |
# add new command called meld, runs meld (no need to name twice) |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
294 |
meld = |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
295 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
296 |
# add new command called vimdiff, runs gvimdiff with DirDiff plugin |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
297 |
# (see http://www.vim.org/scripts/script.php?script_id=102) Non |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
298 |
# English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
299 |
# your .vimrc |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
300 |
vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)' |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
301 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
302 |
Tool arguments can include variables that are expanded at runtime: |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
303 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
304 |
$parent1, $plabel1 - filename, descriptive label of first parent |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
305 |
$child, $clabel - filename, descriptive label of child revision |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
306 |
$parent2, $plabel2 - filename, descriptive label of second parent |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
307 |
$root - repository root |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
308 |
$parent is an alias for $parent1. |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
309 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
310 |
The extdiff extension will look in your [diff-tools] and [merge-tools] |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
311 |
sections for diff tool arguments, when none are specified in [extdiff]. |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
312 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
313 |
[extdiff] |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
314 |
kdiff3 = |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
315 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
316 |
[diff-tools] |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
317 |
kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
318 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
319 |
You can use -I/-X and list of file or directory names like normal "hg diff" |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
320 |
command. The extdiff extension makes snapshots of only needed files, so |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
321 |
running the external diff program will actually be pretty fast (at least |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
322 |
faster than having to compare the entire tree). |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
323 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
324 |
list of commands: |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
325 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
326 |
extdiff use external program to diff repository (or selected files) |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
327 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
328 |
use "hg -v help extdiff" to show builtin aliases and global options |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
329 |
|
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
330 |
$ echo 'extdiff = !' >> $HGRCPATH |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
331 |
|
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
332 |
Test help topic with same name as extension |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
333 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
334 |
$ cat > multirevs.py <<EOF |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
335 |
> from mercurial import commands |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
336 |
> """multirevs extension |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
337 |
> Big multi-line module docstring.""" |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
338 |
> def multirevs(ui, repo, arg, *args, **opts): |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
339 |
> """multirevs command""" |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
340 |
> pass |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
341 |
> cmdtable = { |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
342 |
> "multirevs": (multirevs, [], 'ARG') |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
343 |
> } |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
344 |
> commands.norepo += ' multirevs' |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
345 |
> EOF |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
346 |
$ echo "multirevs = multirevs.py" >> $HGRCPATH |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
347 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
348 |
$ hg help multirevs |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
349 |
Specifying Multiple Revisions |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
350 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
351 |
When Mercurial accepts more than one revision, they may be specified |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
352 |
individually, or provided as a topologically continuous range, separated |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
353 |
by the ":" character. |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
354 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
355 |
The syntax of range notation is [BEGIN]:[END], where BEGIN and END are |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
356 |
revision identifiers. Both BEGIN and END are optional. If BEGIN is not |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
357 |
specified, it defaults to revision number 0. If END is not specified, it |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
358 |
defaults to the tip. The range ":" thus means "all revisions". |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
359 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
360 |
If BEGIN is greater than END, revisions are treated in reverse order. |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
361 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
362 |
A range acts as a closed interval. This means that a range of 3:5 gives 3, |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
363 |
4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6. |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
364 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
365 |
use "hg help -c multirevs" to see help for the multirevs command |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
366 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
367 |
$ hg help -c multirevs |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
368 |
hg multirevs ARG |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
369 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
370 |
multirevs command |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
371 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
372 |
use "hg -v help multirevs" to show global options |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
373 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
374 |
$ hg multirevs |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
375 |
hg multirevs: invalid arguments |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
376 |
hg multirevs ARG |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
377 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
378 |
multirevs command |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
379 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
380 |
use "hg help multirevs" to show the full help text |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
381 |
[255] |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
382 |
|
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
383 |
$ echo "multirevs = !" >> $HGRCPATH |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
384 |
|
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12327
diff
changeset
|
385 |
Issue811: Problem loading extensions twice (by site and by user) |
7011
7da76778dbd7
Do not try to load extensions twice (issue811)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
386 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
387 |
$ debugpath=`pwd`/debugissue811.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
388 |
$ cat > debugissue811.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
389 |
> '''show all loaded extensions |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
390 |
> ''' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
391 |
> from mercurial import extensions, commands |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
392 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
393 |
> def debugextensions(ui): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
394 |
> "yet another debug command" |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
395 |
> ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()])) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
396 |
> |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
397 |
> cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")} |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
398 |
> commands.norepo += " debugextensions" |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
399 |
> EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
400 |
$ echo "debugissue811 = $debugpath" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
401 |
$ echo "mq=" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
402 |
$ echo "hgext.mq=" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
403 |
$ echo "hgext/mq=" >> $HGRCPATH |
7011
7da76778dbd7
Do not try to load extensions twice (issue811)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
404 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
405 |
Show extensions: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
406 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
407 |
$ hg debugextensions |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
408 |
debugissue811 |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
409 |
mq |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
410 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
411 |
Disabled extension commands: |
10364
de1e7099d100
dispatch: provide help for disabled extensions and commands
Brodie Rao <me+hg@dackz.net>
parents:
9802
diff
changeset
|
412 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
413 |
$ HGRCPATH= |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
414 |
$ export HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
415 |
$ hg help email |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
416 |
'email' is provided by the following extension: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
417 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
418 |
patchbomb command to send changesets as (a series of) patch emails |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
419 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
420 |
use "hg help extensions" for information on enabling extensions |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
421 |
$ hg qdel |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
422 |
hg: unknown command 'qdel' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
423 |
'qdelete' is provided by the following extension: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
424 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
425 |
mq manage a stack of patches |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
426 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
427 |
use "hg help extensions" for information on enabling extensions |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12191
diff
changeset
|
428 |
[255] |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
429 |
$ hg churn |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
430 |
hg: unknown command 'churn' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
431 |
'churn' is provided by the following extension: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
432 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
433 |
churn command to display statistics about repository history |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
434 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
435 |
use "hg help extensions" for information on enabling extensions |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12191
diff
changeset
|
436 |
[255] |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
437 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
438 |
Disabled extensions: |
10364
de1e7099d100
dispatch: provide help for disabled extensions and commands
Brodie Rao <me+hg@dackz.net>
parents:
9802
diff
changeset
|
439 |
|
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
440 |
$ hg help churn |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
441 |
churn extension - command to display statistics about repository history |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
442 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
443 |
use "hg help extensions" for information on enabling extensions |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
444 |
$ hg help patchbomb |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
445 |
patchbomb extension - command to send changesets as (a series of) patch emails |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
446 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
447 |
use "hg help extensions" for information on enabling extensions |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
448 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
449 |
Broken disabled extension and command: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
450 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
451 |
$ mkdir hgext |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
452 |
$ echo > hgext/__init__.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
453 |
$ cat > hgext/broken.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
454 |
> "broken extension' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
455 |
> EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
456 |
$ cat > path.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
457 |
> import os, sys |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
458 |
> sys.path.insert(0, os.environ['HGEXTPATH']) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
459 |
> EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
460 |
$ HGEXTPATH=`pwd` |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
461 |
$ export HGEXTPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
462 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
463 |
$ hg --config extensions.path=./path.py help broken |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
464 |
broken extension - (no help text available) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
465 |
|
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
466 |
use "hg help extensions" for information on enabling extensions |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
467 |
|
13191
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
468 |
$ cat > hgext/forest.py <<EOF |
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
469 |
> cmdtable = None |
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
470 |
> EOF |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
471 |
$ hg --config extensions.path=./path.py help foo > /dev/null |
13191
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
472 |
warning: error finding commands in $TESTTMP/hgext/forest.py |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
473 |
hg: unknown command 'foo' |
13191
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
474 |
warning: error finding commands in $TESTTMP/hgext/forest.py |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12191
diff
changeset
|
475 |
[255] |