Mercurial > hg
annotate tests/test-extension.t @ 33116:6c113a7dec52
tests: use the system hg for examining the local repository
Most test scripts use "hg" to interact with a temporary test repository.
However a few tests also want to run hg commands to interact with the local
repository containing the mercurial source code. Notably, many of the
test-check-* tests want to check local files and commit messages.
These tests were previously using the version of hg being tested to query the
source repository. However, this will fail if the source repository requires
extensions or other settings not supported by the version of mercurial being
tested. The source repository was typically initially cloned using the system
hg installation, so we should use the system hg installation to query it.
There was already a helpers-testrepo.sh script designed to help cope with
different requirements for the source repository versus the test repositories.
However, it only handled the evolve extension. This new behavior works with
any extensions that are different between the system installation and the test
installation.
author | Adam Simpkins <simpkins@fb.com> |
---|---|
date | Tue, 27 Jun 2017 17:24:31 -0700 |
parents | 4a8db3538c39 |
children | c467d13334ee |
rev | line source |
---|---|
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 $ cat > foobar.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
4 > import os |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
5 > from mercurial import commands, registrar |
21254
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
20003
diff
changeset
|
6 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
7 > command = registrar.command(cmdtable) |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
8 > def uisetup(ui): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
9 > ui.write("uisetup called\\n") |
28612
6fb1d3c936d2
tests: explicitly flush output streams
Jun Wu <quark@fb.com>
parents:
27990
diff
changeset
|
10 > ui.flush() |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
11 > def reposetup(ui, repo): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
12 > 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
|
13 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!")) |
28612
6fb1d3c936d2
tests: explicitly flush output streams
Jun Wu <quark@fb.com>
parents:
27990
diff
changeset
|
14 > ui.flush() |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
15 > @command(b'foo', [], 'hg foo') |
12191
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") |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
18 > @command(b'bar', [], 'hg bar', norepo=True) |
12191
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 > EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
22 $ 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
|
23 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
24 $ mkdir barfoo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
25 $ cp foobar.py barfoo/__init__.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
26 $ barfoopath=`pwd`/barfoo |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
27 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
28 $ hg init a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
29 $ cd a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
30 $ echo foo > file |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
31 $ hg add file |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
32 $ 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
|
33 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
34 $ echo '[extensions]' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
35 $ echo "foobar = $abspath" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
36 $ hg foo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
37 uisetup called |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
38 reposetup called for a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
39 ui == repo.ui |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
40 Foo |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
41 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
42 $ cd .. |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
43 $ hg clone a b |
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 reposetup called for b |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
48 ui == repo.ui |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
49 updating to branch default |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
50 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
|
51 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
52 $ hg bar |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
53 uisetup called |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
54 Bar |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
55 $ echo 'foobar = !' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
56 |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
57 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
|
58 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
59 $ echo "barfoo = $barfoopath" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
60 $ cd a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
61 $ hg foo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
62 uisetup called |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
63 reposetup called for a |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
64 ui == repo.ui |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
65 Foo |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
66 $ echo 'barfoo = !' >> $HGRCPATH |
4064
5d9ede002453
install reposetup hook right after loading the extension
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
67 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
68 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
|
69 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
70 $ cat > foo.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
71 > import os |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
72 > name = os.path.basename(__file__).rsplit('.', 1)[0] |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
73 > print "1) %s imported" % name |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
74 > def uisetup(ui): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
75 > print "2) %s uisetup" % name |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
76 > def extsetup(): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
77 > print "3) %s extsetup" % name |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
78 > def reposetup(ui, repo): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
79 > print "4) %s reposetup" % name |
33052
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
80 > |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
81 > # custom predicate to check registration of functions at loading |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
82 > from mercurial import ( |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
83 > registrar, |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
84 > smartset, |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
85 > ) |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
86 > revsetpredicate = registrar.revsetpredicate() |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
87 > @revsetpredicate(name, safe=True) # safe=True for query via hgweb |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
88 > def custompredicate(repo, subset, x): |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
89 > return smartset.baseset([r for r in subset if r in {0}]) |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
90 > EOF |
4569
622d8ed78b47
extensions: load modules in module/__init__.py form.
Brendan Cully <brendan@kublai.com>
parents:
4074
diff
changeset
|
91 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
92 $ cp foo.py bar.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
93 $ echo 'foo = foo.py' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
94 $ echo 'bar = bar.py' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
95 |
33052
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
96 Check normal command's load order of extensions and registration of functions |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
97 |
33052
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
98 $ hg log -r "foo() and bar()" -q |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
99 1) foo imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
100 1) bar imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
101 2) foo uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
102 2) bar uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
103 3) foo extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
104 3) bar extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
105 4) foo reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
106 4) bar reposetup |
33052
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
107 0:c24b9ac61126 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
108 |
33052
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
109 Check hgweb's load order of extensions and registration of functions |
4738
c41a404ac387
Handle extensions with defined but empty cmdtable
Brendan Cully <brendan@kublai.com>
parents:
4569
diff
changeset
|
110 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
111 $ cat > hgweb.cgi <<EOF |
32938
b6776b34e44e
tests: use $PYTHON in #! so we always use the right Python
Augie Fackler <augie@google.com>
parents:
32757
diff
changeset
|
112 > #!$PYTHON |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
113 > from mercurial import demandimport; demandimport.enable() |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
114 > from mercurial.hgweb import hgweb |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
115 > from mercurial.hgweb import wsgicgi |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
116 > application = hgweb('.', 'test repo') |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
117 > wsgicgi.launch(application) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
118 > EOF |
33099
4a8db3538c39
tests: use cgienv to minimize environment setup at hgweb tests
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33098
diff
changeset
|
119 $ . "$TESTDIR/cgienv" |
9410
1c83938b6a8e
extensions: load and configure extensions in well-defined phases
Martin Geisler <mg@lazybytes.net>
parents:
9128
diff
changeset
|
120 |
33099
4a8db3538c39
tests: use cgienv to minimize environment setup at hgweb tests
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33098
diff
changeset
|
121 $ PATH_INFO='/' SCRIPT_NAME='' python hgweb.cgi \ |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
122 > | grep '^[0-9]) ' # ignores HTML output |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
123 1) foo imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
124 1) bar imported |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
125 2) foo uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
126 2) bar uisetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
127 3) foo extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
128 3) bar extsetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
129 4) foo reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
130 4) bar reposetup |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
131 |
33052
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
132 (check that revset predicate foo() and bar() are available) |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
133 |
33098
c4a20c9484e7
tests: avoid test failure for mangling path-like string by MSYS
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33097
diff
changeset
|
134 #if msys |
c4a20c9484e7
tests: avoid test failure for mangling path-like string by MSYS
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33097
diff
changeset
|
135 $ PATH_INFO='//shortlog' |
c4a20c9484e7
tests: avoid test failure for mangling path-like string by MSYS
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33097
diff
changeset
|
136 #else |
c4a20c9484e7
tests: avoid test failure for mangling path-like string by MSYS
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33097
diff
changeset
|
137 $ PATH_INFO='/shortlog' |
c4a20c9484e7
tests: avoid test failure for mangling path-like string by MSYS
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33097
diff
changeset
|
138 #endif |
c4a20c9484e7
tests: avoid test failure for mangling path-like string by MSYS
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33097
diff
changeset
|
139 $ export PATH_INFO |
33099
4a8db3538c39
tests: use cgienv to minimize environment setup at hgweb tests
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
33098
diff
changeset
|
140 $ SCRIPT_NAME='' QUERY_STRING='rev=foo() and bar()' python hgweb.cgi \ |
33052
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
141 > | grep '<a href="/rev/[0-9a-z]*">' |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
142 <a href="/rev/c24b9ac61126">add file</a> |
45b0e9d05ee9
extensions: register functions always at loading extension (issue5601)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
143 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
144 $ echo 'foo = !' >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
145 $ echo 'bar = !' >> $HGRCPATH |
9410
1c83938b6a8e
extensions: load and configure extensions in well-defined phases
Martin Geisler <mg@lazybytes.net>
parents:
9128
diff
changeset
|
146 |
19932
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
147 Check "from __future__ import absolute_import" support for external libraries |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
148 |
20001
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
149 #if windows |
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
150 $ PATHSEP=";" |
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
151 #else |
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
152 $ PATHSEP=":" |
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
153 #endif |
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
154 $ export PATHSEP |
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
155 |
19932
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
156 $ mkdir $TESTTMP/libroot |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
157 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
158 $ mkdir $TESTTMP/libroot/mod |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
159 $ touch $TESTTMP/libroot/mod/__init__.py |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
160 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
161 |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
162 #if absimport |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
163 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
164 > from __future__ import absolute_import |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
165 > import ambig # should load "libroot/ambig.py" |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
166 > s = ambig.s |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
167 > EOF |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
168 $ cat > loadabs.py <<EOF |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
169 > import mod.ambigabs as ambigabs |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
170 > def extsetup(): |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
171 > print 'ambigabs.s=%s' % ambigabs.s |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
172 > EOF |
20001
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
173 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root) |
19932
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
174 ambigabs.s=libroot/ambig.py |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
175 $TESTTMP/a (glob) |
19932
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
176 #endif |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
177 |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
178 #if no-py3k |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
179 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
180 > import ambig # should load "libroot/mod/ambig.py" |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
181 > s = ambig.s |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
182 > EOF |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
183 $ cat > loadrel.py <<EOF |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
184 > import mod.ambigrel as ambigrel |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
185 > def extsetup(): |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
186 > print 'ambigrel.s=%s' % ambigrel.s |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
187 > EOF |
20001
a1f99a7f2d72
tests: choose the path separator in PYTHONPATH suitable for platform
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19933
diff
changeset
|
188 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root) |
19932
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
189 ambigrel.s=libroot/mod/ambig.py |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
190 $TESTTMP/a (glob) |
19932
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
191 #endif |
e3a5922e18c3
demandimport: support "absolute_import" for external libraries (issue4029)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19822
diff
changeset
|
192 |
19933
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
193 Check absolute/relative import of extension specific modules |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
194 |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
195 $ mkdir $TESTTMP/extroot |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
196 $ cat > $TESTTMP/extroot/bar.py <<EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
197 > s = 'this is extroot.bar' |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
198 > EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
199 $ mkdir $TESTTMP/extroot/sub1 |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
200 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
201 > s = 'this is extroot.sub1.__init__' |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
202 > EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
203 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
204 > s = 'this is extroot.sub1.baz' |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
205 > EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
206 $ cat > $TESTTMP/extroot/__init__.py <<EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
207 > s = 'this is extroot.__init__' |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
208 > import foo |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
209 > def extsetup(ui): |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
210 > ui.write('(extroot) ', foo.func(), '\n') |
28612
6fb1d3c936d2
tests: explicitly flush output streams
Jun Wu <quark@fb.com>
parents:
27990
diff
changeset
|
211 > ui.flush() |
19933
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
212 > EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
213 |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
214 $ cat > $TESTTMP/extroot/foo.py <<EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
215 > # test absolute import |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
216 > buf = [] |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
217 > def func(): |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
218 > # "not locals" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
219 > import extroot.bar |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
220 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
221 > return '\n(extroot) '.join(buf) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
222 > # "fromlist == ('*',)" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
223 > from extroot.bar import * |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
224 > buf.append('from extroot.bar import *: %s' % s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
225 > # "not fromlist" and "if '.' in name" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
226 > import extroot.sub1.baz |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
227 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
228 > # "not fromlist" and NOT "if '.' in name" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
229 > import extroot |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
230 > buf.append('import extroot: %s' % extroot.s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
231 > # NOT "not fromlist" and NOT "level != -1" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
232 > from extroot.bar import s |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
233 > buf.append('from extroot.bar import s: %s' % s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
234 > EOF |
27491
28c1aa12f5de
test-extension: do not depend on demandimport (issue5012)
Jun Wu <quark@fb.com>
parents:
27152
diff
changeset
|
235 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root) |
19933
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
236 (extroot) from extroot.bar import *: this is extroot.bar |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
237 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
238 (extroot) import extroot: this is extroot.__init__ |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
239 (extroot) from extroot.bar import s: this is extroot.bar |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
240 (extroot) import extroot.bar in func(): this is extroot.bar |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
241 $TESTTMP/a (glob) |
19933
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
242 |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
243 #if no-py3k |
20002
83347ff50134
tests: quote environment variable to extract wildcard on MinGW environment
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20001
diff
changeset
|
244 $ rm "$TESTTMP"/extroot/foo.* |
19933
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
245 $ cat > $TESTTMP/extroot/foo.py <<EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
246 > # test relative import |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
247 > buf = [] |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
248 > def func(): |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
249 > # "not locals" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
250 > import bar |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
251 > buf.append('import bar in func(): %s' % bar.s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
252 > return '\n(extroot) '.join(buf) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
253 > # "fromlist == ('*',)" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
254 > from bar import * |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
255 > buf.append('from bar import *: %s' % s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
256 > # "not fromlist" and "if '.' in name" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
257 > import sub1.baz |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
258 > buf.append('import sub1.baz: %s' % sub1.baz.s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
259 > # "not fromlist" and NOT "if '.' in name" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
260 > import sub1 |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
261 > buf.append('import sub1: %s' % sub1.s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
262 > # NOT "not fromlist" and NOT "level != -1" case |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
263 > from bar import s |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
264 > buf.append('from bar import s: %s' % s) |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
265 > EOF |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
266 $ hg --config extensions.extroot=$TESTTMP/extroot root |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
267 (extroot) from bar import *: this is extroot.bar |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
268 (extroot) import sub1.baz: this is extroot.sub1.baz |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
269 (extroot) import sub1: this is extroot.sub1.__init__ |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
270 (extroot) from bar import s: this is extroot.bar |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
271 (extroot) import bar in func(): this is extroot.bar |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
272 $TESTTMP/a (glob) |
19933
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
273 #endif |
621a26eb3a99
demandimport: allow extensions to import own modules by absolute name
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
19932
diff
changeset
|
274 |
29869
0a9cd6e324cd
tests: guard demandimport segment of test-extension.t
timeless <timeless@mozdev.org>
parents:
29840
diff
changeset
|
275 #if demandimport absimport |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
276 |
30332
318a24b52eeb
spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents:
30306
diff
changeset
|
277 Examine whether module loading is delayed until actual referring, even |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
278 though module is imported with "absolute_import" feature. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
279 |
30332
318a24b52eeb
spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents:
30306
diff
changeset
|
280 Files below in each packages are used for described purpose: |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
281 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
282 - "called": examine whether "from MODULE import ATTR" works correctly |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
283 - "unused": examine whether loading is delayed correctly |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
284 - "used": examine whether "from PACKAGE import MODULE" works correctly |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
285 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
286 Package hierarchy is needed to examine whether demand importing works |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
287 as expected for "from SUB.PACK.AGE import MODULE". |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
288 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
289 Setup "external library" to be imported with "absolute_import" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
290 feature. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
291 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
292 $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
293 $ touch $TESTTMP/extlibroot/__init__.py |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
294 $ touch $TESTTMP/extlibroot/lsub1/__init__.py |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
295 $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
296 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
297 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
298 > def func(): |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
299 > return "this is extlibroot.lsub1.lsub2.called.func()" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
300 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
301 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
302 > raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally") |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
303 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
304 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
305 > detail = "this is extlibroot.lsub1.lsub2.used" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
306 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
307 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
308 Setup sub-package of "external library", which causes instantiation of |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
309 demandmod in "recurse down the module chain" code path. Relative |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
310 importing with "absolute_import" feature isn't tested, because "level |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
311 >=1 " doesn't cause instantiation of demandmod. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
312 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
313 $ mkdir -p $TESTTMP/extlibroot/recursedown/abs |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
314 $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
315 > detail = "this is extlibroot.recursedown.abs.used" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
316 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
317 $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
318 > from __future__ import absolute_import |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
319 > from extlibroot.recursedown.abs.used import detail |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
320 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
321 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
322 $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
323 $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
324 > detail = "this is extlibroot.recursedown.legacy.used" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
325 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
326 $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
327 > # legacy style (level == -1) import |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
328 > from extlibroot.recursedown.legacy.used import detail |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
329 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
330 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
331 $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
332 > from __future__ import absolute_import |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
333 > from extlibroot.recursedown.abs import detail as absdetail |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
334 > from .legacy import detail as legacydetail |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
335 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
336 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
337 Setup extension local modules to be imported with "absolute_import" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
338 feature. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
339 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
340 $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
341 $ touch $TESTTMP/absextroot/xsub1/__init__.py |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
342 $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
343 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
344 $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
345 > def func(): |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
346 > return "this is absextroot.xsub1.xsub2.called.func()" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
347 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
348 $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
349 > raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally") |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
350 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
351 $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
352 > detail = "this is absextroot.xsub1.xsub2.used" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
353 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
354 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
355 Setup extension local modules to examine whether demand importing |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
356 works as expected in "level > 1" case. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
357 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
358 $ cat > $TESTTMP/absextroot/relimportee.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
359 > detail = "this is absextroot.relimportee" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
360 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
361 $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
362 > from __future__ import absolute_import |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
363 > from ... import relimportee |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
364 > detail = "this relimporter imports %r" % (relimportee.detail) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
365 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
366 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
367 Setup modules, which actually import extension local modules at |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
368 runtime. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
369 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
370 $ cat > $TESTTMP/absextroot/absolute.py << EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
371 > from __future__ import absolute_import |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
372 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
373 > # import extension local modules absolutely (level = 0) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
374 > from absextroot.xsub1.xsub2 import used, unused |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
375 > from absextroot.xsub1.xsub2.called import func |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
376 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
377 > def getresult(): |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
378 > result = [] |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
379 > result.append(used.detail) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
380 > result.append(func()) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
381 > return result |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
382 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
383 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
384 $ cat > $TESTTMP/absextroot/relative.py << EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
385 > from __future__ import absolute_import |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
386 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
387 > # import extension local modules relatively (level == 1) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
388 > from .xsub1.xsub2 import used, unused |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
389 > from .xsub1.xsub2.called import func |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
390 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
391 > # import a module, which implies "importing with level > 1" |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
392 > from .xsub1.xsub2 import relimporter |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
393 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
394 > def getresult(): |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
395 > result = [] |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
396 > result.append(used.detail) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
397 > result.append(func()) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
398 > result.append(relimporter.detail) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
399 > return result |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
400 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
401 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
402 Setup main procedure of extension. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
403 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
404 $ cat > $TESTTMP/absextroot/__init__.py <<EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
405 > from __future__ import absolute_import |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
406 > from mercurial import registrar |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
407 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
408 > command = registrar.command(cmdtable) |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
409 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
410 > # "absolute" and "relative" shouldn't be imported before actual |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
411 > # command execution, because (1) they import same modules, and (2) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
412 > # preceding import (= instantiate "demandmod" object instead of |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
413 > # real "module" object) might hide problem of succeeding import. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
414 > |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
415 > @command(b'showabsolute', [], norepo=True) |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
416 > def showabsolute(ui, *args, **opts): |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
417 > from absextroot import absolute |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
418 > ui.write('ABS: %s\n' % '\nABS: '.join(absolute.getresult())) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
419 > |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
420 > @command(b'showrelative', [], norepo=True) |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
421 > def showrelative(ui, *args, **opts): |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
422 > from . import relative |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
423 > ui.write('REL: %s\n' % '\nREL: '.join(relative.getresult())) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
424 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
425 > # import modules from external library |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
426 > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
427 > from extlibroot.lsub1.lsub2.called import func as lfunc |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
428 > from extlibroot.recursedown import absdetail, legacydetail |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
429 > |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
430 > def uisetup(ui): |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
431 > result = [] |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
432 > result.append(lused.detail) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
433 > result.append(lfunc()) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
434 > result.append(absdetail) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
435 > result.append(legacydetail) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
436 > ui.write('LIB: %s\n' % '\nLIB: '.join(result)) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
437 > EOF |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
438 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
439 Examine module importing. |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
440 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
441 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
442 LIB: this is extlibroot.lsub1.lsub2.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
443 LIB: this is extlibroot.lsub1.lsub2.called.func() |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
444 LIB: this is extlibroot.recursedown.abs.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
445 LIB: this is extlibroot.recursedown.legacy.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
446 ABS: this is absextroot.xsub1.xsub2.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
447 ABS: this is absextroot.xsub1.xsub2.called.func() |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
448 |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
449 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative) |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
450 LIB: this is extlibroot.lsub1.lsub2.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
451 LIB: this is extlibroot.lsub1.lsub2.called.func() |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
452 LIB: this is extlibroot.recursedown.abs.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
453 LIB: this is extlibroot.recursedown.legacy.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
454 REL: this is absextroot.xsub1.xsub2.used |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
455 REL: this is absextroot.xsub1.xsub2.called.func() |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
456 REL: this relimporter imports 'this is absextroot.relimportee' |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
457 |
29736
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
458 Examine whether sub-module is imported relatively as expected. |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
459 |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
460 See also issue5208 for detail about example case on Python 3.x. |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
461 |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
462 $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
463 $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
464 |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
465 $ cat > $TESTTMP/notexist.py <<EOF |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
466 > text = 'notexist.py at root is loaded unintentionally\n' |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
467 > EOF |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
468 |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
469 $ cat > $TESTTMP/checkrelativity.py <<EOF |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
470 > from mercurial import registrar |
29736
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
471 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
472 > command = registrar.command(cmdtable) |
29736
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
473 > |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
474 > # demand import avoids failure of importing notexist here |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
475 > import extlibroot.lsub1.lsub2.notexist |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
476 > |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
477 > @command(b'checkrelativity', [], norepo=True) |
29736
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
478 > def checkrelativity(ui, *args, **opts): |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
479 > try: |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
480 > ui.write(extlibroot.lsub1.lsub2.notexist.text) |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
481 > return 1 # unintentional success |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
482 > except ImportError: |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
483 > pass # intentional failure |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
484 > EOF |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
485 |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
486 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) |
14f077f7519a
demandimport: import sub-module relatively as expected (issue5208)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29375
diff
changeset
|
487 |
29375
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
488 #endif |
fcaf20175b1b
demandimport: delay loading for "from a import b" with absolute_import
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
29198
diff
changeset
|
489 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
490 $ cd .. |
9661
c4f6c02e33c4
hgweb: added test case for extension loading phases (issue1824)
Yuya Nishihara <yuya@tcha.org>
parents:
9410
diff
changeset
|
491 |
17014
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16853
diff
changeset
|
492 hide outer repo |
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16853
diff
changeset
|
493 $ hg init |
50fbe9063ff2
tests: convert some 'hghave no-outer-repo' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16853
diff
changeset
|
494 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
495 $ cat > empty.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
496 > '''empty cmdtable |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
497 > ''' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
498 > cmdtable = {} |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
499 > EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
500 $ emptypath=`pwd`/empty.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
501 $ echo "empty = $emptypath" >> $HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
502 $ hg help empty |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
503 empty extension - empty cmdtable |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
504 |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
505 no commands defined |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
506 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
507 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
508 $ echo 'empty = !' >> $HGRCPATH |
9661
c4f6c02e33c4
hgweb: added test case for extension loading phases (issue1824)
Yuya Nishihara <yuya@tcha.org>
parents:
9410
diff
changeset
|
509 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
510 $ cat > debugextension.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
511 > '''only debugcommands |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
512 > ''' |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
513 > from mercurial import registrar |
21254
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
20003
diff
changeset
|
514 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
515 > command = registrar.command(cmdtable) |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
516 > @command(b'debugfoobar', [], 'hg debugfoobar') |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
517 > def debugfoobar(ui, repo, *args, **opts): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
518 > "yet another debug command" |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
519 > pass |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
520 > @command(b'foo', [], 'hg foo') |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
521 > def foo(ui, repo, *args, **opts): |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
522 > """yet another foo command |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
523 > This command has been DEPRECATED since forever. |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
524 > """ |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
525 > pass |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
526 > EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
527 $ debugpath=`pwd`/debugextension.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
528 $ echo "debugextension = $debugpath" >> $HGRCPATH |
9410
1c83938b6a8e
extensions: load and configure extensions in well-defined phases
Martin Geisler <mg@lazybytes.net>
parents:
9128
diff
changeset
|
529 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
530 $ hg help debugextension |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
531 hg debugextensions |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
532 |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
533 show information about active extensions |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
534 |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
535 options: |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
536 |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
537 (some details hidden, use --verbose to show complete help) |
4950
93b7e2fa7ee3
help: avoid traceback if an extension has only debug commands
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4738
diff
changeset
|
538 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
539 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
540 $ hg --verbose help debugextension |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
541 hg debugextensions |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
542 |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
543 show information about active extensions |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
544 |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
545 options: |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
546 |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
547 -T --template TEMPLATE display with template (EXPERIMENTAL) |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
548 |
22117
c1d93edcf004
help: fold repeatable option message into option table header
Matt Mackall <mpm@selenic.com>
parents:
22113
diff
changeset
|
549 global options ([+] can be repeated): |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
550 |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
551 -R --repository REPO repository root directory or name of overlay bundle |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
552 file |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
553 --cwd DIR change working directory |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
554 -y --noninteractive do not prompt, automatically pick the first choice for |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
555 all prompts |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
556 -q --quiet suppress output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
557 -v --verbose enable additional output |
31104
8346b2f09e79
color: add the definition of '--color' in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30993
diff
changeset
|
558 --color TYPE when to colorize (boolean, always, auto, never, or |
31123
df0a0734304a
color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
31110
diff
changeset
|
559 debug) |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
560 --config CONFIG [+] set/override config option (use 'section.name=value') |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
561 --debug enable debugging output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
562 --debugger start debugger |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
563 --encoding ENCODE set the charset encoding (default: ascii) |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
564 --encodingmode MODE set the charset encoding mode (default: strict) |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
565 --traceback always print a traceback on exception |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
566 --time time how long the command takes |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
567 --profile print command execution profile |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
568 --version output version information and exit |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
569 -h --help display help and exit |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
570 --hidden consider hidden changesets |
30993
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
571 --pager TYPE when to paginate (boolean, always, auto, or never) |
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
572 (default: auto) |
9128
98d90ad54749
commands: hide deprecated commands.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
8189
diff
changeset
|
573 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
574 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
575 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
576 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
577 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
578 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
579 $ hg --debug help debugextension |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
580 hg debugextensions |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
581 |
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
582 show information about active extensions |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
583 |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
584 options: |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
585 |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
586 -T --template TEMPLATE display with template (EXPERIMENTAL) |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
587 |
22117
c1d93edcf004
help: fold repeatable option message into option table header
Matt Mackall <mpm@selenic.com>
parents:
22113
diff
changeset
|
588 global options ([+] can be repeated): |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
589 |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
590 -R --repository REPO repository root directory or name of overlay bundle |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
591 file |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
592 --cwd DIR change working directory |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
593 -y --noninteractive do not prompt, automatically pick the first choice for |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
594 all prompts |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
595 -q --quiet suppress output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
596 -v --verbose enable additional output |
31104
8346b2f09e79
color: add the definition of '--color' in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30993
diff
changeset
|
597 --color TYPE when to colorize (boolean, always, auto, never, or |
31123
df0a0734304a
color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
31110
diff
changeset
|
598 debug) |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
599 --config CONFIG [+] set/override config option (use 'section.name=value') |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
600 --debug enable debugging output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
601 --debugger start debugger |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
602 --encoding ENCODE set the charset encoding (default: ascii) |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
603 --encodingmode MODE set the charset encoding mode (default: strict) |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
604 --traceback always print a traceback on exception |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
605 --time time how long the command takes |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
606 --profile print command execution profile |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
607 --version output version information and exit |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
608 -h --help display help and exit |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
609 --hidden consider hidden changesets |
30993
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
610 --pager TYPE when to paginate (boolean, always, auto, or never) |
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
611 (default: auto) |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
612 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
613 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
614 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
615 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
616 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
617 $ echo 'debugextension = !' >> $HGRCPATH |
7011
7da76778dbd7
Do not try to load extensions twice (issue811)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
618 |
27152
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
619 Asking for help about a deprecated extension should do something useful: |
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
620 |
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
621 $ hg help glog |
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
622 'glog' is provided by the following extension: |
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
623 |
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
624 graphlog command to view revision graphs from a shell (DEPRECATED) |
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
625 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
626 (use 'hg help extensions' for information on enabling extensions) |
27152
ac27b1b3be85
help: make help deprecated mention the extension
timeless <timeless@mozdev.org>
parents:
27142
diff
changeset
|
627 |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
628 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
|
629 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
630 $ echo 'extdiff =' >> $HGRCPATH |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
631 $ hg help extdiff |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
632 hg extdiff [OPT]... [FILE]... |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
633 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
634 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
|
635 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
636 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
|
637 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
|
638 "-Npru". |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
639 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
640 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
|
641 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
|
642 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
|
643 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
|
644 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
645 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
|
646 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
|
647 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
|
648 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
|
649 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
650 (use 'hg help -e extdiff' to show help for the extdiff extension) |
14285
aa64a87b493d
help: give hint about 'hg help -e' when appropriate
Martin Geisler <mg@aragost.com>
parents:
14284
diff
changeset
|
651 |
22117
c1d93edcf004
help: fold repeatable option message into option table header
Matt Mackall <mpm@selenic.com>
parents:
22113
diff
changeset
|
652 options ([+] can be repeated): |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
653 |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
654 -p --program CMD comparison program to run |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
655 -o --option OPT [+] pass option to comparison program |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
656 -r --rev REV [+] revision |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
657 -c --change REV change made by revision |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
658 --patch compare patches for two revisions |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
659 -I --include PATTERN [+] include names matching the given patterns |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14849
diff
changeset
|
660 -X --exclude PATTERN [+] exclude names matching the given patterns |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
661 -S --subrepos recurse into subrepositories |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
662 |
22110
26f7c8033bed
help: tweak --verbose command help hint
Matt Mackall <mpm@selenic.com>
parents:
21937
diff
changeset
|
663 (some details hidden, use --verbose to show complete help) |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
664 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
665 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
666 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
667 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
668 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
669 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
670 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
671 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
672 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
673 |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
674 $ hg help --extension extdiff |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
675 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
|
676 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
677 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
|
678 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
|
679 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
|
680 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
|
681 |
14327
d943412e2fba
extdiff: grammar "allows to" -> "allows one to"
Javi Merino <cibervicho@gmail.com>
parents:
14286
diff
changeset
|
682 The extdiff extension also allows you to configure new diff commands, so you |
27729
58f8b29c37ff
minirst: change hgrole to use single quotes
timeless <timeless@mozdev.org>
parents:
27491
diff
changeset
|
683 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
|
684 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
685 [extdiff] |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
686 # 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
|
687 cdiff = gdiff -Nprc5 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
688 ## or the old way: |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
689 #cmd.cdiff = gdiff |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
690 #opts.cdiff = -Nprc5 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
691 |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22947
diff
changeset
|
692 # add new command called meld, runs meld (no need to name twice). If |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22947
diff
changeset
|
693 # the meld executable is not available, the meld tool in [merge-tools] |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22947
diff
changeset
|
694 # will be used, if available |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
695 meld = |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
696 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
697 # 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
|
698 # (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
|
699 # 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
|
700 # your .vimrc |
16242
55174ab81973
extdiff: escape filenames with vim/DirDiff and make quoting work with Windows
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15862
diff
changeset
|
701 vimdiff = gvim -f "+next" \ |
55174ab81973
extdiff: escape filenames with vim/DirDiff and make quoting work with Windows
Thomas Arendsen Hein <thomas@intevation.de>
parents:
15862
diff
changeset
|
702 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))" |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
703 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
704 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
|
705 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
706 $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
|
707 $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
|
708 $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
|
709 $root - repository root |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
710 $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
|
711 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
712 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
|
713 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
|
714 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
715 [extdiff] |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
716 kdiff3 = |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
717 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
718 [diff-tools] |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
719 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
|
720 |
27729
58f8b29c37ff
minirst: change hgrole to use single quotes
timeless <timeless@mozdev.org>
parents:
27491
diff
changeset
|
721 You can use -I/-X and list of file or directory names like normal 'hg diff' |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
722 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
|
723 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
|
724 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
|
725 |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
726 list of commands: |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
727 |
16853
7863ff383894
help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents:
16744
diff
changeset
|
728 extdiff use external program to diff repository (or selected files) |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
729 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
730 (use 'hg help -v -e extdiff' to show built-in aliases and global options) |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
731 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
732 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
733 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
734 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
735 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
736 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
737 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
738 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
739 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
740 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
741 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
742 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
743 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
744 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
745 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
746 |
14284
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
747 $ echo 'extdiff = !' >> $HGRCPATH |
1f9e11f65cd7
help: add -e/--extension switch to display extension help text
Henri Wiechers <hwiechers@gmail.com>
parents:
13191
diff
changeset
|
748 |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
749 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
|
750 |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
751 $ cat > multirevs.py <<EOF |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
752 > from mercurial import commands, registrar |
21254
51e5c793a9f4
tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents:
20003
diff
changeset
|
753 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
754 > command = registrar.command(cmdtable) |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
755 > """multirevs extension |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
756 > Big multi-line module docstring.""" |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
757 > @command(b'multirevs', [], 'ARG', norepo=True) |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
758 > 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
|
759 > """multirevs command""" |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
760 > pass |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
761 > EOF |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
762 $ 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
|
763 |
30610
66cffa87d2f2
help: make multirevs just an alias for revsets
Martin von Zweigbergk <martinvonz@google.com>
parents:
30485
diff
changeset
|
764 $ hg help multirevs | tail |
30771
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30610
diff
changeset
|
765 bookmark (this works because the last revision of the revset is used): |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
766 |
30771
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30610
diff
changeset
|
767 hg update :@ |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
768 |
30771
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30610
diff
changeset
|
769 - Show diff between tags 1.3 and 1.5 (this works because the first and the |
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30610
diff
changeset
|
770 last revisions of the revset are used): |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
771 |
30771
c2cbc1b050db
help: explain that revsets can be used where 1 or 2 revs are wanted
Martin von Zweigbergk <martinvonz@google.com>
parents:
30610
diff
changeset
|
772 hg diff -r 1.3::1.5 |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
773 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
774 use 'hg help -c multirevs' to see help for the multirevs command |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
775 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
776 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
777 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
778 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
779 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
780 |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
781 $ 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
|
782 hg multirevs ARG |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
783 |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
784 multirevs command |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
785 |
22110
26f7c8033bed
help: tweak --verbose command help hint
Matt Mackall <mpm@selenic.com>
parents:
21937
diff
changeset
|
786 (some details hidden, use --verbose to show complete help) |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
787 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
788 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
789 |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
790 $ hg multirevs |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
791 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
|
792 hg multirevs ARG |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
793 |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
794 multirevs command |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
795 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
796 (use 'hg multirevs -h' to show more help) |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
797 [255] |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
798 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
799 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
800 |
14286
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
801 $ echo "multirevs = !" >> $HGRCPATH |
005a540e9aee
help: add -c/--command flag to only show command help (issue2799)
Martin Geisler <mg@aragost.com>
parents:
14285
diff
changeset
|
802 |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12327
diff
changeset
|
803 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
|
804 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
805 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
806 > mq = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
807 > strip = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
808 > hgext.mq = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
809 > hgext/mq = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
810 > EOF |
7011
7da76778dbd7
Do not try to load extensions twice (issue811)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
811 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
812 Show extensions: |
19822
a194a33f8cb2
mq: prepare a strip extension for extraction
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19777
diff
changeset
|
813 (note that mq force load strip, also checking it's not loaded twice) |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
814 |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
815 $ hg debugextensions |
26351
8c7d8d5e1e0f
mercurial: add debugextensions command (issue4676)
liscju <piotr.listkiewicz@gmail.com>
parents:
26263
diff
changeset
|
816 mq |
19822
a194a33f8cb2
mq: prepare a strip extension for extraction
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19777
diff
changeset
|
817 strip |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
818 |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
819 For extensions, which name matches one of its commands, help |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
820 message should ask '-v -e' to get list of built-in aliases |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
821 along with extension help itself |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
822 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
823 $ mkdir $TESTTMP/d |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
824 $ cat > $TESTTMP/d/dodo.py <<EOF |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
825 > """ |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
826 > This is an awesome 'dodo' extension. It does nothing and |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
827 > writes 'Foo foo' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
828 > """ |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
829 > from mercurial import commands, registrar |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
830 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
831 > command = registrar.command(cmdtable) |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
832 > @command(b'dodo', [], 'hg dodo') |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
833 > def dodo(ui, *args, **kwargs): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
834 > """Does nothing""" |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
835 > ui.write("I do nothing. Yay\\n") |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
836 > @command(b'foofoo', [], 'hg foofoo') |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
837 > def foofoo(ui, *args, **kwargs): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
838 > """Writes 'Foo foo'""" |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
839 > ui.write("Foo foo\\n") |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
840 > EOF |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
841 $ dodopath=$TESTTMP/d/dodo.py |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
842 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
843 $ echo "dodo = $dodopath" >> $HGRCPATH |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
844 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
845 Make sure that user is asked to enter '-v -e' to get list of built-in aliases |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
846 $ hg help -e dodo |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
847 dodo extension - |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
848 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
849 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
850 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
851 list of commands: |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
852 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
853 dodo Does nothing |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
854 foofoo Writes 'Foo foo' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
855 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
856 (use 'hg help -v -e dodo' to show built-in aliases and global options) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
857 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
858 Make sure that '-v -e' prints list of built-in aliases along with |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
859 extension help itself |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
860 $ hg help -v -e dodo |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
861 dodo extension - |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
862 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
863 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
864 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
865 list of commands: |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
866 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
867 dodo Does nothing |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
868 foofoo Writes 'Foo foo' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
869 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
870 global options ([+] can be repeated): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
871 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
872 -R --repository REPO repository root directory or name of overlay bundle |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
873 file |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
874 --cwd DIR change working directory |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
875 -y --noninteractive do not prompt, automatically pick the first choice for |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
876 all prompts |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
877 -q --quiet suppress output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
878 -v --verbose enable additional output |
31104
8346b2f09e79
color: add the definition of '--color' in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30993
diff
changeset
|
879 --color TYPE when to colorize (boolean, always, auto, never, or |
31123
df0a0734304a
color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
31110
diff
changeset
|
880 debug) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
881 --config CONFIG [+] set/override config option (use 'section.name=value') |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
882 --debug enable debugging output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
883 --debugger start debugger |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
884 --encoding ENCODE set the charset encoding (default: ascii) |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
885 --encodingmode MODE set the charset encoding mode (default: strict) |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
886 --traceback always print a traceback on exception |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
887 --time time how long the command takes |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
888 --profile print command execution profile |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
889 --version output version information and exit |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
890 -h --help display help and exit |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
891 --hidden consider hidden changesets |
30993
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
892 --pager TYPE when to paginate (boolean, always, auto, or never) |
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
893 (default: auto) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
894 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
895 Make sure that single '-v' option shows help and built-ins only for 'dodo' command |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
896 $ hg help -v dodo |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
897 hg dodo |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
898 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
899 Does nothing |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
900 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
901 (use 'hg help -e dodo' to show help for the dodo extension) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
902 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
903 options: |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
904 |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
905 --mq operate on patch repository |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
906 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
907 global options ([+] can be repeated): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
908 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
909 -R --repository REPO repository root directory or name of overlay bundle |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
910 file |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
911 --cwd DIR change working directory |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
912 -y --noninteractive do not prompt, automatically pick the first choice for |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
913 all prompts |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
914 -q --quiet suppress output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
915 -v --verbose enable additional output |
31104
8346b2f09e79
color: add the definition of '--color' in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30993
diff
changeset
|
916 --color TYPE when to colorize (boolean, always, auto, never, or |
31123
df0a0734304a
color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
31110
diff
changeset
|
917 debug) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
918 --config CONFIG [+] set/override config option (use 'section.name=value') |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
919 --debug enable debugging output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
920 --debugger start debugger |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
921 --encoding ENCODE set the charset encoding (default: ascii) |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
922 --encodingmode MODE set the charset encoding mode (default: strict) |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
923 --traceback always print a traceback on exception |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
924 --time time how long the command takes |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
925 --profile print command execution profile |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
926 --version output version information and exit |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
927 -h --help display help and exit |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
928 --hidden consider hidden changesets |
30993
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
929 --pager TYPE when to paginate (boolean, always, auto, or never) |
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
930 (default: auto) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
931 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
932 In case when extension name doesn't match any of its commands, |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
933 help message should ask for '-v' to get list of built-in aliases |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
934 along with extension help |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
935 $ cat > $TESTTMP/d/dudu.py <<EOF |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
936 > """ |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
937 > This is an awesome 'dudu' extension. It does something and |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
938 > also writes 'Beep beep' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
939 > """ |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
940 > from mercurial import commands, registrar |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
941 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
942 > command = registrar.command(cmdtable) |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
943 > @command(b'something', [], 'hg something') |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
944 > def something(ui, *args, **kwargs): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
945 > """Does something""" |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
946 > ui.write("I do something. Yaaay\\n") |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
947 > @command(b'beep', [], 'hg beep') |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
948 > def beep(ui, *args, **kwargs): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
949 > """Writes 'Beep beep'""" |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
950 > ui.write("Beep beep\\n") |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
951 > EOF |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
952 $ dudupath=$TESTTMP/d/dudu.py |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
953 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
954 $ echo "dudu = $dudupath" >> $HGRCPATH |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
955 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
956 $ hg help -e dudu |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
957 dudu extension - |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
958 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
959 This is an awesome 'dudu' extension. It does something and also writes 'Beep |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
960 beep' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
961 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
962 list of commands: |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
963 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
964 beep Writes 'Beep beep' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
965 something Does something |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
966 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
967 (use 'hg help -v dudu' to show built-in aliases and global options) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
968 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
969 In case when extension name doesn't match any of its commands, |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
970 help options '-v' and '-v -e' should be equivalent |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
971 $ hg help -v dudu |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
972 dudu extension - |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
973 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
974 This is an awesome 'dudu' extension. It does something and also writes 'Beep |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
975 beep' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
976 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
977 list of commands: |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
978 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
979 beep Writes 'Beep beep' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
980 something Does something |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
981 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
982 global options ([+] can be repeated): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
983 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
984 -R --repository REPO repository root directory or name of overlay bundle |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
985 file |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
986 --cwd DIR change working directory |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
987 -y --noninteractive do not prompt, automatically pick the first choice for |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
988 all prompts |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
989 -q --quiet suppress output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
990 -v --verbose enable additional output |
31104
8346b2f09e79
color: add the definition of '--color' in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30993
diff
changeset
|
991 --color TYPE when to colorize (boolean, always, auto, never, or |
31123
df0a0734304a
color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
31110
diff
changeset
|
992 debug) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
993 --config CONFIG [+] set/override config option (use 'section.name=value') |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
994 --debug enable debugging output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
995 --debugger start debugger |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
996 --encoding ENCODE set the charset encoding (default: ascii) |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
997 --encodingmode MODE set the charset encoding mode (default: strict) |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
998 --traceback always print a traceback on exception |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
999 --time time how long the command takes |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1000 --profile print command execution profile |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1001 --version output version information and exit |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1002 -h --help display help and exit |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1003 --hidden consider hidden changesets |
30993
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
1004 --pager TYPE when to paginate (boolean, always, auto, or never) |
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
1005 (default: auto) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1006 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1007 $ hg help -v -e dudu |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1008 dudu extension - |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1009 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1010 This is an awesome 'dudu' extension. It does something and also writes 'Beep |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1011 beep' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1012 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1013 list of commands: |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1014 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1015 beep Writes 'Beep beep' |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1016 something Does something |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1017 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1018 global options ([+] can be repeated): |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1019 |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1020 -R --repository REPO repository root directory or name of overlay bundle |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1021 file |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1022 --cwd DIR change working directory |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1023 -y --noninteractive do not prompt, automatically pick the first choice for |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1024 all prompts |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1025 -q --quiet suppress output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1026 -v --verbose enable additional output |
31104
8346b2f09e79
color: add the definition of '--color' in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30993
diff
changeset
|
1027 --color TYPE when to colorize (boolean, always, auto, never, or |
31123
df0a0734304a
color: update main documentation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
31110
diff
changeset
|
1028 debug) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1029 --config CONFIG [+] set/override config option (use 'section.name=value') |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1030 --debug enable debugging output |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1031 --debugger start debugger |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1032 --encoding ENCODE set the charset encoding (default: ascii) |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1033 --encodingmode MODE set the charset encoding mode (default: strict) |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1034 --traceback always print a traceback on exception |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1035 --time time how long the command takes |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1036 --profile print command execution profile |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1037 --version output version information and exit |
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1038 -h --help display help and exit |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
1039 --hidden consider hidden changesets |
30993
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
1040 --pager TYPE when to paginate (boolean, always, auto, or never) |
9c2977ceaa46
pager: move more behavior into core
Augie Fackler <augie@google.com>
parents:
30771
diff
changeset
|
1041 (default: auto) |
23624
861ddedfb402
help: suggest '-v -e' to get built-in aliases for extensions (issue4461)
Chingis Dugarzhapov <chingis.dug@gmail.com>
parents:
23172
diff
changeset
|
1042 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1043 Disabled extension commands: |
10364
de1e7099d100
dispatch: provide help for disabled extensions and commands
Brodie Rao <me+hg@dackz.net>
parents:
9802
diff
changeset
|
1044 |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1045 $ ORGHGRCPATH=$HGRCPATH |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1046 $ HGRCPATH= |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1047 $ export HGRCPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1048 $ hg help email |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1049 'email' is provided by the following extension: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1050 |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15447
diff
changeset
|
1051 patchbomb command to send changesets as (a series of) patch emails |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1052 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
1053 (use 'hg help extensions' for information on enabling extensions) |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1054 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1055 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1056 $ hg qdel |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1057 hg: unknown command 'qdel' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1058 'qdelete' is provided by the following extension: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1059 |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15447
diff
changeset
|
1060 mq manage a stack of patches |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1061 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
1062 (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
|
1063 [255] |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1064 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1065 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1066 $ hg churn |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1067 hg: unknown command 'churn' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1068 'churn' is provided by the following extension: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1069 |
15861
ee8f5e4ce7b8
minirst: simplify and standardize field list formatting
Olav Reinert <seroton10@gmail.com>
parents:
15447
diff
changeset
|
1070 churn command to display statistics about repository history |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1071 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
1072 (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
|
1073 [255] |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1074 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1075 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1076 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1077 Disabled extensions: |
10364
de1e7099d100
dispatch: provide help for disabled extensions and commands
Brodie Rao <me+hg@dackz.net>
parents:
9802
diff
changeset
|
1078 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1079 $ hg help churn |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1080 churn extension - command to display statistics about repository history |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1081 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
1082 (use 'hg help extensions' for information on enabling extensions) |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1083 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1084 $ hg help patchbomb |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1085 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
|
1086 |
30306
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1087 The series is started off with a "[PATCH 0 of N]" introduction, which |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1088 describes the series as a whole. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1089 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1090 Each patch email has a Subject line of "[PATCH M of N] ...", using the first |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1091 line of the changeset description as the subject text. The message contains |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1092 two or three body parts: |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1093 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1094 - The changeset description. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1095 - [Optional] The result of running diffstat on the patch. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1096 - The patch itself, as generated by 'hg export'. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1097 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1098 Each message refers to the first in the series using the In-Reply-To and |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1099 References headers, so they will show up as a sequence in threaded mail and |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1100 news readers, and in mail archives. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1101 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1102 To configure other defaults, add a section like this to your configuration |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1103 file: |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1104 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1105 [email] |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1106 from = My Name <my@email> |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1107 to = recipient1, recipient2, ... |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1108 cc = cc1, cc2, ... |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1109 bcc = bcc1, bcc2, ... |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1110 reply-to = address1, address2, ... |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1111 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1112 Use "[patchbomb]" as configuration section name if you need to override global |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1113 "[email]" address settings. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1114 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1115 Then you can use the 'hg email' command to mail a series of changesets as a |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1116 patchbomb. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1117 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1118 You can also either configure the method option in the email section to be a |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1119 sendmail compatible mailer or fill out the [smtp] section so that the |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1120 patchbomb extension can automatically send patchbombs directly from the |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1121 commandline. See the [email] and [smtp] sections in hgrc(5) for details. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1122 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1123 By default, 'hg email' will prompt for a "To" or "CC" header if you do not |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1124 supply one via configuration or the command line. You can override this to |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1125 never prompt by configuring an empty value: |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1126 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1127 [email] |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1128 cc = |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1129 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1130 You can control the default inclusion of an introduction message with the |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1131 "patchbomb.intro" configuration option. The configuration is always |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1132 overwritten by command line flags like --intro and --desc: |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1133 |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1134 [patchbomb] |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1135 intro=auto # include introduction message if more than 1 patch (default) |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1136 intro=never # never include an introduction message |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1137 intro=always # always include an introduction message |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1138 |
31187
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1139 You can specify a template for flags to be added in subject prefixes. Flags |
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1140 specified by --flag option are exported as "{flags}" keyword: |
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1141 |
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1142 [patchbomb] |
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1143 flagtemplate = "{separate(' ', |
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1144 ifeq(branch, 'default', '', branch|upper), |
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1145 flags)}" |
6b8e1a08ef1d
patchbomb: add config knob to generate flags by template (issue5354)
Yuya Nishihara <yuya@tcha.org>
parents:
31123
diff
changeset
|
1146 |
30306
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1147 You can set patchbomb to always ask for confirmation by setting |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1148 "patchbomb.confirm" to true. |
5581b294f3c6
help: show help for disabled extensions (issue5228)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30152
diff
changeset
|
1149 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
1150 (use 'hg help extensions' for information on enabling extensions) |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1151 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1152 |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1153 Broken disabled extension and command: |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1154 |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1155 $ mkdir hgext |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1156 $ echo > hgext/__init__.py |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1157 $ cat > hgext/broken.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1158 > "broken extension' |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1159 > EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1160 $ cat > path.py <<EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1161 > import os, sys |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1162 > sys.path.insert(0, os.environ['HGEXTPATH']) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1163 > EOF |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1164 $ HGEXTPATH=`pwd` |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1165 $ export HGEXTPATH |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1166 |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1167 $ hg --config extensions.path=./path.py help broken |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1168 broken extension - (no help text available) |
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1169 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
1170 (use 'hg help extensions' for information on enabling extensions) |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1171 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1172 |
13191
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
1173 $ cat > hgext/forest.py <<EOF |
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
1174 > cmdtable = None |
1aea66b71f4f
extensions: warn about invalid extensions when listing disabled commands
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
1175 > EOF |
12191
56c74b2df53d
tests: unify test-extension
Adrian Buehlmann <adrian@cadifra.com>
parents:
11070
diff
changeset
|
1176 $ hg --config extensions.path=./path.py help foo > /dev/null |
15447
9910f60a37ee
tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents:
15202
diff
changeset
|
1177 warning: error finding commands in $TESTTMP/hgext/forest.py (glob) |
21289
c3784e3c3e8d
help: suggest keyword search when no topic is found
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
21254
diff
changeset
|
1178 abort: no such help topic: foo |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29885
diff
changeset
|
1179 (try 'hg help --keyword foo') |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12191
diff
changeset
|
1180 [255] |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1181 |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1182 $ cat > throw.py <<EOF |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
1183 > from mercurial import commands, registrar, util |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1184 > cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
31187
diff
changeset
|
1185 > command = registrar.command(cmdtable) |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1186 > class Bogon(Exception): pass |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
1187 > @command(b'throw', [], 'hg throw', norepo=True) |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1188 > def throw(ui, **opts): |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1189 > """throws an exception""" |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1190 > raise Bogon() |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1191 > EOF |
23869
d9967b82394a
test-extension: improve test readability
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23624
diff
changeset
|
1192 |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1193 No declared supported version, extension complains: |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1194 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1195 ** Unknown exception encountered with possibly-broken third-party extension throw |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1196 ** which supports versions unknown of Mercurial. |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1197 ** Please disable throw and try your action again. |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1198 ** If that fixes the bug please report it to the extension author. |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1199 ** Python * (glob) |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1200 ** Mercurial Distributed SCM * (glob) |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1201 ** Extensions loaded: throw |
23869
d9967b82394a
test-extension: improve test readability
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23624
diff
changeset
|
1202 |
18224
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1203 empty declaration of supported version, extension complains: |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1204 $ echo "testedwith = ''" >> throw.py |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1205 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1206 ** Unknown exception encountered with possibly-broken third-party extension throw |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1207 ** which supports versions unknown of Mercurial. |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1208 ** Please disable throw and try your action again. |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1209 ** If that fixes the bug please report it to the extension author. |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1210 ** Python * (glob) |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1211 ** Mercurial Distributed SCM (*) (glob) |
0f9013112eba
dispatch: handle empty `testedwith` value in extension
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
17837
diff
changeset
|
1212 ** Extensions loaded: throw |
23869
d9967b82394a
test-extension: improve test readability
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23624
diff
changeset
|
1213 |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1214 If the extension specifies a buglink, show that: |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1215 $ echo 'buglink = "http://example.com/bts"' >> throw.py |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1216 $ rm -f throw.pyc throw.pyo |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1217 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1218 ** Unknown exception encountered with possibly-broken third-party extension throw |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1219 ** which supports versions unknown of Mercurial. |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1220 ** Please disable throw and try your action again. |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1221 ** If that fixes the bug please report it to http://example.com/bts |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1222 ** Python * (glob) |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1223 ** Mercurial Distributed SCM (*) (glob) |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1224 ** Extensions loaded: throw |
23869
d9967b82394a
test-extension: improve test readability
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23624
diff
changeset
|
1225 |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1226 If the extensions declare outdated versions, accuse the older extension first: |
17227
7af38fe1f829
test-extension.t: use fixed version string instead of current tag
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17014
diff
changeset
|
1227 $ echo "from mercurial import util" >> older.py |
7af38fe1f829
test-extension.t: use fixed version string instead of current tag
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17014
diff
changeset
|
1228 $ echo "util.version = lambda:'2.2'" >> older.py |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1229 $ echo "testedwith = '1.9.3'" >> older.py |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1230 $ echo "testedwith = '2.1.1'" >> throw.py |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1231 $ rm -f throw.pyc throw.pyo |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1232 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1233 > throw 2>&1 | egrep '^\*\*' |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1234 ** Unknown exception encountered with possibly-broken third-party extension older |
23871
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1235 ** which supports versions 1.9 of Mercurial. |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1236 ** Please disable older and try your action again. |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1237 ** If that fixes the bug please report it to the extension author. |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1238 ** Python * (glob) |
17228
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1239 ** Mercurial Distributed SCM (version 2.2) |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1240 ** Extensions loaded: throw, older |
23869
d9967b82394a
test-extension: improve test readability
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23624
diff
changeset
|
1241 |
17228
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1242 One extension only tested with older, one only with newer versions: |
23870
9070e20057ae
test-extension: use a realistic Mercurial version
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23869
diff
changeset
|
1243 $ echo "util.version = lambda:'2.1'" >> older.py |
17228
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1244 $ rm -f older.pyc older.pyo |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1245 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1246 > throw 2>&1 | egrep '^\*\*' |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1247 ** Unknown exception encountered with possibly-broken third-party extension older |
23871
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1248 ** which supports versions 1.9 of Mercurial. |
17228
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1249 ** Please disable older and try your action again. |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1250 ** If that fixes the bug please report it to the extension author. |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1251 ** Python * (glob) |
23870
9070e20057ae
test-extension: use a realistic Mercurial version
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23869
diff
changeset
|
1252 ** Mercurial Distributed SCM (version 2.1) |
17228
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1253 ** Extensions loaded: throw, older |
23869
d9967b82394a
test-extension: improve test readability
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23624
diff
changeset
|
1254 |
17228
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1255 Older extension is tested with current version, the other only with newer: |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1256 $ echo "util.version = lambda:'1.9.3'" >> older.py |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1257 $ rm -f older.pyc older.pyo |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1258 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1259 > throw 2>&1 | egrep '^\*\*' |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1260 ** Unknown exception encountered with possibly-broken third-party extension throw |
23871
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1261 ** which supports versions 2.1 of Mercurial. |
17228
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1262 ** Please disable throw and try your action again. |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1263 ** If that fixes the bug please report it to http://example.com/bts |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1264 ** Python * (glob) |
d1b49b02bc16
dispatch: fix traceback when extension was tested with newer versions only
Thomas Arendsen Hein <thomas@intevation.de>
parents:
17227
diff
changeset
|
1265 ** Mercurial Distributed SCM (version 1.9.3) |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1266 ** Extensions loaded: throw, older |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1267 |
26263
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1268 Ability to point to a different point |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1269 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1270 > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*' |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1271 ** unknown exception encountered, please report by visiting |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1272 ** Your Local Goat Lenders |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1273 ** Python * (glob) |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1274 ** Mercurial Distributed SCM (*) (glob) |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1275 ** Extensions loaded: throw, older |
bf2bfc6f45fb
traceback: allow providing a local support contact point
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26228
diff
changeset
|
1276 |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1277 Declare the version as supporting this hg version, show regular bts link: |
29198
a3e5e1fb257c
tests: use debuginstall to retrieve hg version
timeless <timeless@mozdev.org>
parents:
28623
diff
changeset
|
1278 $ hgver=`hg debuginstall -T '{hgver}'` |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1279 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py |
24257
31e9f66863f3
test: make version based test-extensions failure more explanatory
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24124
diff
changeset
|
1280 $ if [ -z "$hgver" ]; then |
31e9f66863f3
test: make version based test-extensions failure more explanatory
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24124
diff
changeset
|
1281 > echo "unable to fetch a mercurial version. Make sure __version__ is correct"; |
31e9f66863f3
test: make version based test-extensions failure more explanatory
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24124
diff
changeset
|
1282 > fi |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1283 $ rm -f throw.pyc throw.pyo |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1284 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1285 ** unknown exception encountered, please report by visiting |
26421
4b0fc75f9403
urls: bulk-change primary website URLs
Matt Mackall <mpm@selenic.com>
parents:
26351
diff
changeset
|
1286 ** https://mercurial-scm.org/wiki/BugTracker |
16744
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1287 ** Python * (glob) |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1288 ** Mercurial Distributed SCM (*) (glob) |
1c9f58a6c8f1
dispatch: try and identify third-party extensions as sources of tracebacks
Augie Fackler <raf@durin42.com>
parents:
16242
diff
changeset
|
1289 ** Extensions loaded: throw |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1290 |
23871
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1291 Patch version is ignored during compatibility check |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1292 $ echo "testedwith = '3.2'" >> throw.py |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1293 $ echo "util.version = lambda:'3.2.2'" >> throw.py |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1294 $ rm -f throw.pyc throw.pyo |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1295 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1296 ** unknown exception encountered, please report by visiting |
26421
4b0fc75f9403
urls: bulk-change primary website URLs
Matt Mackall <mpm@selenic.com>
parents:
26351
diff
changeset
|
1297 ** https://mercurial-scm.org/wiki/BugTracker |
23871
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1298 ** Python * (glob) |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1299 ** Mercurial Distributed SCM (*) (glob) |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1300 ** Extensions loaded: throw |
b2d8f3685b06
dispatch: only check compatibility against major and minor versions (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
23870
diff
changeset
|
1301 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1302 Test version number support in 'hg version': |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1303 $ echo '__version__ = (1, 2, 3)' >> throw.py |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1304 $ rm -f throw.pyc throw.pyo |
21937
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1305 $ hg version -v |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1306 Mercurial Distributed SCM (version *) (glob) |
26421
4b0fc75f9403
urls: bulk-change primary website URLs
Matt Mackall <mpm@selenic.com>
parents:
26351
diff
changeset
|
1307 (see https://mercurial-scm.org for more information) |
21937
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1308 |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1309 Copyright (C) 2005-* Matt Mackall and others (glob) |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1310 This is free software; see the source for copying conditions. There is NO |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1311 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1312 |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1313 Enabled extensions: |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1314 |
54ff2789d75e
version: don't traceback if no extensions to list (issue4312)
Matt Mackall <mpm@selenic.com>
parents:
21849
diff
changeset
|
1315 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1316 $ hg version -v --config extensions.throw=throw.py |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1317 Mercurial Distributed SCM (version *) (glob) |
26421
4b0fc75f9403
urls: bulk-change primary website URLs
Matt Mackall <mpm@selenic.com>
parents:
26351
diff
changeset
|
1318 (see https://mercurial-scm.org for more information) |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1319 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1320 Copyright (C) 2005-* Matt Mackall and others (glob) |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1321 This is free software; see the source for copying conditions. There is NO |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1322 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1323 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1324 Enabled extensions: |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1325 |
27990
96bfd2875213
version: verbose list internal and external extension source (issue4731)
liscju <piotr.listkiewicz@gmail.com>
parents:
27729
diff
changeset
|
1326 throw external 1.2.3 |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1327 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1328 $ rm -f throw.pyc throw.pyo |
29839
110ed1868f86
version: factor out mapping of internal/external labels
Yuya Nishihara <yuya@tcha.org>
parents:
29838
diff
changeset
|
1329 $ hg version -v --config extensions.throw=throw.py --config extensions.strip= |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1330 Mercurial Distributed SCM (version *) (glob) |
26421
4b0fc75f9403
urls: bulk-change primary website URLs
Matt Mackall <mpm@selenic.com>
parents:
26351
diff
changeset
|
1331 (see https://mercurial-scm.org for more information) |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1332 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1333 Copyright (C) 2005-* Matt Mackall and others (glob) |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1334 This is free software; see the source for copying conditions. There is NO |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1335 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1336 |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1337 Enabled extensions: |
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1338 |
27990
96bfd2875213
version: verbose list internal and external extension source (issue4731)
liscju <piotr.listkiewicz@gmail.com>
parents:
27729
diff
changeset
|
1339 throw external 1.twentythree |
29839
110ed1868f86
version: factor out mapping of internal/external labels
Yuya Nishihara <yuya@tcha.org>
parents:
29838
diff
changeset
|
1340 strip internal |
21849
a3306b8cdc0f
test-extension: add check for 'hg version -v' listing enabled extensions
Augie Fackler <raf@durin42.com>
parents:
21773
diff
changeset
|
1341 |
29838
8540133f91a1
version: always build list of extension versions
Yuya Nishihara <yuya@tcha.org>
parents:
29736
diff
changeset
|
1342 $ hg version -q --config extensions.throw=throw.py |
8540133f91a1
version: always build list of extension versions
Yuya Nishihara <yuya@tcha.org>
parents:
29736
diff
changeset
|
1343 Mercurial Distributed SCM (version *) (glob) |
8540133f91a1
version: always build list of extension versions
Yuya Nishihara <yuya@tcha.org>
parents:
29736
diff
changeset
|
1344 |
29840
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1345 Test JSON output of version: |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1346 |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1347 $ hg version -Tjson |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1348 [ |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1349 { |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1350 "extensions": [], |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1351 "ver": "*" (glob) |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1352 } |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1353 ] |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1354 |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1355 $ hg version --config extensions.throw=throw.py -Tjson |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1356 [ |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1357 { |
29885
42751543fa06
version: change "place" field of extension to "bundled" flag
Yuya Nishihara <yuya@tcha.org>
parents:
29869
diff
changeset
|
1358 "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}], |
29840
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1359 "ver": "3.2.2" |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1360 } |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1361 ] |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1362 |
29885
42751543fa06
version: change "place" field of extension to "bundled" flag
Yuya Nishihara <yuya@tcha.org>
parents:
29869
diff
changeset
|
1363 $ hg version --config extensions.strip= -Tjson |
29840
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1364 [ |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1365 { |
29885
42751543fa06
version: change "place" field of extension to "bundled" flag
Yuya Nishihara <yuya@tcha.org>
parents:
29869
diff
changeset
|
1366 "extensions": [{"bundled": true, "name": "strip", "ver": null}], |
29840
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1367 "ver": "*" (glob) |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1368 } |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1369 ] |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1370 |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1371 Test template output of version: |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1372 |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1373 $ hg version --config extensions.throw=throw.py --config extensions.strip= \ |
29885
42751543fa06
version: change "place" field of extension to "bundled" flag
Yuya Nishihara <yuya@tcha.org>
parents:
29869
diff
changeset
|
1374 > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}' |
29840
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1375 throw 1.twentythree (external) |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1376 strip (internal) |
4435d4c951ec
version: add formatter support
Yuya Nishihara <yuya@tcha.org>
parents:
29839
diff
changeset
|
1377 |
27142
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1378 Refuse to load extensions with minimum version requirements |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1379 |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1380 $ cat > minversion1.py << EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1381 > from mercurial import util |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1382 > util.version = lambda: '3.5.2' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1383 > minimumhgversion = '3.6' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1384 > EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1385 $ hg --config extensions.minversion=minversion1.py version |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1386 (third party extension minversion requires version 3.6 or newer of Mercurial; disabling) |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1387 Mercurial Distributed SCM (version 3.5.2) |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1388 (see https://mercurial-scm.org for more information) |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1389 |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1390 Copyright (C) 2005-* Matt Mackall and others (glob) |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1391 This is free software; see the source for copying conditions. There is NO |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1392 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1393 |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1394 $ cat > minversion2.py << EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1395 > from mercurial import util |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1396 > util.version = lambda: '3.6' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1397 > minimumhgversion = '3.7' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1398 > EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1399 $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1400 (third party extension minversion requires version 3.7 or newer of Mercurial; disabling) |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1401 |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1402 Can load version that is only off by point release |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1403 |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1404 $ cat > minversion2.py << EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1405 > from mercurial import util |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1406 > util.version = lambda: '3.6.1' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1407 > minimumhgversion = '3.6' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1408 > EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1409 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1410 [1] |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1411 |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1412 Can load minimum version identical to current |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1413 |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1414 $ cat > minversion3.py << EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1415 > from mercurial import util |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1416 > util.version = lambda: '3.5' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1417 > minimumhgversion = '3.5' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1418 > EOF |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1419 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third' |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1420 [1] |
060f83d219b9
extensions: refuse to load extensions if minimum hg version not met
Gregory Szorc <gregory.szorc@gmail.com>
parents:
26421
diff
changeset
|
1421 |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1422 Restore HGRCPATH |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1423 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1424 $ HGRCPATH=$ORGHGRCPATH |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1425 $ export HGRCPATH |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1426 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1427 Commands handling multiple repositories at a time should invoke only |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1428 "reposetup()" of extensions enabling in the target repository. |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1429 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1430 $ mkdir reposetup-test |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1431 $ cd reposetup-test |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1432 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1433 $ cat > $TESTTMP/reposetuptest.py <<EOF |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1434 > from mercurial import extensions |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1435 > def reposetup(ui, repo): |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1436 > ui.write('reposetup() for %s\n' % (repo.root)) |
28612
6fb1d3c936d2
tests: explicitly flush output streams
Jun Wu <quark@fb.com>
parents:
27990
diff
changeset
|
1437 > ui.flush() |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1438 > EOF |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1439 $ hg init src |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1440 $ echo a > src/a |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1441 $ hg -R src commit -Am '#0 at src/a' |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1442 adding a |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1443 $ echo '[extensions]' >> src/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1444 $ echo '# enable extension locally' >> src/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1445 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1446 $ hg -R src status |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1447 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1448 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1449 $ hg clone -U src clone-dst1 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1450 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1451 $ hg init push-dst1 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1452 $ hg -q -R src push push-dst1 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1453 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1454 $ hg init pull-src1 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1455 $ hg -q -R pull-src1 pull src |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1456 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1457 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1458 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1459 > [extensions] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1460 > # disable extension globally and explicitly |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1461 > reposetuptest = ! |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1462 > EOF |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1463 $ hg clone -U src clone-dst2 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1464 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1465 $ hg init push-dst2 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1466 $ hg -q -R src push push-dst2 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1467 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1468 $ hg init pull-src2 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1469 $ hg -q -R pull-src2 pull src |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1470 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1471 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1472 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1473 > [extensions] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1474 > # enable extension globally |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1475 > reposetuptest = $TESTTMP/reposetuptest.py |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1476 > EOF |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1477 $ hg clone -U src clone-dst3 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1478 reposetup() for $TESTTMP/reposetup-test/src (glob) |
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1479 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1480 $ hg init push-dst3 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1481 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1482 $ hg -q -R src push push-dst3 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1483 reposetup() for $TESTTMP/reposetup-test/src (glob) |
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1484 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1485 $ hg init pull-src3 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1486 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1487 $ hg -q -R pull-src3 pull src |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1488 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob) |
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1489 reposetup() for $TESTTMP/reposetup-test/src (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1490 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1491 $ echo '[extensions]' >> src/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1492 $ echo '# disable extension locally' >> src/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1493 $ echo 'reposetuptest = !' >> src/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1494 $ hg clone -U src clone-dst4 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1495 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1496 $ hg init push-dst4 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1497 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1498 $ hg -q -R src push push-dst4 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1499 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1500 $ hg init pull-src4 |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1501 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1502 $ hg -q -R pull-src4 pull src |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1503 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1504 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1505 disabling in command line overlays with all configuration |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1506 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1507 $ hg --config extensions.reposetuptest=! init push-dst5 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1508 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1509 $ hg --config extensions.reposetuptest=! init pull-src5 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1510 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1511 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1512 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1513 > [extensions] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1514 > # disable extension globally and explicitly |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1515 > reposetuptest = ! |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23151
diff
changeset
|
1516 > EOF |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1517 $ hg init parent |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1518 $ hg init parent/sub1 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1519 $ echo 1 > parent/sub1/1 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1520 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1' |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1521 adding 1 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1522 $ hg init parent/sub2 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1523 $ hg init parent/sub2/sub21 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1524 $ echo 21 > parent/sub2/sub21/21 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1525 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21' |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1526 adding 21 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1527 $ cat > parent/sub2/.hgsub <<EOF |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1528 > sub21 = sub21 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1529 > EOF |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1530 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2' |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1531 adding .hgsub |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1532 $ hg init parent/sub3 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1533 $ echo 3 > parent/sub3/3 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1534 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3' |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1535 adding 3 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1536 $ cat > parent/.hgsub <<EOF |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1537 > sub1 = sub1 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1538 > sub2 = sub2 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1539 > sub3 = sub3 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1540 > EOF |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1541 $ hg -R parent commit -Am '#0 at parent' |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1542 adding .hgsub |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1543 $ echo '[extensions]' >> parent/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1544 $ echo '# enable extension locally' >> parent/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1545 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1546 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1547 $ hg -R parent status -S -A |
20003
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1548 reposetup() for $TESTTMP/reposetup-test/parent (glob) |
dcd3c47e464b
tests: end output lines including path with "(glob)" to pass on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20002
diff
changeset
|
1549 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob) |
19777
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1550 C .hgsub |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1551 C .hgsubstate |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1552 C sub1/1 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1553 C sub2/.hgsub |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1554 C sub2/.hgsubstate |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1555 C sub2/sub21/21 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1556 C sub3/3 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1557 |
6f72e7d28b35
extensions: list up only enabled extensions, if "ui" is specified
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
18748
diff
changeset
|
1558 $ cd .. |
24124
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1559 |
32342
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1560 Prohibit registration of commands that don't use @command (issue5137) |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1561 |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1562 $ hg init deprecated |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1563 $ cd deprecated |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1564 |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1565 $ cat <<EOF > deprecatedcmd.py |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1566 > def deprecatedcmd(repo, ui): |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1567 > pass |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1568 > cmdtable = { |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1569 > 'deprecatedcmd': (deprecatedcmd, [], ''), |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1570 > } |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1571 > EOF |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1572 $ cat <<EOF > .hg/hgrc |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1573 > [extensions] |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1574 > deprecatedcmd = `pwd`/deprecatedcmd.py |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1575 > mq = ! |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1576 > hgext.mq = ! |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1577 > hgext/mq = ! |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1578 > EOF |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1579 |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1580 $ hg deprecatedcmd > /dev/null |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1581 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1582 *** (use @command decorator to register 'deprecatedcmd') |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1583 hg: unknown command 'deprecatedcmd' |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1584 [255] |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1585 |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1586 the extension shouldn't be loaded at all so the mq works: |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1587 |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1588 $ hg qseries --config extensions.mq= > /dev/null |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1589 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1590 *** (use @command decorator to register 'deprecatedcmd') |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1591 |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1592 $ cd .. |
e5fbf9687600
extensions: prohibit registration of command without using @command (API)
Yuya Nishihara <yuya@tcha.org>
parents:
32337
diff
changeset
|
1593 |
24124
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1594 Test synopsis and docstring extending |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1595 |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1596 $ hg init exthelp |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1597 $ cat > exthelp.py <<EOF |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1598 > from mercurial import commands, extensions |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1599 > def exbookmarks(orig, *args, **opts): |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1600 > return orig(*args, **opts) |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1601 > def uisetup(ui): |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1602 > synopsis = ' GREPME [--foo] [-x]' |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1603 > docstring = ''' |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1604 > GREPME make sure that this is in the help! |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1605 > ''' |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1606 > extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks, |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1607 > synopsis, docstring) |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1608 > EOF |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1609 $ abspath=`pwd`/exthelp.py |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1610 $ echo '[extensions]' >> $HGRCPATH |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1611 $ echo "exthelp = $abspath" >> $HGRCPATH |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1612 $ cd exthelp |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1613 $ hg help bookmarks | grep GREPME |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1614 hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x] |
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1615 GREPME make sure that this is in the help! |
32343
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1616 $ cd .. |
24124
042d95beeee8
extensions: allow extending command synopsis and docstring
Ryan McElroy <rm@fb.com>
parents:
23871
diff
changeset
|
1617 |
32343
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1618 Show deprecation warning for the use of cmdutil.command |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1619 |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1620 $ cat > nonregistrar.py <<EOF |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1621 > from mercurial import cmdutil |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1622 > cmdtable = {} |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1623 > command = cmdutil.command(cmdtable) |
33097
fce4ed2912bb
py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33052
diff
changeset
|
1624 > @command(b'foo', [], norepo=True) |
32343
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1625 > def foo(ui): |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1626 > pass |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1627 > EOF |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1628 |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1629 $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1630 devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo' |
d47d7d3bd07b
extensions: show deprecation warning for the use of cmdutil.command
Yuya Nishihara <yuya@tcha.org>
parents:
32342
diff
changeset
|
1631 (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob) |
32723
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1632 |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1633 Make sure a broken uisetup doesn't globally break hg: |
32757
d2acd99bbab3
test-extension: fix load path for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32724
diff
changeset
|
1634 $ cat > $TESTTMP/baduisetup.py <<EOF |
32723
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1635 > from mercurial import ( |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1636 > bdiff, |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1637 > extensions, |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1638 > ) |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1639 > |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1640 > def blockswrapper(orig, *args, **kwargs): |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1641 > return orig(*args, **kwargs) |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1642 > |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1643 > def uisetup(ui): |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1644 > extensions.wrapfunction(bdiff, 'blocks', blockswrapper) |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1645 > EOF |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1646 $ cat >> $HGRCPATH <<EOF |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1647 > [extensions] |
32757
d2acd99bbab3
test-extension: fix load path for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32724
diff
changeset
|
1648 > baduisetup = $TESTTMP/baduisetup.py |
32723
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1649 > EOF |
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1650 |
32724
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1651 Even though the extension fails during uisetup, hg is still basically usable: |
32723
b6384b3d4ebe
tests: add test demonstrating how broken third-party extensions can get
Augie Fackler <augie@google.com>
parents:
32343
diff
changeset
|
1652 $ hg version |
32724
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1653 *** failed to set up extension baduisetup: No module named bdiff |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1654 Mercurial Distributed SCM (version *) (glob) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1655 (see https://mercurial-scm.org for more information) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1656 |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1657 Copyright (C) 2005-2017 Matt Mackall and others |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1658 This is free software; see the source for copying conditions. There is NO |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1659 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1660 |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1661 $ hg version --traceback |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1662 Traceback (most recent call last): |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1663 File "*/mercurial/extensions.py", line *, in _runuisetup (glob) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1664 uisetup(ui) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1665 File "$TESTTMP/baduisetup.py", line 10, in uisetup |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1666 extensions.wrapfunction(bdiff, 'blocks', blockswrapper) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1667 File "*/mercurial/extensions.py", line *, in wrapfunction (glob) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1668 origfn = getattr(container, funcname) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1669 File "*/hgdemandimport/demandimportpy2.py", line *, in __getattr__ (glob) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1670 self._load() |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1671 File "*/hgdemandimport/demandimportpy2.py", line *, in _load (glob) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1672 mod = _hgextimport(_import, head, globals, locals, None, level) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1673 File "*/hgdemandimport/demandimportpy2.py", line *, in _hgextimport (glob) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1674 return importfunc(name, globals, *args, **kwargs) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1675 ImportError: No module named bdiff |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1676 *** failed to set up extension baduisetup: No module named bdiff |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1677 Mercurial Distributed SCM (version *) (glob) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1678 (see https://mercurial-scm.org for more information) |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1679 |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1680 Copyright (C) 2005-2017 Matt Mackall and others |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1681 This is free software; see the source for copying conditions. There is NO |
ea1c2eb7abd3
extensions: catch uisetup and extsetup failures and don't let them break hg
Augie Fackler <augie@google.com>
parents:
32723
diff
changeset
|
1682 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |