Mercurial > hg
annotate tests/test-hook.t @ 16202:53e2cd303ecf stable 2.1.1
dirstate: filecacheify _ignore (issue3278)
This still doesn't handle the case where a command is run with
--config ui.ignore=path since we only look for changes in .hgignore.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Thu, 01 Mar 2012 17:49:59 +0200 |
parents | a3dcc59054ca |
children | bc84a1aeaf5a |
rev | line source |
---|---|
15445
7cbb81c47025
tests: use 'hghave system-sh' to guard tests that requires sh in system()
Mads Kiilerich <mads@kiilerich.com>
parents:
15131
diff
changeset
|
1 $ "$TESTDIR/hghave" system-sh || exit 80 |
7cbb81c47025
tests: use 'hghave system-sh' to guard tests that requires sh in system()
Mads Kiilerich <mads@kiilerich.com>
parents:
15131
diff
changeset
|
2 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
3 commit hooks can see env vars |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
4 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
5 $ hg init a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
6 $ cd a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
7 $ echo "[hooks]" > .hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
8 $ echo 'commit = unset HG_LOCAL HG_TAG; python "$TESTDIR"/printenv.py commit' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
9 $ echo 'commit.b = unset HG_LOCAL HG_TAG; python "$TESTDIR"/printenv.py commit.b' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
10 $ echo 'precommit = unset HG_LOCAL HG_NODE HG_TAG; python "$TESTDIR"/printenv.py precommit' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
11 $ echo 'pretxncommit = unset HG_LOCAL HG_TAG; python "$TESTDIR"/printenv.py pretxncommit' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
12 $ echo 'pretxncommit.tip = hg -q tip' >> .hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
13 $ echo 'pre-identify = python "$TESTDIR"/printenv.py pre-identify 1' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
14 $ echo 'pre-cat = python "$TESTDIR"/printenv.py pre-cat' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
15 $ echo 'post-cat = python "$TESTDIR"/printenv.py post-cat' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
16 $ echo a > a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
17 $ hg add a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
18 $ hg commit -m a |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
19 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000 |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12587
diff
changeset
|
20 pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
21 0:cb9a9f314b8b |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
22 commit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
23 commit.b hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
24 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
25 $ hg clone . ../b |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
26 updating to branch default |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
28 $ cd ../b |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
29 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
30 changegroup hooks can see env vars |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
31 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
32 $ echo '[hooks]' > .hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
33 $ echo 'prechangegroup = python "$TESTDIR"/printenv.py prechangegroup' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
34 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
35 $ echo 'incoming = python "$TESTDIR"/printenv.py incoming' >> .hg/hgrc |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
36 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
37 pretxncommit and commit hooks can see both parents of merge |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
38 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
39 $ cd ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
40 $ echo b >> a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
41 $ hg commit -m a1 -d "1 0" |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
42 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12587
diff
changeset
|
43 pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
44 1:ab228980c14d |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
45 commit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
46 commit.b hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
47 $ hg update -C 0 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
49 $ echo b > b |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
50 $ hg add b |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
51 $ hg commit -m b -d '1 0' |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
52 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12587
diff
changeset
|
53 pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
54 2:ee9deb46ab31 |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
55 commit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
56 commit.b hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
57 created new head |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
58 $ hg merge 1 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
60 (branch merge, don't forget to commit) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
61 $ hg commit -m merge -d '2 0' |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
62 precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12587
diff
changeset
|
63 pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
64 3:07f3376c1e65 |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
65 commit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
66 commit.b hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
67 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
68 test generic hooks |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
69 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
70 $ hg id |
15580
5a7733563c2e
id: add command line options for handling ssh and https urls
Mads Kiilerich <mads@kiilerich.com>
parents:
15445
diff
changeset
|
71 pre-identify hook: HG_ARGS=id HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None} HG_PATS=[] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
72 warning: pre-identify hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
73 [1] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
74 $ hg cat b |
13207
1775382ff833
hooks: sort any dictionaries set in the environment
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
13121
diff
changeset
|
75 pre-cat hook: HG_ARGS=cat b HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': ''} HG_PATS=['b'] |
13121
bf763946f8b0
make_file: always return a fresh file handle that can be closed
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
12640
diff
changeset
|
76 b |
13207
1775382ff833
hooks: sort any dictionaries set in the environment
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
13121
diff
changeset
|
77 post-cat hook: HG_ARGS=cat b HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': ''} HG_PATS=['b'] HG_RESULT=0 |
4630
e6d105a51ec7
dispatch: add generic pre- and post-command hooks
Matt Mackall <mpm@selenic.com>
parents:
4368
diff
changeset
|
78 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
79 $ cd ../b |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
80 $ hg pull ../a |
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
81 pulling from ../a |
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
82 searching for changes |
13404
31a256ffe9e5
tests: let printenv.py show the real values
Mads Kiilerich <mads@kiilerich.com>
parents:
13207
diff
changeset
|
83 prechangegroup hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a |
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
84 adding changesets |
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
85 adding manifests |
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
86 adding file changes |
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
87 added 3 changesets with 2 changes to 2 files |
13404
31a256ffe9e5
tests: let printenv.py show the real values
Mads Kiilerich <mads@kiilerich.com>
parents:
13207
diff
changeset
|
88 changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a |
31a256ffe9e5
tests: let printenv.py show the real values
Mads Kiilerich <mads@kiilerich.com>
parents:
13207
diff
changeset
|
89 incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a |
31a256ffe9e5
tests: let printenv.py show the real values
Mads Kiilerich <mads@kiilerich.com>
parents:
13207
diff
changeset
|
90 incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a |
31a256ffe9e5
tests: let printenv.py show the real values
Mads Kiilerich <mads@kiilerich.com>
parents:
13207
diff
changeset
|
91 incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
92 (run 'hg update' to get a working copy) |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
93 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
94 tag hooks can see env vars |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
95 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
96 $ cd ../a |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
97 $ echo 'pretag = python "$TESTDIR"/printenv.py pretag' >> .hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
98 $ echo 'tag = unset HG_PARENT1 HG_PARENT2; python "$TESTDIR"/printenv.py tag' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
99 $ hg tag -d '3 0' a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
100 pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
101 precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12587
diff
changeset
|
102 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
103 4:539e4b31b6dc |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
104 commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
105 commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
106 tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
107 $ hg tag -l la |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
108 pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
109 tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
110 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
111 pretag hook can forbid tagging |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
112 |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
113 $ echo 'pretag.forbid = python "$TESTDIR"/printenv.py pretag.forbid 1' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
114 $ hg tag -d '4 0' fa |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
115 pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
116 pretag.forbid hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
117 abort: pretag.forbid hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
118 [255] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
119 $ hg tag -l fla |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
120 pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
121 pretag.forbid hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
122 abort: pretag.forbid hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
123 [255] |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
124 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
125 pretxncommit hook can see changeset, can roll back txn, changeset no |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
126 more there after |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
127 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
128 $ echo 'pretxncommit.forbid0 = hg tip -q' >> .hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
129 $ echo 'pretxncommit.forbid1 = python "$TESTDIR"/printenv.py pretxncommit.forbid 1' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
130 $ echo z > z |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
131 $ hg add z |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
132 $ hg -q tip |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
133 4:539e4b31b6dc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
134 $ hg commit -m 'fail' -d '4 0' |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
135 precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12587
diff
changeset
|
136 pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
137 5:6f611f8018c1 |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
138 5:6f611f8018c1 |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12587
diff
changeset
|
139 pretxncommit.forbid hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
140 transaction abort! |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
141 rollback completed |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
142 abort: pretxncommit.forbid1 hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
143 [255] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
144 $ hg -q tip |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
145 4:539e4b31b6dc |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
146 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
147 precommit hook can prevent commit |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
148 |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
149 $ echo 'precommit.forbid = python "$TESTDIR"/printenv.py precommit.forbid 1' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
150 $ hg commit -m 'fail' -d '4 0' |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
151 precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
152 precommit.forbid hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
153 abort: precommit.forbid hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
154 [255] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
155 $ hg -q tip |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
156 4:539e4b31b6dc |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
157 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
158 preupdate hook can prevent update |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
159 |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
160 $ echo 'preupdate = python "$TESTDIR"/printenv.py preupdate' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
161 $ hg update 1 |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
162 preupdate hook: HG_PARENT1=ab228980c14d |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
163 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
2266
3f7692b0ff13
hooks: add preupdate and update hooks.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2227
diff
changeset
|
164 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
165 update hook |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
166 |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
167 $ echo 'update = python "$TESTDIR"/printenv.py update' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
168 $ hg update |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
169 preupdate hook: HG_PARENT1=539e4b31b6dc |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
170 update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
171 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
2266
3f7692b0ff13
hooks: add preupdate and update hooks.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2227
diff
changeset
|
172 |
14102
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
173 pushkey hook |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
174 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
175 $ echo 'pushkey = python "$TESTDIR"/printenv.py pushkey' >> .hg/hgrc |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
176 $ cd ../b |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
177 $ hg bookmark -r null foo |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
178 $ hg push -B foo ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
179 pushing to ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
180 searching for changes |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
181 no changes found |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
182 exporting bookmark foo |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
183 pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1 |
16038
dad96e752079
push: don't treat bookmark as a found change
Matt Mackall <mpm@selenic.com>
parents:
15956
diff
changeset
|
184 [1] |
14102
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
185 $ cd ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
186 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
187 listkeys hook |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
188 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
189 $ echo 'listkeys = python "$TESTDIR"/printenv.py listkeys' >> .hg/hgrc |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
190 $ hg bookmark -r null bar |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
191 $ cd ../b |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
192 $ hg pull -B bar ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
193 pulling from ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
194 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
14164
cb98fed52495
discovery: add new set-based discovery
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
14102
diff
changeset
|
195 no changes found |
15956
5653f2d166ea
push: prevent moving phases outside of the pushed subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
15929
diff
changeset
|
196 listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} |
14102
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
197 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
198 importing bookmark bar |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
199 $ cd ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
200 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
201 test that prepushkey can prevent incoming keys |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
202 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
203 $ echo 'prepushkey = python "$TESTDIR"/printenv.py prepushkey.forbid 1' >> .hg/hgrc |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
204 $ cd ../b |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
205 $ hg bookmark -r null baz |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
206 $ hg push -B baz ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
207 pushing to ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
208 searching for changes |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
209 no changes found |
15956
5653f2d166ea
push: prevent moving phases outside of the pushed subset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
15929
diff
changeset
|
210 listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} |
14102
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
211 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
212 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
213 exporting bookmark baz |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
214 prepushkey.forbid hook: HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
215 abort: prepushkey hook exited with status 1 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
216 [255] |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
217 $ cd ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
218 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
219 test that prelistkeys can prevent listing keys |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
220 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
221 $ echo 'prelistkeys = python "$TESTDIR"/printenv.py prelistkeys.forbid 1' >> .hg/hgrc |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
222 $ hg bookmark -r null quux |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
223 $ cd ../b |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
224 $ hg pull -B quux ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
225 pulling from ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
226 prelistkeys.forbid hook: HG_NAMESPACE=bookmarks |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
227 abort: prelistkeys hook exited with status 1 |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
228 [255] |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
229 $ cd ../a |
7f45b1911893
pushkey: add hooks for pushkey/listkeys
Brodie Rao <brodie@bitheap.org>
parents:
13477
diff
changeset
|
230 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
231 prechangegroup hook can prevent incoming changes |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
232 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
233 $ cd ../b |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
234 $ hg -q tip |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
235 3:07f3376c1e65 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
236 $ echo '[hooks]' > .hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
237 $ echo 'prechangegroup.forbid = python "$TESTDIR"/printenv.py prechangegroup.forbid 1' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
238 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
239 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
240 searching for changes |
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
241 prechangegroup.forbid hook: HG_SOURCE=pull HG_URL=file:$TESTTMP/a |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
242 abort: prechangegroup.forbid hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
243 [255] |
1734
9488d53233b5
tests for new hooks. fix things i found when writing tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1481
diff
changeset
|
244 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
245 pretxnchangegroup hook can see incoming changes, can roll back txn, |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
246 incoming changes no longer there after |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
247 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
248 $ echo '[hooks]' > .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
249 $ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
250 $ echo 'pretxnchangegroup.forbid1 = python "$TESTDIR"/printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
251 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
252 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
253 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
254 adding changesets |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
255 adding manifests |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
256 adding file changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
257 added 1 changesets with 1 changes to 1 files |
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
258 4:539e4b31b6dc |
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
259 pretxnchangegroup.forbid hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_URL=file:$TESTTMP/a |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
260 transaction abort! |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
261 rollback completed |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
262 abort: pretxnchangegroup.forbid1 hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
263 [255] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
264 $ hg -q tip |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
265 3:07f3376c1e65 |
1736
50de0887bbcd
add preoutgoing and outgoing hooks.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1734
diff
changeset
|
266 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
267 outgoing hooks can see env vars |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
268 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
269 $ rm .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
270 $ echo '[hooks]' > ../a/.hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
271 $ echo 'preoutgoing = python "$TESTDIR"/printenv.py preoutgoing' >> ../a/.hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
272 $ echo 'outgoing = python "$TESTDIR"/printenv.py outgoing' >> ../a/.hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
273 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
274 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
275 searching for changes |
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
276 preoutgoing hook: HG_SOURCE=pull |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
277 adding changesets |
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
278 outgoing hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
279 adding manifests |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
280 adding file changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
281 added 1 changesets with 1 changes to 1 files |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
282 (run 'hg update' to get a working copy) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
283 $ hg rollback |
13446
1e497df514e2
rollback: clarifies the message about the reverted state (issue2628)
Gilles Moris <gilles.moris@free.fr>
parents:
13439
diff
changeset
|
284 repository tip rolled back to revision 3 (undo pull) |
1736
50de0887bbcd
add preoutgoing and outgoing hooks.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1734
diff
changeset
|
285 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
286 preoutgoing hook can prevent outgoing changes |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
287 |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
288 $ echo 'preoutgoing.forbid = python "$TESTDIR"/printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
289 $ hg pull ../a |
13439
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
290 pulling from ../a |
d724a69309e0
util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents:
13405
diff
changeset
|
291 searching for changes |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
292 preoutgoing hook: HG_SOURCE=pull |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
293 preoutgoing.forbid hook: HG_SOURCE=pull |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
294 abort: preoutgoing.forbid hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
295 [255] |
1736
50de0887bbcd
add preoutgoing and outgoing hooks.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1734
diff
changeset
|
296 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
297 outgoing hooks work for local clones |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
298 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
299 $ cd .. |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
300 $ echo '[hooks]' > a/.hg/hgrc |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
301 $ echo 'preoutgoing = python "$TESTDIR"/printenv.py preoutgoing' >> a/.hg/hgrc |
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
302 $ echo 'outgoing = python "$TESTDIR"/printenv.py outgoing' >> a/.hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
303 $ hg clone a c |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
304 preoutgoing hook: HG_SOURCE=clone |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
305 outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
306 updating to branch default |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
307 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
308 $ rm -rf c |
8907
e9ef409e6399
Add (pre)outgoing hooks for local clones.
Fred Wulff <frew@cs.stanford.edu>
parents:
4659
diff
changeset
|
309 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
310 preoutgoing hook can prevent outgoing changes for local clones |
8907
e9ef409e6399
Add (pre)outgoing hooks for local clones.
Fred Wulff <frew@cs.stanford.edu>
parents:
4659
diff
changeset
|
311 |
13405
682edefe7dbb
tests: use printenv.py where it is - don't copy it around
Mads Kiilerich <mads@kiilerich.com>
parents:
13404
diff
changeset
|
312 $ echo 'preoutgoing.forbid = python "$TESTDIR"/printenv.py preoutgoing.forbid 1' >> a/.hg/hgrc |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
313 $ hg clone a zzz |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
314 preoutgoing hook: HG_SOURCE=clone |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
315 preoutgoing.forbid hook: HG_SOURCE=clone |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
316 abort: preoutgoing.forbid hook exited with status 1 |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
317 [255] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
318 $ cd b |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
319 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
320 $ cat > hooktests.py <<EOF |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
321 > from mercurial import util |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
322 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
323 > uncallable = 0 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
324 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
325 > def printargs(args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
326 > args.pop('ui', None) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
327 > args.pop('repo', None) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
328 > a = list(args.items()) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
329 > a.sort() |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
330 > print 'hook args:' |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
331 > for k, v in a: |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
332 > print ' ', k, v |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
333 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
334 > def passhook(**args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
335 > printargs(args) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
336 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
337 > def failhook(**args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
338 > printargs(args) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
339 > return True |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
340 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
341 > class LocalException(Exception): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
342 > pass |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
343 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
344 > def raisehook(**args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
345 > raise LocalException('exception from hook') |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
346 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
347 > def aborthook(**args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
348 > raise util.Abort('raise abort from hook') |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
349 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
350 > def brokenhook(**args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
351 > return 1 + {} |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
352 > |
14601
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
353 > def verbosehook(ui, **args): |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
354 > ui.note('verbose output from hook\n') |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
355 > |
15929
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
356 > def printtags(ui, repo, **args): |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
357 > print repo.tags().keys() |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
358 > |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
359 > class container: |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
360 > unreachable = 1 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
361 > EOF |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
362 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
363 test python hooks |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
364 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
365 $ PYTHONPATH="`pwd`:$PYTHONPATH" |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
366 $ export PYTHONPATH |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
367 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
368 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
369 $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
370 $ hg pull ../a 2>&1 | grep 'raised an exception' |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
371 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict' |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
372 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
373 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
374 $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
375 $ hg pull ../a 2>&1 | grep 'raised an exception' |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
376 error: preoutgoing.raise hook raised an exception: exception from hook |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
377 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
378 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
379 $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
380 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
381 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
382 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
383 error: preoutgoing.abort hook failed: raise abort from hook |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
384 abort: raise abort from hook |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
385 [255] |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
386 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
387 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
388 $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
389 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
390 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
391 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
392 hook args: |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
393 hooktype preoutgoing |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
394 source pull |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
395 abort: preoutgoing.fail hook failed |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
396 [255] |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
397 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
398 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
399 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
400 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
401 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
402 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
403 abort: preoutgoing.uncallable hook is invalid ("hooktests.uncallable" is not callable) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
404 [255] |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
405 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
406 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
407 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
408 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
409 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
410 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
411 abort: preoutgoing.nohook hook is invalid ("hooktests.nohook" is not defined) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
412 [255] |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
413 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
414 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
415 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
416 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
417 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
418 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
419 abort: preoutgoing.nomodule hook is invalid ("nomodule" not in a module) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
420 [255] |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
421 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
422 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
423 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
424 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
425 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
426 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
427 abort: preoutgoing.badmodule hook is invalid (import of "nomodule" failed) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
428 [255] |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
429 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
430 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
431 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
432 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
433 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
434 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
435 abort: preoutgoing.unreachable hook is invalid (import of "hooktests.container" failed) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
436 [255] |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
437 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
438 $ echo '[hooks]' > ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
439 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
440 $ hg pull ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
441 pulling from ../a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
442 searching for changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
443 hook args: |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
444 hooktype preoutgoing |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
445 source pull |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
446 adding changesets |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
447 adding manifests |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
448 adding file changes |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
449 added 1 changesets with 1 changes to 1 files |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
450 (run 'hg update' to get a working copy) |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
451 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
452 make sure --traceback works |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
453 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
454 $ echo '[hooks]' > .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
455 $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc |
2155
ff255b41b4aa
support hooks written in python.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
456 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
457 $ echo aa > a |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
458 $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback' |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
459 Traceback (most recent call last): |
4070
961ccb615cf7
Handle functions as the value of a hooks.<name> config variable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2673
diff
changeset
|
460 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
461 $ cd .. |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
462 $ hg init c |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
463 $ cd c |
4070
961ccb615cf7
Handle functions as the value of a hooks.<name> config variable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2673
diff
changeset
|
464 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
465 $ cat > hookext.py <<EOF |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
466 > def autohook(**args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
467 > print "Automatically installed hook" |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
468 > |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
469 > def reposetup(ui, repo): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
470 > repo.ui.setconfig("hooks", "commit.auto", autohook) |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
471 > EOF |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
472 $ echo '[extensions]' >> .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
473 $ echo 'hookext = hookext.py' >> .hg/hgrc |
4070
961ccb615cf7
Handle functions as the value of a hooks.<name> config variable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2673
diff
changeset
|
474 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
475 $ touch foo |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
476 $ hg add foo |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
477 $ hg ci -d '0 0' -m 'add foo' |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
478 Automatically installed hook |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
479 $ echo >> foo |
11794
80c63b2a29a8
tests: remove useless sed in test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11793
diff
changeset
|
480 $ hg ci --debug -d '0 0' -m 'change foo' |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
481 foo |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
482 calling hook commit.auto: <function autohook at *> (glob) |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
483 Automatically installed hook |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
484 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708 |
4070
961ccb615cf7
Handle functions as the value of a hooks.<name> config variable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2673
diff
changeset
|
485 |
11794
80c63b2a29a8
tests: remove useless sed in test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
11793
diff
changeset
|
486 $ hg showconfig hooks |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
487 hooks.commit.auto=<function autohook at *> (glob) |
4085
719488a98ebe
Fix hg showconfig traceback with values that aren't strings
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4070
diff
changeset
|
488 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
489 test python hook configured with python:[file]:[hook] syntax |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
490 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
491 $ cd .. |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
492 $ mkdir d |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
493 $ cd d |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
494 $ hg init repo |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
495 $ mkdir hooks |
9014
87c05a78e588
test python hook configured with python:[file]:[hook] syntax
Henri Wiechers <hwiechers@gmail.com>
parents:
8907
diff
changeset
|
496 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
497 $ cd hooks |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
498 $ cat > testhooks.py <<EOF |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
499 > def testhook(**args): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
500 > print 'hook works' |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
501 > EOF |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
502 $ echo '[hooks]' > ../repo/.hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
503 $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc |
9014
87c05a78e588
test python hook configured with python:[file]:[hook] syntax
Henri Wiechers <hwiechers@gmail.com>
parents:
8907
diff
changeset
|
504 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
505 $ cd ../repo |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
506 $ hg commit -d '0 0' |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
507 hook works |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
508 nothing changed |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12156
diff
changeset
|
509 [1] |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
510 |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
511 $ cd ../../b |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
512 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12327
diff
changeset
|
513 make sure --traceback works on hook import failure |
9014
87c05a78e588
test python hook configured with python:[file]:[hook] syntax
Henri Wiechers <hwiechers@gmail.com>
parents:
8907
diff
changeset
|
514 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
515 $ cat > importfail.py <<EOF |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
516 > import somebogusmodule |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
517 > # dereference something in the module to force demandimport to load it |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
518 > somebogusmodule.whatever |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
519 > EOF |
9851
9e7b2c49d25d
Make it possible to debug failed hook imports via use of --traceback
Bryan O'Sullivan <bos@serpentine.com>
parents:
9014
diff
changeset
|
520 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
521 $ echo '[hooks]' > .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
522 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc |
9851
9e7b2c49d25d
Make it possible to debug failed hook imports via use of --traceback
Bryan O'Sullivan <bos@serpentine.com>
parents:
9014
diff
changeset
|
523 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
524 $ echo a >> a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
525 $ hg --traceback commit -ma 2>&1 | egrep '^(exception|Traceback|ImportError)' |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
526 exception from first failed import attempt: |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
527 Traceback (most recent call last): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
528 ImportError: No module named somebogusmodule |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
529 exception from second failed import attempt: |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
530 Traceback (most recent call last): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
531 ImportError: No module named hgext_importfail |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
532 Traceback (most recent call last): |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
533 |
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12376
diff
changeset
|
534 Issue1827: Hooks Update & Commit not completely post operation |
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12376
diff
changeset
|
535 |
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12376
diff
changeset
|
536 commit and update hooks should run after command completion |
10492
0e64d814d7d0
run commit and update hooks after command completion (issue1827)
Sune Foldager <cryo@cyanite.org>
parents:
10079
diff
changeset
|
537 |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
538 $ echo '[hooks]' > .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
539 $ echo 'commit = hg id' >> .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
540 $ echo 'update = hg id' >> .hg/hgrc |
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
541 $ echo bb > a |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
542 $ hg ci -ma |
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
543 223eafe2750c tip |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
544 $ hg up 0 |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11794
diff
changeset
|
545 cb9a9f314b8b |
11793
a03ce716495d
tests: unify test-hook
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
10492
diff
changeset
|
546 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
9851
9e7b2c49d25d
Make it possible to debug failed hook imports via use of --traceback
Bryan O'Sullivan <bos@serpentine.com>
parents:
9014
diff
changeset
|
547 |
14601
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
548 make sure --verbose (and --quiet/--debug etc.) are propogated to the local ui |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
549 that is passed to pre/post hooks |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
550 |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
551 $ echo '[hooks]' > .hg/hgrc |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
552 $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
553 $ hg id |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
554 cb9a9f314b8b |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
555 $ hg id --verbose |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
556 calling hook pre-identify: hooktests.verbosehook |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
557 verbose output from hook |
25c1f3ddd927
dispatch: propagate ui command options to the local ui (issue2523)
Idan Kamara <idankk86@gmail.com>
parents:
14164
diff
changeset
|
558 cb9a9f314b8b |
15896
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
559 |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
560 Ensure hooks can be prioritized |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
561 |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
562 $ echo '[hooks]' > .hg/hgrc |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
563 $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
564 $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
565 $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
566 $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
567 $ hg id --verbose |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
568 calling hook pre-identify.b: hooktests.verbosehook |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
569 verbose output from hook |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
570 calling hook pre-identify.a: hooktests.verbosehook |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
571 verbose output from hook |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
572 calling hook pre-identify.c: hooktests.verbosehook |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
573 verbose output from hook |
30c34fde40cc
hooks: prioritize run order of hooks
Matt Zuba <matt.zuba@goodwillaz.org>
parents:
15651
diff
changeset
|
574 cb9a9f314b8b |
15929
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
575 |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
576 new tags must be visible in pretxncommit (issue3210) |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
577 |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
578 $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
579 $ hg tag -f foo |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
580 ['a', 'foo', 'tip'] |
4091660dc130
tag: invalidate tag cache immediately after adding new tag (issue3210)
Mads Kiilerich <mads@kiilerich.com>
parents:
15896
diff
changeset
|
581 |