##// END OF EJS Templates
changelog: never inline changelog...
changelog: never inline changelog The test suite mostly use small repositories, that implies that most changelog in the tests are inlined. As a result, non-inlined changelog are quite poorly tested. Since non-inline changelog are most common case for serious repositories, this lack of testing is a significant problem that results in high profile issue like the one recently fixed by 66417f55ea33 and 849745d7da89. Inlining the changelog does not bring much to the table, the number of total file saved is negligible, and the changelog will be read by most operation anyway. So this changeset is make it so we never inline the changelog, and de-inline the one that are still inlined whenever we touch them. By doing that, we remove the "dual code path" situation for writing new entry to the changelog and move to a "single code path" situation. Having a single code path simplify the code and make sure it is covered by test (if test cover that situation obviously) This impact all tests that care about the number of file and the exchange size, but there is nothing too complicated in them just a lot of churn. The churn is made "worse" by the fact rust will use the persistent nodemap on any changelog now. Which is overall a win as it means testing the persistent nodemap more and having less special cases. In short, having inline changelog is mostly useless and an endless source of pain. We get rid of it.

File last commit:

r52074:dcaa2df1 default
r52074:dcaa2df1 default
Show More
test-hook.t
1467 lines | 39.2 KiB | text/troff | Tads3Lexer
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 commit hooks can see env vars
Pierre-Yves David
afterlock: add the callback to the top level lock (issue4608)...
r24821 (and post-transaction one are run unlocked)
Nicolas Dumazet
tests: unify test-hook
r11793
Pierre-Yves David
tests: use bundle2 for test-hook...
r25370
FUJIWARA Katsunori
localrepo: rename hook argument from TXNID to txnid (BC)...
r25218 $ cat > $TESTTMP/txnabort.checkargs.py <<EOF
Augie Fackler
tests: port inline extensions in test-hook.t to py3...
r37772 > from mercurial import pycompat
FUJIWARA Katsunori
localrepo: rename hook argument from TXNID to txnid (BC)...
r25218 > def showargs(ui, repo, hooktype, **kwargs):
Augie Fackler
tests: port inline extensions in test-hook.t to py3...
r37772 > kwargs = pycompat.byteskwargs(kwargs)
> ui.write(b'%s Python hook: %s\n' % (hooktype,
> b','.join(sorted(kwargs))))
FUJIWARA Katsunori
localrepo: rename hook argument from TXNID to txnid (BC)...
r25218 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg init a
$ cd a
Adrian Buehlmann
test-hook: adapt for Windows
r16964 $ cat > .hg/hgrc <<EOF
> [hooks]
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit"
> commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit.b"
> precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py --line precommit"
> pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxncommit"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > pretxncommit.tip = hg -q tip
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > pre-identify = sh -c "printenv.py --line pre-identify 1"
> pre-cat = sh -c "printenv.py --line pre-cat"
> post-cat = sh -c "printenv.py --line post-cat"
> pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnopen"
> pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnclose"
> txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnclose"
FUJIWARA Katsunori
localrepo: rename hook argument from TXNID to txnid (BC)...
r25218 > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnabort"
Matt Harbison
test-hook.t: don't directly use redirect to /dev/null in hook for Windows...
r24827 > txnclose.checklock = sh -c "hg debuglock > /dev/null"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ echo a > a
$ hg add a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg commit -m a
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 precommit hook: HG_HOOKNAME=precommit
HG_HOOKTYPE=precommit
HG_PARENT1=0000000000000000000000000000000000000000
pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
pretxncommit hook: HG_HOOKNAME=pretxncommit
HG_HOOKTYPE=pretxncommit
HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
HG_PARENT1=0000000000000000000000000000000000000000
HG_PENDING=$TESTTMP/a
Martin Geisler
tests: remove unneeded -d flags...
r12156 0:cb9a9f314b8b
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnclose hook: HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_PHASES_MOVED=1
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
txnclose hook: HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_PHASES_MOVED=1
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
commit hook: HG_HOOKNAME=commit
HG_HOOKTYPE=commit
HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
HG_PARENT1=0000000000000000000000000000000000000000
commit.b hook: HG_HOOKNAME=commit.b
HG_HOOKTYPE=commit
HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
HG_PARENT1=0000000000000000000000000000000000000000
Nicolas Dumazet
tests: unify test-hook
r11793
$ hg clone . ../b
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../b
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 changegroup hooks can see env vars
Nicolas Dumazet
tests: unify test-hook
r11793
Adrian Buehlmann
test-hook: adapt for Windows
r16964 $ cat > .hg/hgrc <<EOF
> [hooks]
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > prechangegroup = sh -c "printenv.py --line prechangegroup"
> changegroup = sh -c "printenv.py --line changegroup"
> incoming = sh -c "printenv.py --line incoming"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 pretxncommit and commit hooks can see both parents of merge
Nicolas Dumazet
tests: unify test-hook
r11793
$ cd ../a
$ echo b >> a
$ hg commit -m a1 -d "1 0"
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 precommit hook: HG_HOOKNAME=precommit
HG_HOOKTYPE=precommit
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
pretxncommit hook: HG_HOOKNAME=pretxncommit
HG_HOOKTYPE=pretxncommit
HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
HG_PENDING=$TESTTMP/a
Martin Geisler
tests: remove unneeded -d flags...
r12156 1:ab228980c14d
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnclose hook: HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
txnclose hook: HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
commit hook: HG_HOOKNAME=commit
HG_HOOKTYPE=commit
HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
commit.b hook: HG_HOOKNAME=commit.b
HG_HOOKTYPE=commit
HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg update -C 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo b > b
$ hg add b
$ hg commit -m b -d '1 0'
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 precommit hook: HG_HOOKNAME=precommit
HG_HOOKTYPE=precommit
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
pretxncommit hook: HG_HOOKNAME=pretxncommit
HG_HOOKTYPE=pretxncommit
HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
HG_PENDING=$TESTTMP/a
Martin Geisler
tests: remove unneeded -d flags...
r12156 2:ee9deb46ab31
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnclose hook: HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
FUJIWARA Katsunori
commands: make commit acquire locks before processing (issue4368)...
r27192 created new head
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 txnclose hook: HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
commit hook: HG_HOOKNAME=commit
HG_HOOKTYPE=commit
HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
commit.b hook: HG_HOOKNAME=commit.b
HG_HOOKTYPE=commit
HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg commit -m merge -d '2 0'
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 precommit hook: HG_HOOKNAME=precommit
HG_HOOKTYPE=precommit
HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
pretxncommit hook: HG_HOOKNAME=pretxncommit
HG_HOOKTYPE=pretxncommit
HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
HG_PENDING=$TESTTMP/a
Martin Geisler
tests: remove unneeded -d flags...
r12156 3:07f3376c1e65
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnclose hook: HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
txnclose hook: HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
commit hook: HG_HOOKNAME=commit
HG_HOOKTYPE=commit
HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
commit.b hook: HG_HOOKNAME=commit.b
HG_HOOKTYPE=commit
HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 test generic hooks
Nicolas Dumazet
tests: unify test-hook
r11793
$ hg id
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pre-identify hook: HG_ARGS=id
HG_HOOKNAME=pre-identify
HG_HOOKTYPE=pre-identify
HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''}
HG_PATS=[]
Siddharth Agarwal
dispatch: print 'abort:' when a pre-command hook fails (BC)...
r19011 abort: pre-identify hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg cat b
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pre-cat hook: HG_ARGS=cat b
HG_HOOKNAME=pre-cat
HG_HOOKTYPE=pre-cat
HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''}
HG_PATS=['b']
Dan Villiom Podlaski Christiansen
make_file: always return a fresh file handle that can be closed...
r13121 b
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 post-cat hook: HG_ARGS=cat b
HG_HOOKNAME=post-cat
HG_HOOKTYPE=post-cat
HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''}
HG_PATS=['b']
HG_RESULT=0
Nicolas Dumazet
tests: unify test-hook
r11793
$ cd ../b
$ hg pull ../a
Mads Kiilerich
util: flush stdout before calling external processes...
r13439 pulling from ../a
searching for changes
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 prechangegroup hook: HG_HOOKNAME=prechangegroup
HG_HOOKTYPE=prechangegroup
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=pull
file:/*/$TESTTMP/a (glob)
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
Mads Kiilerich
util: flush stdout before calling external processes...
r13439 adding changesets
adding manifests
adding file changes
added 3 changesets with 2 changes to 2 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets ab228980c14d:07f3376c1e65
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 changegroup hook: HG_HOOKNAME=changegroup
HG_HOOKTYPE=changegroup
HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=pull
file:/*/$TESTTMP/a (glob)
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
incoming hook: HG_HOOKNAME=incoming
HG_HOOKTYPE=incoming
HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=pull
file:/*/$TESTTMP/a (glob)
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
incoming hook: HG_HOOKNAME=incoming
HG_HOOKTYPE=incoming
HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=pull
file:/*/$TESTTMP/a (glob)
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
incoming hook: HG_HOOKNAME=incoming
HG_HOOKTYPE=incoming
HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=pull
file:/*/$TESTTMP/a (glob)
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
Nicolas Dumazet
tests: unify test-hook
r11793 (run 'hg update' to get a working copy)
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 tag hooks can see env vars
Nicolas Dumazet
tests: unify test-hook
r11793
$ cd ../a
Adrian Buehlmann
test-hook: adapt for Windows
r16964 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > pretag = sh -c "printenv.py --line pretag"
> tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py --line tag"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg tag -d '3 0' a
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretag hook: HG_HOOKNAME=pretag
HG_HOOKTYPE=pretag
HG_LOCAL=0
HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
HG_TAG=a
precommit hook: HG_HOOKNAME=precommit
HG_HOOKTYPE=precommit
HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
pretxncommit hook: HG_HOOKNAME=pretxncommit
HG_HOOKTYPE=pretxncommit
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
HG_PENDING=$TESTTMP/a
Martin Geisler
tests: remove unneeded -d flags...
r12156 4:539e4b31b6dc
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnclose hook: HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
tag hook: HG_HOOKNAME=tag
HG_HOOKTYPE=tag
HG_LOCAL=0
HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
HG_TAG=a
txnclose hook: HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
commit hook: HG_HOOKNAME=commit
HG_HOOKTYPE=commit
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
commit.b hook: HG_HOOKNAME=commit.b
HG_HOOKTYPE=commit
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg tag -l la
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretag hook: HG_HOOKNAME=pretag
HG_HOOKTYPE=pretag
HG_LOCAL=1
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_TAG=la
tag hook: HG_HOOKNAME=tag
HG_HOOKTYPE=tag
HG_LOCAL=1
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_TAG=la
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 pretag hook can forbid tagging
Nicolas Dumazet
tests: unify test-hook
r11793
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > pretag.forbid = sh -c "printenv.py --line pretag.forbid 1"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg tag -d '4 0' fa
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretag hook: HG_HOOKNAME=pretag
HG_HOOKTYPE=pretag
HG_LOCAL=0
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_TAG=fa
pretag.forbid hook: HG_HOOKNAME=pretag.forbid
HG_HOOKTYPE=pretag
HG_LOCAL=0
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_TAG=fa
Nicolas Dumazet
tests: unify test-hook
r11793 abort: pretag.forbid hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg tag -l fla
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretag hook: HG_HOOKNAME=pretag
HG_HOOKTYPE=pretag
HG_LOCAL=1
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_TAG=fla
pretag.forbid hook: HG_HOOKNAME=pretag.forbid
HG_HOOKTYPE=pretag
HG_LOCAL=1
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_TAG=fla
Nicolas Dumazet
tests: unify test-hook
r11793 abort: pretag.forbid hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 pretxncommit hook can see changeset, can roll back txn, changeset no
more there after
Nicolas Dumazet
tests: unify test-hook
r11793
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
> pretxncommit.forbid0 = sh -c "hg tip -q"
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > pretxncommit.forbid1 = sh -c "printenv.py --line pretxncommit.forbid 1"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ echo z > z
$ hg add z
$ hg -q tip
Martin Geisler
tests: remove unneeded -d flags...
r12156 4:539e4b31b6dc
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg commit -m 'fail' -d '4 0'
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 precommit hook: HG_HOOKNAME=precommit
HG_HOOKTYPE=precommit
HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
pretxncommit hook: HG_HOOKNAME=pretxncommit
HG_HOOKTYPE=pretxncommit
HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567
HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_PENDING=$TESTTMP/a
Martin Geisler
tests: remove unneeded -d flags...
r12156 5:6f611f8018c1
5:6f611f8018c1
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1
HG_HOOKTYPE=pretxncommit
HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567
HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_PENDING=$TESTTMP/a
Nicolas Dumazet
tests: unify test-hook
r11793 transaction abort!
Joerg Sonnenberger
hooks: provide access to transaction changes for internal hooks...
r45350 txnabort Python hook: changes,txnid,txnname
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 txnabort hook: HG_HOOKNAME=txnabort.1
HG_HOOKTYPE=txnabort
HG_TXNID=TXN:$ID$
HG_TXNNAME=commit
Nicolas Dumazet
tests: unify test-hook
r11793 rollback completed
abort: pretxncommit.forbid1 hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg -q tip
Martin Geisler
tests: remove unneeded -d flags...
r12156 4:539e4b31b6dc
Nicolas Dumazet
tests: unify test-hook
r11793
Pierre-Yves David
changelog: register changelog.i.a as a temporary file...
r23292 (Check that no 'changelog.i.a' file were left behind)
$ ls -1 .hg/store/
changelog: never inline changelog...
r52074 00changelog-1335303a.nd (rust !)
00changelog.d
Pierre-Yves David
changelog: register changelog.i.a as a temporary file...
r23292 00changelog.i
changelog: never inline changelog...
r52074 00changelog.n (rust !)
Pierre-Yves David
changelog: register changelog.i.a as a temporary file...
r23292 00manifest.i
data
changelog: never inline changelog...
r52074 fncache
Pierre-Yves David
changelog: register changelog.i.a as a temporary file...
r23292 phaseroots
share-safe: enable by default (BC)...
r49515 requires
Pierre-Yves David
changelog: register changelog.i.a as a temporary file...
r23292 undo
changelog: never inline changelog...
r52074 undo.backup.00changelog.n.bck (rust !)
undo.backup.fncache.bck
Pierre-Yves David
transaction: include backup file in the "undo" transaction...
r23904 undo.backupfiles
Pierre-Yves David
changelog: register changelog.i.a as a temporary file...
r23292
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 precommit hook can prevent commit
Nicolas Dumazet
tests: unify test-hook
r11793
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > precommit.forbid = sh -c "printenv.py --line precommit.forbid 1"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg commit -m 'fail' -d '4 0'
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 precommit hook: HG_HOOKNAME=precommit
HG_HOOKTYPE=precommit
HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
precommit.forbid hook: HG_HOOKNAME=precommit.forbid
HG_HOOKTYPE=precommit
HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
Nicolas Dumazet
tests: unify test-hook
r11793 abort: precommit.forbid hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg -q tip
Martin Geisler
tests: remove unneeded -d flags...
r12156 4:539e4b31b6dc
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 preupdate hook can prevent update
Nicolas Dumazet
tests: unify test-hook
r11793
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > preupdate = sh -c "printenv.py --line preupdate"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg update 1
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 preupdate hook: HG_HOOKNAME=preupdate
HG_HOOKTYPE=preupdate
HG_PARENT1=ab228980c14d
Nicolas Dumazet
tests: unify test-hook
r11793 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 update hook
Nicolas Dumazet
tests: unify test-hook
r11793
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > update = sh -c "printenv.py --line update"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg update
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 preupdate hook: HG_HOOKNAME=preupdate
HG_HOOKTYPE=preupdate
HG_PARENT1=539e4b31b6dc
update hook: HG_ERROR=0
HG_HOOKNAME=update
HG_HOOKTYPE=update
HG_PARENT1=539e4b31b6dc
Pierre-Yves David
update: wlock the repo for the whole 'hg update' command...
r26028 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Nicolas Dumazet
tests: unify test-hook
r11793
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 pushkey hook
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > pushkey = sh -c "printenv.py --line pushkey"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../b
$ hg bookmark -r null foo
$ hg push -B foo ../a
pushing to ../a
searching for changes
no changes found
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=push
pretxnclose hook: HG_BOOKMARK_MOVED=1
HG_BUNDLE2=1
HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_SOURCE=push
HG_TXNID=TXN:$ID$
HG_TXNNAME=push
HG_URL=file:$TESTTMP/a
pushkey hook: HG_BUNDLE2=1
HG_HOOKNAME=pushkey
HG_HOOKTYPE=pushkey
HG_KEY=foo
HG_NAMESPACE=bookmarks
HG_NEW=0000000000000000000000000000000000000000
HG_PUSHKEYCOMPAT=1
HG_SOURCE=push
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=push
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
txnclose hook: HG_BOOKMARK_MOVED=1
HG_BUNDLE2=1
HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_SOURCE=push
HG_TXNID=TXN:$ID$
HG_TXNNAME=push
HG_URL=file:$TESTTMP/a
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 exporting bookmark foo
Matt Mackall
push: don't treat bookmark as a found change...
r16038 [1]
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../a
listkeys hook
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > listkeys = sh -c "printenv.py --line listkeys"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ hg bookmark -r null bar
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=bookmark
pretxnclose hook: HG_BOOKMARK_MOVED=1
HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_TXNID=TXN:$ID$
HG_TXNNAME=bookmark
txnclose hook: HG_BOOKMARK_MOVED=1
HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_TXNID=TXN:$ID$
HG_TXNNAME=bookmark
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../b
$ hg pull -B bar ../a
pulling from ../a
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 listkeys hook: HG_HOOKNAME=listkeys
HG_HOOKTYPE=listkeys
HG_NAMESPACE=bookmarks
HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
Pierre-Yves David
tests: use bundle2 for test-hook...
r25370 no changes found
adding remote bookmark bar
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../a
test that prepushkey can prevent incoming keys
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > prepushkey = sh -c "printenv.py --line prepushkey.forbid 1"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../b
$ hg bookmark -r null baz
$ hg push -B baz ../a
pushing to ../a
searching for changes
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 listkeys hook: HG_HOOKNAME=listkeys
HG_HOOKTYPE=listkeys
HG_NAMESPACE=phases
HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
listkeys hook: HG_HOOKNAME=listkeys
HG_HOOKTYPE=listkeys
HG_NAMESPACE=bookmarks
HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 no changes found
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=push
prepushkey.forbid hook: HG_BUNDLE2=1
HG_HOOKNAME=prepushkey
HG_HOOKTYPE=prepushkey
HG_KEY=baz
HG_NAMESPACE=bookmarks
HG_NEW=0000000000000000000000000000000000000000
HG_PUSHKEYCOMPAT=1
HG_SOURCE=push
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=push
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
transaction: run abort callback in all cases...
r50889 txnabort Python hook: bundle2,changes,source,txnid,txnname,url
txnabort hook: HG_BUNDLE2=1
HG_HOOKNAME=txnabort.1
HG_HOOKTYPE=txnabort
HG_SOURCE=push
HG_TXNID=TXN:$ID$
HG_TXNNAME=push
HG_URL=file:$TESTTMP/a
Boris Feld
bookmark: use the 'bookmarks' bundle2 part to push bookmark update (issue5165)...
r35265 abort: prepushkey hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../a
test that prelistkeys can prevent listing keys
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> .hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > prelistkeys = sh -c "printenv.py --line prelistkeys.forbid 1"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ hg bookmark -r null quux
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnopen hook: HG_HOOKNAME=pretxnopen
HG_HOOKTYPE=pretxnopen
HG_TXNID=TXN:$ID$
HG_TXNNAME=bookmark
pretxnclose hook: HG_BOOKMARK_MOVED=1
HG_HOOKNAME=pretxnclose
HG_HOOKTYPE=pretxnclose
HG_PENDING=$TESTTMP/a
HG_TXNID=TXN:$ID$
HG_TXNNAME=bookmark
txnclose hook: HG_BOOKMARK_MOVED=1
HG_HOOKNAME=txnclose
HG_HOOKTYPE=txnclose
HG_TXNID=TXN:$ID$
HG_TXNNAME=bookmark
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../b
$ hg pull -B quux ../a
pulling from ../a
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys
HG_HOOKTYPE=prelistkeys
HG_NAMESPACE=bookmarks
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 abort: prelistkeys hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102 $ cd ../a
Siddharth Agarwal
test-hook.t: remove prelistkeys.forbid hook before moving on...
r18850 $ rm .hg/hgrc
Brodie Rao
pushkey: add hooks for pushkey/listkeys
r14102
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 prechangegroup hook can prevent incoming changes
Nicolas Dumazet
tests: unify test-hook
r11793
$ cd ../b
$ hg -q tip
Martin Geisler
tests: remove unneeded -d flags...
r12156 3:07f3376c1e65
Adrian Buehlmann
test-hook: adapt for Windows
r16964 $ cat > .hg/hgrc <<EOF
> [hooks]
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > prechangegroup.forbid = sh -c "printenv.py --line prechangegroup.forbid 1"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg pull ../a
pulling from ../a
searching for changes
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid
HG_HOOKTYPE=prechangegroup
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=pull
file:/*/$TESTTMP/a (glob)
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
Nicolas Dumazet
tests: unify test-hook
r11793 abort: prechangegroup.forbid hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 pretxnchangegroup hook can see incoming changes, can roll back txn,
incoming changes no longer there after
Nicolas Dumazet
tests: unify test-hook
r11793
Adrian Buehlmann
test-hook: adapt for Windows
r16964 $ cat > .hg/hgrc <<EOF
> [hooks]
> pretxnchangegroup.forbid0 = hg tip -q
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > pretxnchangegroup.forbid1 = sh -c "printenv.py --line pretxnchangegroup.forbid 1"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg pull ../a
pulling from ../a
searching for changes
adding changesets
adding manifests
adding file changes
Mads Kiilerich
util: flush stdout before calling external processes...
r13439 4:539e4b31b6dc
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1
HG_HOOKTYPE=pretxnchangegroup
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_PENDING=$TESTTMP/b
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
transaction: include txnname in the hookargs dictionary...
r42062 HG_TXNNAME=pull
file:/*/$TESTTMP/a (glob)
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 HG_URL=file:$TESTTMP/a
Nicolas Dumazet
tests: unify test-hook
r11793 transaction abort!
rollback completed
abort: pretxnchangegroup.forbid1 hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg -q tip
Martin Geisler
tests: remove unneeded -d flags...
r12156 3:07f3376c1e65
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 outgoing hooks can see env vars
Nicolas Dumazet
tests: unify test-hook
r11793
$ rm .hg/hgrc
Adrian Buehlmann
test-hook: adapt for Windows
r16964 $ cat > ../a/.hg/hgrc <<EOF
> [hooks]
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > preoutgoing = sh -c "printenv.py --line preoutgoing"
> outgoing = sh -c "printenv.py --line outgoing"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg pull ../a
pulling from ../a
searching for changes
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 preoutgoing hook: HG_HOOKNAME=preoutgoing
HG_HOOKTYPE=preoutgoing
HG_SOURCE=pull
outgoing hook: HG_HOOKNAME=outgoing
HG_HOOKTYPE=outgoing
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
HG_SOURCE=pull
Nicolas Dumazet
tests: unify test-hook
r11793 adding changesets
adding manifests
adding file changes
changegroup: move message about added changes to transaction summary...
r43167 adding remote bookmark quux
Nicolas Dumazet
tests: unify test-hook
r11793 added 1 changesets with 1 changes to 1 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 539e4b31b6dc
Nicolas Dumazet
tests: unify test-hook
r11793 (run 'hg update' to get a working copy)
$ hg rollback
Gilles Moris
rollback: clarifies the message about the reverted state (issue2628)...
r13446 repository tip rolled back to revision 3 (undo pull)
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 preoutgoing hook can prevent outgoing changes
Nicolas Dumazet
tests: unify test-hook
r11793
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> ../a/.hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg pull ../a
Mads Kiilerich
util: flush stdout before calling external processes...
r13439 pulling from ../a
searching for changes
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 preoutgoing hook: HG_HOOKNAME=preoutgoing
HG_HOOKTYPE=preoutgoing
HG_SOURCE=pull
preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
HG_HOOKTYPE=preoutgoing
HG_SOURCE=pull
Nicolas Dumazet
tests: unify test-hook
r11793 abort: preoutgoing.forbid hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 outgoing hooks work for local clones
Nicolas Dumazet
tests: unify test-hook
r11793
$ cd ..
Adrian Buehlmann
test-hook: adapt for Windows
r16964 $ cat > a/.hg/hgrc <<EOF
> [hooks]
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > preoutgoing = sh -c "printenv.py --line preoutgoing"
> outgoing = sh -c "printenv.py --line outgoing"
Adrian Buehlmann
test-hook: adapt for Windows
r16964 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg clone a c
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 preoutgoing hook: HG_HOOKNAME=preoutgoing
HG_HOOKTYPE=preoutgoing
HG_SOURCE=clone
outgoing hook: HG_HOOKNAME=outgoing
HG_HOOKTYPE=outgoing
HG_NODE=0000000000000000000000000000000000000000
HG_SOURCE=clone
Nicolas Dumazet
tests: unify test-hook
r11793 updating to branch default
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ rm -rf c
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 preoutgoing hook can prevent outgoing changes for local clones
Nicolas Dumazet
tests: unify test-hook
r11793
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 $ cat >> a/.hg/hgrc <<EOF
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
FUJIWARA Katsunori
tests: invoke printenv.py via sh -c for test portability...
r30234 > EOF
Nicolas Dumazet
tests: unify test-hook
r11793 $ hg clone a zzz
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 preoutgoing hook: HG_HOOKNAME=preoutgoing
HG_HOOKTYPE=preoutgoing
HG_SOURCE=clone
preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
HG_HOOKTYPE=preoutgoing
HG_SOURCE=clone
Nicolas Dumazet
tests: unify test-hook
r11793 abort: preoutgoing.forbid hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Adrian Buehlmann
test-hook: adapt for Windows
r16964
$ cd "$TESTTMP/b"
Nicolas Dumazet
tests: unify test-hook
r11793
$ cat > hooktests.py <<EOF
Augie Fackler
tests: port inline extensions in test-hook.t to py3...
r37772 > from mercurial import (
> error,
> pycompat,
> )
Nicolas Dumazet
tests: unify test-hook
r11793 >
> uncallable = 0
>
Saurabh Singh
test-hook: make test compatible with chg...
r34453 > def printargs(ui, args):
Augie Fackler
tests: port inline extensions in test-hook.t to py3...
r37772 > a = list(pycompat.byteskwargs(args).items())
Nicolas Dumazet
tests: unify test-hook
r11793 > a.sort()
Gregory Szorc
py3: use bytes literals for test extension...
r36126 > ui.write(b'hook args:\n')
Nicolas Dumazet
tests: unify test-hook
r11793 > for k, v in a:
Gregory Szorc
py3: use bytes literals for test extension...
r36126 > ui.write(b' %s %s\n' % (k, v))
Nicolas Dumazet
tests: unify test-hook
r11793 >
Saurabh Singh
test-hook: make test compatible with chg...
r34453 > def passhook(ui, repo, **args):
> printargs(ui, args)
Nicolas Dumazet
tests: unify test-hook
r11793 >
Saurabh Singh
test-hook: make test compatible with chg...
r34453 > def failhook(ui, repo, **args):
> printargs(ui, args)
Nicolas Dumazet
tests: unify test-hook
r11793 > return True
>
> class LocalException(Exception):
> pass
>
> def raisehook(**args):
Augie Fackler
tests: port inline extensions in test-hook.t to py3...
r37772 > raise LocalException('exception from hook')
Nicolas Dumazet
tests: unify test-hook
r11793 >
> def aborthook(**args):
Gregory Szorc
py3: use bytes literals for test extension...
r36126 > raise error.Abort(b'raise abort from hook')
Nicolas Dumazet
tests: unify test-hook
r11793 >
> def brokenhook(**args):
> return 1 + {}
>
Idan Kamara
dispatch: propagate ui command options to the local ui (issue2523)...
r14601 > def verbosehook(ui, **args):
Gregory Szorc
py3: use bytes literals for test extension...
r36126 > ui.note(b'verbose output from hook\n')
Idan Kamara
dispatch: propagate ui command options to the local ui (issue2523)...
r14601 >
Mads Kiilerich
tag: invalidate tag cache immediately after adding new tag (issue3210)...
r15929 > def printtags(ui, repo, **args):
Augie Fackler
tests: manually print list in test-hook.t...
r37771 > ui.write(b'[%s]\n' % b', '.join(sorted(repo.tags())))
Mads Kiilerich
tag: invalidate tag cache immediately after adding new tag (issue3210)...
r15929 >
FUJIWARA Katsunori
tests: define class in modern style to avoid check-code.py error...
r41880 > class container(object):
Nicolas Dumazet
tests: unify test-hook
r11793 > unreachable = 1
> EOF
FUJIWARA Katsunori
tests: use NO_CHECK_EOF for fragments having intentional error...
r40241 $ cat > syntaxerror.py << NO_CHECK_EOF
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109 > (foo
FUJIWARA Katsunori
tests: use NO_CHECK_EOF for fragments having intentional error...
r40241 > NO_CHECK_EOF
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 test python hooks
Nicolas Dumazet
tests: unify test-hook
r11793
Adrian Buehlmann
test-hook: adapt for Windows
r16964 #if windows
$ PYTHONPATH="$TESTTMP/b;$PYTHONPATH"
#else
$ PYTHONPATH="$TESTTMP/b:$PYTHONPATH"
#endif
Nicolas Dumazet
tests: unify test-hook
r11793 $ export PYTHONPATH
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
$ hg pull ../a 2>&1 | grep 'raised an exception'
error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
$ hg pull ../a 2>&1 | grep 'raised an exception'
error: preoutgoing.raise hook raised an exception: exception from hook
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
error: preoutgoing.abort hook failed: raise abort from hook
abort: raise abort from hook
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
hook args:
hooktype preoutgoing
source pull
abort: preoutgoing.fail hook failed
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
Siddharth Agarwal
hook: fewer parentheses for hook load errors...
r28079 abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
Siddharth Agarwal
hook: fewer parentheses for hook load errors...
r28079 abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
Siddharth Agarwal
hook: even fewer parentheses for load errors...
r28106 abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
Siddharth Agarwal
hook: fewer parentheses for hook load errors...
r28079 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
Siddharth Agarwal
hook: for python hook ImportErrors, add note to run with --traceback...
r28080 (run with --traceback for stack trace)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > ../a/.hg/hgrc
$ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
Siddharth Agarwal
hook: fewer parentheses for hook load errors...
r28079 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
Siddharth Agarwal
hook: for python hook ImportErrors, add note to run with --traceback...
r28080 (run with --traceback for stack trace)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > ../a/.hg/hgrc
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109 $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
(run with --traceback for stack trace)
[255]
Mads Kiilerich
tests: use grep -E instead of obsolescent egrep...
r51618 $ hg pull ../a --traceback 2>&1 | grep -E 'pulling|searching|^exception|Traceback|SyntaxError|ImportError|ModuleNotFoundError|HookLoadError|abort'
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109 pulling from ../a
searching for changes
exception from first failed import attempt:
Traceback (most recent call last):
Maciej Fijalkowski
pypy: fix overspecific test checks...
r28737 SyntaxError: * (glob)
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109 exception from second failed import attempt:
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 Traceback (most recent call last):
SyntaxError: * (glob)
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109 Traceback (most recent call last):
Matt Harbison
tests: drop py36 conditionals in test-hook.t...
r51178 ModuleNotFoundError: No module named 'hgext_syntaxerror'
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109 Traceback (most recent call last):
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 SyntaxError: * (glob)
Traceback (most recent call last):
Matt Harbison
tests: drop py36 conditionals in test-hook.t...
r51178 ModuleNotFoundError: No module named 'hgext_syntaxerror'
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 Traceback (most recent call last):
dynamic-import: use sysstr for importing extension and others...
r51816 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !)
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 mercurial.error.HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
Siddharth Agarwal
hook: don't crash on syntax errors in python hooks...
r28109 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
$ echo '[hooks]' > ../a/.hg/hgrc
Nicolas Dumazet
tests: unify test-hook
r11793 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
hook args:
hooktype preoutgoing
source pull
adding changesets
adding manifests
adding file changes
changegroup: move message about added changes to transaction summary...
r43167 adding remote bookmark quux
Nicolas Dumazet
tests: unify test-hook
r11793 added 1 changesets with 1 changes to 1 files
Denis Laxalde
transaction-summary: show the range of new revisions upon pull/unbundle (BC)...
r34662 new changesets 539e4b31b6dc
Nicolas Dumazet
tests: unify test-hook
r11793 (run 'hg update' to get a working copy)
Siddharth Agarwal
hook: add tests for failing post- python hooks...
r28107 post- python hooks that fail to *run* don't cause an abort
$ rm ../a/.hg/hgrc
$ echo '[hooks]' > .hg/hgrc
$ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
no changes found
error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
Siddharth Agarwal
hook: for python hook exceptions, add note to run with --traceback...
r28108 (run with --traceback for stack trace)
Siddharth Agarwal
hook: add tests for failing post- python hooks...
r28107
but post- python hooks that fail to *load* do
$ echo '[hooks]' > .hg/hgrc
$ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
no changes found
abort: post-pull.nomodule hook is invalid: "nomodule" not in a module
[255]
$ echo '[hooks]' > .hg/hgrc
$ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
no changes found
abort: post-pull.badmodule hook is invalid: import of "nomodule" failed
(run with --traceback for stack trace)
[255]
$ echo '[hooks]' > .hg/hgrc
$ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc
$ hg pull ../a
pulling from ../a
searching for changes
no changes found
abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined
[255]
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 make sure --traceback works
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > .hg/hgrc
$ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
$ echo aa > a
$ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
Traceback (most recent call last):
$ cd ..
$ hg init c
$ cd c
$ cat > hookext.py <<EOF
Saurabh Singh
test-hook: make test compatible with chg...
r34453 > def autohook(ui, **args):
Augie Fackler
tests: port inline extensions in test-hook.t to py3...
r37772 > ui.write(b'Automatically installed hook\n')
Nicolas Dumazet
tests: unify test-hook
r11793 >
> def reposetup(ui, repo):
Augie Fackler
tests: port inline extensions in test-hook.t to py3...
r37772 > repo.ui.setconfig(b"hooks", b"commit.auto", autohook)
Nicolas Dumazet
tests: unify test-hook
r11793 > EOF
$ echo '[extensions]' >> .hg/hgrc
$ echo 'hookext = hookext.py' >> .hg/hgrc
$ touch foo
$ hg add foo
$ hg ci -d '0 0' -m 'add foo'
Automatically installed hook
$ echo >> foo
Nicolas Dumazet
tests: remove useless sed in test-hook
r11794 $ hg ci --debug -d '0 0' -m 'change foo'
Mads Kiilerich
localrepo: show headline notes in commitctx before showing filenames...
r23749 committing files:
Nicolas Dumazet
tests: unify test-hook
r11793 foo
Mads Kiilerich
localrepo: show headline notes in commitctx before showing filenames...
r23749 committing manifest
committing changelog
Pierre-Yves David
caches: move the 'updating the branch cache' message in 'updatecaches'...
r32267 updating the branch cache
FUJIWARA Katsunori
commands: make commit acquire locks before processing (issue4368)...
r27192 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
Mads Kiilerich
hooks: for python hooks, consistently use __name__ etc as name, not the repr...
r20548 calling hook commit.auto: hgext_hookext.autohook
Nicolas Dumazet
tests: unify test-hook
r11793 Automatically installed hook
Nicolas Dumazet
tests: remove useless sed in test-hook
r11794 $ hg showconfig hooks
Brodie Rao
tests: add glob matching for unified tests...
r12376 hooks.commit.auto=<function autohook at *> (glob)
Nicolas Dumazet
tests: unify test-hook
r11793
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 test python hook configured with python:[file]:[hook] syntax
Nicolas Dumazet
tests: unify test-hook
r11793
$ cd ..
$ mkdir d
$ cd d
$ hg init repo
$ mkdir hooks
$ cd hooks
$ cat > testhooks.py <<EOF
Saurabh Singh
test-hook: make test compatible with chg...
r34453 > def testhook(ui, **args):
Gregory Szorc
py3: use bytes literals for test extension...
r36126 > ui.write(b'hook works\n')
Nicolas Dumazet
tests: unify test-hook
r11793 > EOF
$ echo '[hooks]' > ../repo/.hg/hgrc
$ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
$ cd ../repo
$ hg commit -d '0 0'
hook works
nothing changed
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Nicolas Dumazet
tests: unify test-hook
r11793
Simon Heimberg
hooks: print out more information when loading a python hook fails...
r17217 $ echo '[hooks]' > .hg/hgrc
timeless@mozdev.org
spelling: nonexistent
r17492 $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc
Simon Heimberg
hooks: print out more information when loading a python hook fails...
r17217 $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc
$ hg up null
loading update.ne hook failed:
Yuya Nishihara
dispatch: quote filename in IOError as well...
r41465 abort: $ENOENT$: '$TESTTMP/d/repo/nonexistent.py'
Simon Heimberg
hooks: print out more information when loading a python hook fails...
r17217 [255]
$ hg id
loading pre-identify.npmd hook failed:
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 abort: No module named 'repo'
Simon Heimberg
hooks: print out more information when loading a python hook fails...
r17217 [255]
Nicolas Dumazet
tests: unify test-hook
r11793 $ cd ../../b
Matt Mackall
tests: fix a bunch of pointless #s in unified tests
r12328 make sure --traceback works on hook import failure
Nicolas Dumazet
tests: unify test-hook
r11793
$ cat > importfail.py <<EOF
> import somebogusmodule
> # dereference something in the module to force demandimport to load it
> somebogusmodule.whatever
> EOF
$ echo '[hooks]' > .hg/hgrc
$ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
$ echo a >> a
Mads Kiilerich
tests: use grep -E instead of obsolescent egrep...
r51618 $ hg --traceback commit -ma 2>&1 | grep -E '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
Nicolas Dumazet
tests: unify test-hook
r11793 exception from first failed import attempt:
Traceback (most recent call last):
Matt Harbison
tests: drop py36 conditionals in test-hook.t...
r51178 ModuleNotFoundError: No module named 'somebogusmodule'
Nicolas Dumazet
tests: unify test-hook
r11793 exception from second failed import attempt:
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 Traceback (most recent call last):
Matt Harbison
tests: drop py36 conditionals in test-hook.t...
r51178 ModuleNotFoundError: No module named 'somebogusmodule'
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 Traceback (most recent call last):
Matt Harbison
tests: drop py36 conditionals in test-hook.t...
r51178 ModuleNotFoundError: No module named 'hgext_importfail'
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 Traceback (most recent call last):
Matt Harbison
tests: drop py36 conditionals in test-hook.t...
r51178 ModuleNotFoundError: No module named 'somebogusmodule'
Nicolas Dumazet
tests: unify test-hook
r11793 Traceback (most recent call last):
Matt Harbison
tests: drop py36 conditionals in test-hook.t...
r51178 ModuleNotFoundError: No module named 'hgext_importfail'
Nicolas Dumazet
tests: unify test-hook
r11793 Traceback (most recent call last):
dynamic-import: use sysstr for importing extension and others...
r51816 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !)
Matt Harbison
tests: drop `(py3 !)` output matching predicates...
r50772 mercurial.error.HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed
Siddharth Agarwal
hook: fewer parentheses for hook load errors...
r28079 abort: precommit.importfail hook is invalid: import of "importfail" failed
Nicolas Dumazet
tests: unify test-hook
r11793
Martin Geisler
tests: added a short description to issue numbers...
r12399 Issue1827: Hooks Update & Commit not completely post operation
Matt Harbison
merge: run update hook after the last wlock release...
r24881 commit and update hooks should run after command completion. The largefiles
use demonstrates a recursive wlock, showing the hook doesn't run until the
final release (and dirstate flush).
Nicolas Dumazet
tests: unify test-hook
r11793
$ echo '[hooks]' > .hg/hgrc
$ echo 'commit = hg id' >> .hg/hgrc
$ echo 'update = hg id' >> .hg/hgrc
$ echo bb > a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -ma
223eafe2750c tip
Matt Harbison
merge: run update hook after the last wlock release...
r24881 $ hg up 0 --config extensions.largefiles=
FUJIWARA Katsunori
tests: add fsmonitor specific output lines at enabling largefiles...
r33209 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
FUJIWARA Katsunori
merge: make in-memory changes visible to external update hooks...
r26752 cb9a9f314b8b
Pierre-Yves David
update: wlock the repo for the whole 'hg update' command...
r26028 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Nicolas Dumazet
tests: unify test-hook
r11793
timeless@mozdev.org
spelling: propagated
r17508 make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui
Idan Kamara
dispatch: propagate ui command options to the local ui (issue2523)...
r14601 that is passed to pre/post hooks
$ echo '[hooks]' > .hg/hgrc
$ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc
$ hg id
cb9a9f314b8b
$ hg id --verbose
calling hook pre-identify: hooktests.verbosehook
verbose output from hook
cb9a9f314b8b
Matt Zuba
hooks: prioritize run order of hooks...
r15896
Ensure hooks can be prioritized
$ echo '[hooks]' > .hg/hgrc
$ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc
$ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc
$ echo 'priority.pre-identify.b = 1' >> .hg/hgrc
$ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc
$ hg id --verbose
calling hook pre-identify.b: hooktests.verbosehook
verbose output from hook
calling hook pre-identify.a: hooktests.verbosehook
verbose output from hook
calling hook pre-identify.c: hooktests.verbosehook
verbose output from hook
cb9a9f314b8b
Mads Kiilerich
tag: invalidate tag cache immediately after adding new tag (issue3210)...
r15929
new tags must be visible in pretxncommit (issue3210)
$ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc
$ hg tag -f foo
Augie Fackler
tests: manually print list in test-hook.t...
r37771 [a, foo, tip]
Mads Kiilerich
tag: invalidate tag cache immediately after adding new tag (issue3210)...
r15929
Sietse Brouwer
dirstate: don't write repo.currenttransaction to repo.dirstate if repo...
r27228 post-init hooks must not crash (issue4983)
This also creates the `to` repo for the next test block.
$ cd ..
$ cat << EOF >> hgrc-with-post-init-hook
> [hooks]
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 > post-init = sh -c "printenv.py --line post-init"
Sietse Brouwer
dirstate: don't write repo.currenttransaction to repo.dirstate if repo...
r27228 > EOF
$ HGRCPATH=hgrc-with-post-init-hook hg init to
Boris Feld
test: use `printenv.py --line` in `test-hook.t`...
r41788 post-init hook: HG_ARGS=init to
HG_HOOKNAME=post-init
HG_HOOKTYPE=post-init
HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''}
HG_PATS=['to']
HG_RESULT=0
Sietse Brouwer
dirstate: don't write repo.currenttransaction to repo.dirstate if repo...
r27228
Bryan O'Sullivan
changelog: ensure that nodecache is valid (issue3428)...
r16619 new commits must be visible in pretxnchangegroup (issue3428)
$ echo '[hooks]' >> to/.hg/hgrc
Durham Goode
hooks: fix hooks not firing if prechangegroup was set (issue4934)...
r26859 $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc
Bryan O'Sullivan
changelog: ensure that nodecache is valid (issue3428)...
r16619 $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc
$ echo a >> to/a
$ hg --cwd to ci -Ama
adding a
$ hg clone to from
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo aa >> from/a
$ hg --cwd from ci -mb
$ hg --cwd from push
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 pushing to $TESTTMP/to
Bryan O'Sullivan
changelog: ensure that nodecache is valid (issue3428)...
r16619 searching for changes
Durham Goode
hooks: fix hooks not firing if prechangegroup was set (issue4934)...
r26859 changeset: 0:cb9a9f314b8b
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
Bryan O'Sullivan
changelog: ensure that nodecache is valid (issue3428)...
r16619 adding changesets
adding manifests
adding file changes
changeset: 1:9836a07b9b9d
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: b
changegroup: move message about added changes to transaction summary...
r43167 added 1 changesets with 1 changes to 1 files
Durham Goode
transaction: abort transaction during hook exception...
r27924
pretxnclose hook failure should abort the transaction
$ hg init txnfailure
$ cd txnfailure
$ touch a && hg commit -Aqm a
$ cat >> .hg/hgrc <<EOF
> [hooks]
> pretxnclose.error = exit 1
> EOF
$ hg strip -r 0 --config extensions.strip=
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
saved backup bundle to * (glob)
transaction abort!
rollback completed
Martin von Zweigbergk
strip: don't use "full" and "partial" to describe bundles...
r29954 strip failed, backup bundle stored in * (glob)
Durham Goode
transaction: abort transaction during hook exception...
r27924 abort: pretxnclose.error hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Durham Goode
transaction: abort transaction during hook exception...
r27924 $ hg recover
no interrupted transaction available
[1]
Pierre-Yves David
hook: report untrusted hooks as failure (issue5110) (BC)...
r28938 $ cd ..
FUJIWARA Katsunori
localrepo: check HG_PENDING strictly...
r31054 check whether HG_PENDING makes pending changes only in related
repositories visible to an external hook.
(emulate a transaction running concurrently by copied
.hg/store/00changelog.i.a in subsequent test)
$ cat > $TESTTMP/savepending.sh <<EOF
> cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved
> exit 1 # to avoid adding new revision for subsequent tests
> EOF
$ cd a
$ hg tip -q
4:539e4b31b6dc
$ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible"
transaction abort!
rollback completed
abort: pretxnclose hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
FUJIWARA Katsunori
localrepo: check HG_PENDING strictly...
r31054 $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a
(check (in)visibility of new changeset while transaction running in
repo)
$ cat > $TESTTMP/checkpending.sh <<EOF
> echo '@a'
Matt Harbison
tests: quote paths in shell script hooks...
r31767 > hg -R "$TESTTMP/a" tip -q
FUJIWARA Katsunori
localrepo: check HG_PENDING strictly...
r31054 > echo '@a/nested'
Matt Harbison
tests: quote paths in shell script hooks...
r31767 > hg -R "$TESTTMP/a/nested" tip -q
FUJIWARA Katsunori
localrepo: check HG_PENDING strictly...
r31054 > exit 1 # to avoid adding new revision for subsequent tests
> EOF
$ hg init nested
$ cd nested
$ echo a > a
$ hg add a
$ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0'
@a
4:539e4b31b6dc
@a/nested
0:bf5e395ced2c
transaction abort!
rollback completed
abort: pretxnclose hook exited with status 1
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
FUJIWARA Katsunori
localrepo: check HG_PENDING strictly...
r31054
Pierre-Yves David
hook: report untrusted hooks as failure (issue5110) (BC)...
r28938 Hook from untrusted hgrc are reported as failure
================================================
$ cat << EOF > $TESTTMP/untrusted.py
> from mercurial import scmutil, util
> def uisetup(ui):
> class untrustedui(ui.__class__):
> def _trusted(self, fp, f):
Gregory Szorc
py3: use bytes literals for test extension...
r36126 > if util.normpath(fp.name).endswith(b'untrusted/.hg/hgrc'):
Pierre-Yves David
hook: report untrusted hooks as failure (issue5110) (BC)...
r28938 > return False
> return super(untrustedui, self)._trusted(fp, f)
> ui.__class__ = untrustedui
> EOF
$ cat << EOF >> $HGRCPATH
> [extensions]
> untrusted=$TESTTMP/untrusted.py
> EOF
$ hg init untrusted
$ cd untrusted
Non-blocking hook
-----------------
$ cat << EOF >> .hg/hgrc
> [hooks]
> txnclose.testing=echo txnclose hook called
> EOF
$ touch a && hg commit -Aqm a
Pierre-Yves David
hook: fix name used in untrusted message...
r31743 warning: untrusted hook txnclose.testing not executed
Pierre-Yves David
hook: report untrusted hooks as failure (issue5110) (BC)...
r28938 $ hg log
changeset: 0:3903775176ed
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
Non-blocking hook
-----------------
$ cat << EOF >> .hg/hgrc
> [hooks]
> pretxnclose.testing=echo pre-txnclose hook called
> EOF
$ touch b && hg commit -Aqm a
transaction abort!
rollback completed
Pierre-Yves David
hook: fix name used in untrusted message...
r31743 abort: untrusted hook pretxnclose.testing not executed
Pierre-Yves David
hook: report untrusted hooks as failure (issue5110) (BC)...
r28938 (see 'hg help config.trusted')
Martin von Zweigbergk
errors: use exit code 40 for when a hook fails...
r47145 [40]
Pierre-Yves David
hook: report untrusted hooks as failure (issue5110) (BC)...
r28938 $ hg log
changeset: 0:3903775176ed
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
hooks: add some test about HGPLAIN setting and hooks...
r47241
unsetup the test
----------------
# touch the file to unconfuse chg with a diffrent mtime
$ sleep 1
$ touch $TESTTMP/untrusted.py
$ cat << EOF >> $HGRCPATH
> [extensions]
> untrusted=!
> EOF
HGPLAIN setting in hooks
========================
$ cat << EOF >> .hg/hgrc
> [hooks]
Matt Harbison
tests: stablize test-hook.t on Windows...
r47627 > pre-version.testing-default=sh -c "echo '### default ###' plain: \${HGPLAIN:-'<unset>'}"
> pre-version.testing-yes=sh -c "echo '### yes #######' plain: \${HGPLAIN:-'<unset>'}"
hooks: introduce a `:run-with-plain` option for hooks...
r47242 > pre-version.testing-yes:run-with-plain=yes
Matt Harbison
tests: stablize test-hook.t on Windows...
r47627 > pre-version.testing-no=sh -c "echo '### no ########' plain: \${HGPLAIN:-'<unset>'}"
hooks: introduce a `:run-with-plain` option for hooks...
r47242 > pre-version.testing-no:run-with-plain=no
Matt Harbison
tests: stablize test-hook.t on Windows...
r47627 > pre-version.testing-auto=sh -c "echo '### auto ######' plain: \${HGPLAIN:-'<unset>'}"
hooks: add a `auto` value for `hooks.*run-with-plain`...
r47243 > pre-version.testing-auto:run-with-plain=auto
hooks: add some test about HGPLAIN setting and hooks...
r47241 > EOF
$ (unset HGPLAIN; hg version --quiet)
### default ### plain: 1
hooks: introduce a `:run-with-plain` option for hooks...
r47242 ### yes ####### plain: 1
### no ######## plain: <unset>
hooks: add a `auto` value for `hooks.*run-with-plain`...
r47243 ### auto ###### plain: <unset>
hooks: add some test about HGPLAIN setting and hooks...
r47241 Mercurial Distributed SCM (*) (glob)
$ HGPLAIN=1 hg version --quiet
### default ### plain: 1
hooks: introduce a `:run-with-plain` option for hooks...
r47242 ### yes ####### plain: 1
### no ######## plain: <unset>
hooks: add a `auto` value for `hooks.*run-with-plain`...
r47243 ### auto ###### plain: 1
hooks: add some test about HGPLAIN setting and hooks...
r47241 Mercurial Distributed SCM (*) (glob)
Arseniy Alekseyev
dirstate: add a test to highlight another changelog / dirstate race
r51249
Test hook that change the underlying repo
=========================================
blackbox access the dirstate afterward and can see a changelog / dirstate
desync.
$ cd $TESTTMP
$ cat <<EOF >> $HGRCPATH
> [extensions]
> blackbox=
> [hooks]
> post-merge = hg commit -m "auto merge"
> EOF
$ hg init t
$ cd t
$ touch ".hgignore"
$ hg commit -Am "initial" -d'0 0'
adding .hgignore
$ echo This is file a1 > a
$ hg commit -Am "commit #1" -d'0 0'
adding a
$ hg update 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo This is file b1 > b
$ hg commit -Am "commit #2" -d'0 0'
adding b
created new head
$ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cd ..