[PATCH 01 of 10] test: use `printenv.py --line` in `test-bundle.t`

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 01 of 10] test: use `printenv.py --line` in `test-bundle.t`

Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671555 -3600
#      Sat Feb 09 01:19:15 2019 +0100
# Node ID 1736fe7d07d8a96349dc678f7a7bcba29886d1a7
# Parent  e89e78a725eebab0282b4dd669d07797511252f8
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1736fe7d07d8
test: use `printenv.py --line` in `test-bundle.t`

This makes the output easier to update and read.

diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -218,7 +218,7 @@ Pull ../full.hg into empty (with hook)
 
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup"
+  > changegroup = sh -c "printenv.py --line changegroup"
   > EOF
 
 doesn't work (yet ?)
@@ -233,7 +233,14 @@ hg -R bundle://../full.hg verify
   adding file changes
   added 9 changesets with 7 changes to 4 files (+1 heads)
   new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle*../full.hg (glob)
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
+  HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=bundle:../full.hg
+  
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
 Rollback empty
@@ -257,7 +264,14 @@ Pull full.hg into empty again (using -R;
   adding file changes
   added 9 changesets with 7 changes to 4 files (+1 heads)
   new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:empty+full.hg
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
+  HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=bundle:empty+full.hg
+  
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
 #endif
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 02 of 10] test: use `printenv.py --line` in `test-bundle2-multiple-changegroups.t`

Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671583 -3600
#      Sat Feb 09 01:19:43 2019 +0100
# Node ID c0b16be6b9b2d9535be8f1f2c91c5a8ebffa0b03
# Parent  1736fe7d07d8a96349dc678f7a7bcba29886d1a7
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c0b16be6b9b2
test: use `printenv.py --line` in `test-bundle2-multiple-changegroups.t`

This makes the output easier to update and read.

diff --git a/tests/test-bundle2-multiple-changegroups.t b/tests/test-bundle2-multiple-changegroups.t
--- a/tests/test-bundle2-multiple-changegroups.t
+++ b/tests/test-bundle2-multiple-changegroups.t
@@ -66,9 +66,9 @@ Add two linear commits
   $ cd ../clone
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > pretxnchangegroup = sh -c "printenv.py pretxnchangegroup"
-  > changegroup = sh -c "printenv.py changegroup"
-  > incoming = sh -c "printenv.py incoming"
+  > pretxnchangegroup = sh -c "printenv.py --line pretxnchangegroup"
+  > changegroup = sh -c "printenv.py --line changegroup"
+  > incoming = sh -c "printenv.py --line incoming"
   > EOF
 
 Pull the new commits in the clone
@@ -81,18 +81,63 @@ Pull the new commits in the clone
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup
+  HG_HOOKTYPE=pretxnchangegroup
+  HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56
+  HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56
+  HG_PENDING=$TESTTMP/clone
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   remote: changegroup2
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup
+  HG_HOOKTYPE=pretxnchangegroup
+  HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757
+  HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757
+  HG_PENDING=$TESTTMP/clone
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   new changesets 27547f69f254:f838bfaca5c7
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56
+  HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757
+  HG_NODE_LAST=f838bfaca5c7226600ebcfd84f3c3c13a28d3757
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   pullop.cgresult is 1
   (run 'hg update' to get a working copy)
   $ hg update
@@ -152,21 +197,86 @@ pullop.cgresult
   adding manifests
   adding file changes
   added 2 changesets with 2 changes to 2 files (+1 heads)
-  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup
+  HG_HOOKTYPE=pretxnchangegroup
+  HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
+  HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3
+  HG_PENDING=$TESTTMP/clone
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   remote: changegroup2
   adding changesets
   adding manifests
   adding file changes
   added 3 changesets with 3 changes to 3 files (+1 heads)
-  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup
+  HG_HOOKTYPE=pretxnchangegroup
+  HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46
+  HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1
+  HG_PENDING=$TESTTMP/clone
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   new changesets b3325c91a4d9:5cd59d311f65
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
+  HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46
+  HG_NODE_LAST=5cd59d311f6508b8e0ed28a266756c859419c9f1
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   pullop.cgresult is 3
   (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg log -G
@@ -226,18 +336,63 @@ pullop.cgresult
   adding manifests
   adding file changes
   added 1 changesets with 0 changes to 0 files (-1 heads)
-  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup
+  HG_HOOKTYPE=pretxnchangegroup
+  HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4
+  HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4
+  HG_PENDING=$TESTTMP/clone
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   remote: changegroup2
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup
+  HG_HOOKTYPE=pretxnchangegroup
+  HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84
+  HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84
+  HG_PENDING=$TESTTMP/clone
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   new changesets 71bd7b46de72:9d18e5bd9ab0
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4
+  HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84
+  HG_NODE_LAST=9d18e5bd9ab09337802595d49f1dad0c98df4d84
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84
+  HG_PHASES_MOVED=1
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/repo
+  
   pullop.cgresult is -2
   (run 'hg update' to get a working copy)
   $ hg log -G
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 03 of 10] test: use `printenv.py --line` in `test-hook.t`

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671603 -3600
#      Sat Feb 09 01:20:03 2019 +0100
# Node ID 6179e9a9970f23c881187c71705cfe7347ed5c08
# Parent  c0b16be6b9b2d9535be8f1f2c91c5a8ebffa0b03
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 6179e9a9970f
test: use `printenv.py --line` in `test-hook.t`

This makes the output easier to update and read.

diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -14,32 +14,63 @@ commit hooks can see env vars
   $ cd a
   $ cat > .hg/hgrc <<EOF
   > [hooks]
-  > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit"
-  > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b"
-  > precommit = sh -c  "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit"
-  > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit"
+  > 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"
   > pretxncommit.tip = hg -q tip
-  > pre-identify = sh -c "printenv.py pre-identify 1"
-  > pre-cat = sh -c "printenv.py pre-cat"
-  > post-cat = sh -c "printenv.py post-cat"
-  > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen"
-  > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose"
-  > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose"
+  > 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"
   > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs
-  > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort"
+  > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnabort"
   > txnclose.checklock = sh -c "hg debuglock > /dev/null"
   > EOF
   $ echo a > a
   $ hg add a
   $ hg commit -m a
-  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
+  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
+  
   0:cb9a9f314b8b
-  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
+  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
+  
 
   $ hg clone . ../b
   updating to branch default
@@ -50,9 +81,9 @@ changegroup hooks can see env vars
 
   $ cat > .hg/hgrc <<EOF
   > [hooks]
-  > prechangegroup = sh -c "printenv.py prechangegroup"
-  > changegroup = sh -c "printenv.py changegroup"
-  > incoming = sh -c "printenv.py incoming"
+  > prechangegroup = sh -c "printenv.py --line prechangegroup"
+  > changegroup = sh -c "printenv.py --line changegroup"
+  > incoming = sh -c "printenv.py --line incoming"
   > EOF
 
 pretxncommit and commit hooks can see both parents of merge
@@ -60,103 +91,309 @@ pretxncommit and commit hooks can see bo
   $ cd ../a
   $ echo b >> a
   $ hg commit -m a1 -d "1 0"
-  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
+  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
+  
   1:ab228980c14d
-  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
+  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
+  
   $ 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'
-  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
+  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
+  
   2:ee9deb46ab31
-  pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
+  pretxnclose hook: HG_HOOKNAME=pretxnclose
+  HG_HOOKTYPE=pretxnclose
+  HG_PENDING=$TESTTMP/a
+  HG_TXNID=TXN:$ID$
+  HG_TXNNAME=commit
+  
   created new head
-  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
+  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
+  
   $ 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'
-  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
+  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
+  
   3:07f3376c1e65
-  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
+  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
+  
 
 test generic hooks
 
   $ hg id
-  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=[]
+  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=[]
+  
   abort: pre-identify hook exited with status 1
   [255]
   $ hg cat b
-  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']
+  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']
+  
   b
-  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
+  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
+  
 
   $ cd ../b
   $ hg pull ../a
   pulling from ../a
   searching for changes
-  prechangegroup hook: HG_HOOKNAME=prechangegroup HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
+  prechangegroup hook: HG_HOOKNAME=prechangegroup
+  HG_HOOKTYPE=prechangegroup
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/a
+  
   adding changesets
   adding manifests
   adding file changes
   added 3 changesets with 2 changes to 2 files
   new changesets ab228980c14d:07f3376c1e65
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
-  incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
+  HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/a
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/a
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/a
+  
+  incoming hook: HG_HOOKNAME=incoming
+  HG_HOOKTYPE=incoming
+  HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/a
+  
   (run 'hg update' to get a working copy)
 
 tag hooks can see env vars
 
   $ cd ../a
   $ cat >> .hg/hgrc <<EOF
-  > pretag = sh -c "printenv.py pretag"
-  > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag"
+  > pretag = sh -c "printenv.py --line pretag"
+  > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py --line tag"
   > EOF
   $ hg tag -d '3 0' a
-  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
+  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
+  
   4:539e4b31b6dc
-  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
+  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
+  
   $ hg tag -l la
-  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
+  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
+  
 
 pretag hook can forbid tagging
 
   $ cat >> .hg/hgrc <<EOF
-  > pretag.forbid = sh -c "printenv.py pretag.forbid 1"
+  > pretag.forbid = sh -c "printenv.py --line pretag.forbid 1"
   > EOF
   $ hg tag -d '4 0' fa
-  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
+  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
+  
   abort: pretag.forbid hook exited with status 1
   [255]
   $ hg tag -l fla
-  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
+  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
+  
   abort: pretag.forbid hook exited with status 1
   [255]
 
@@ -165,22 +402,43 @@ more there after
 
   $ cat >> .hg/hgrc <<EOF
   > pretxncommit.forbid0 = sh -c "hg tip -q"
-  > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1"
+  > pretxncommit.forbid1 = sh -c "printenv.py --line pretxncommit.forbid 1"
   > EOF
   $ echo z > z
   $ hg add z
   $ hg -q tip
   4:539e4b31b6dc
   $ hg commit -m 'fail' -d '4 0'
-  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
+  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
+  
   5:6f611f8018c1
   5:6f611f8018c1
-  pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
+  pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1
+  HG_HOOKTYPE=pretxncommit
+  HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567
+  HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
+  HG_PENDING=$TESTTMP/a
+  
   transaction abort!
   txnabort Python hook: txnid,txnname
-  txnabort hook: HG_HOOKNAME=txnabort.1 HG_HOOKTYPE=txnabort HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
+  txnabort hook: HG_HOOKNAME=txnabort.1
+  HG_HOOKTYPE=txnabort
+  HG_TXNID=TXN:$ID$
+  HG_TXNNAME=commit
+  
   rollback completed
   abort: pretxncommit.forbid1 hook exited with status 1
   [255]
@@ -205,11 +463,17 @@ more there after
 precommit hook can prevent commit
 
   $ cat >> .hg/hgrc <<EOF
-  > precommit.forbid = sh -c "printenv.py precommit.forbid 1"
+  > precommit.forbid = sh -c "printenv.py --line precommit.forbid 1"
   > EOF
   $ hg commit -m 'fail' -d '4 0'
-  precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
-  precommit.forbid hook: HG_HOOKNAME=precommit.forbid HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
+  precommit hook: HG_HOOKNAME=precommit
+  HG_HOOKTYPE=precommit
+  HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
+  
+  precommit.forbid hook: HG_HOOKNAME=precommit.forbid
+  HG_HOOKTYPE=precommit
+  HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
+  
   abort: precommit.forbid hook exited with status 1
   [255]
   $ hg -q tip
@@ -218,26 +482,36 @@ precommit hook can prevent commit
 preupdate hook can prevent update
 
   $ cat >> .hg/hgrc <<EOF
-  > preupdate = sh -c "printenv.py preupdate"
+  > preupdate = sh -c "printenv.py --line preupdate"
   > EOF
   $ hg update 1
-  preupdate hook: HG_HOOKNAME=preupdate HG_HOOKTYPE=preupdate HG_PARENT1=ab228980c14d
+  preupdate hook: HG_HOOKNAME=preupdate
+  HG_HOOKTYPE=preupdate
+  HG_PARENT1=ab228980c14d
+  
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
 
 update hook
 
   $ cat >> .hg/hgrc <<EOF
-  > update = sh -c "printenv.py update"
+  > update = sh -c "printenv.py --line update"
   > EOF
   $ hg update
-  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
+  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
+  
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 pushkey hook
 
   $ cat >> .hg/hgrc <<EOF
-  > pushkey = sh -c "printenv.py pushkey"
+  > pushkey = sh -c "printenv.py --line pushkey"
   > EOF
   $ cd ../b
   $ hg bookmark -r null foo
@@ -245,10 +519,41 @@ pushkey hook
   pushing to ../a
   searching for changes
   no changes found
-  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$ 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
+  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$
+  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
+  
   exporting bookmark foo
   [1]
   $ cd ../a
@@ -256,16 +561,35 @@ pushkey hook
 listkeys hook
 
   $ cat >> .hg/hgrc <<EOF
-  > listkeys = sh -c "printenv.py listkeys"
+  > listkeys = sh -c "printenv.py --line listkeys"
   > EOF
   $ hg bookmark -r null bar
-  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
+  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
+  
   $ cd ../b
   $ hg pull -B bar ../a
   pulling from ../a
-  listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
+  listkeys hook: HG_HOOKNAME=listkeys
+  HG_HOOKTYPE=listkeys
+  HG_NAMESPACE=bookmarks
+  HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
+  
   no changes found
   adding remote bookmark bar
   $ cd ../a
@@ -273,18 +597,40 @@ listkeys hook
 test that prepushkey can prevent incoming keys
 
   $ cat >> .hg/hgrc <<EOF
-  > prepushkey = sh -c "printenv.py prepushkey.forbid 1"
+  > prepushkey = sh -c "printenv.py --line prepushkey.forbid 1"
   > EOF
   $ cd ../b
   $ hg bookmark -r null baz
   $ hg push -B baz ../a
   pushing to ../a
   searching for changes
-  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'}
+  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'}
+  
   no changes found
-  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$ HG_URL=file:$TESTTMP/a
+  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$
+  HG_URL=file:$TESTTMP/a
+  
   abort: prepushkey hook exited with status 1
   [255]
   $ cd ../a
@@ -292,16 +638,34 @@ test that prepushkey can prevent incomin
 test that prelistkeys can prevent listing keys
 
   $ cat >> .hg/hgrc <<EOF
-  > prelistkeys = sh -c "printenv.py prelistkeys.forbid 1"
+  > prelistkeys = sh -c "printenv.py --line prelistkeys.forbid 1"
   > EOF
   $ hg bookmark -r null quux
-  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
+  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
+  
   $ cd ../b
   $ hg pull -B quux ../a
   pulling from ../a
-  prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys HG_HOOKTYPE=prelistkeys HG_NAMESPACE=bookmarks
+  prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys
+  HG_HOOKTYPE=prelistkeys
+  HG_NAMESPACE=bookmarks
+  
   abort: prelistkeys hook exited with status 1
   [255]
   $ cd ../a
@@ -314,12 +678,17 @@ prechangegroup hook can prevent incoming
   3:07f3376c1e65
   $ cat > .hg/hgrc <<EOF
   > [hooks]
-  > prechangegroup.forbid = sh -c "printenv.py prechangegroup.forbid 1"
+  > prechangegroup.forbid = sh -c "printenv.py --line prechangegroup.forbid 1"
   > EOF
   $ hg pull ../a
   pulling from ../a
   searching for changes
-  prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
+  prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid
+  HG_HOOKTYPE=prechangegroup
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=file:$TESTTMP/a
+  
   abort: prechangegroup.forbid hook exited with status 1
   [255]
 
@@ -329,7 +698,7 @@ incoming changes no longer there after
   $ cat > .hg/hgrc <<EOF
   > [hooks]
   > pretxnchangegroup.forbid0 = hg tip -q
-  > pretxnchangegroup.forbid1 = sh -c "printenv.py pretxnchangegroup.forbid 1"
+  > pretxnchangegroup.forbid1 = sh -c "printenv.py --line pretxnchangegroup.forbid 1"
   > EOF
   $ hg pull ../a
   pulling from ../a
@@ -339,7 +708,15 @@ incoming changes no longer there after
   adding file changes
   added 1 changesets with 1 changes to 1 files
   4:539e4b31b6dc
-  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$ HG_URL=file:$TESTTMP/a
+  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$
+  HG_URL=file:$TESTTMP/a
+  
   transaction abort!
   rollback completed
   abort: pretxnchangegroup.forbid1 hook exited with status 1
@@ -352,14 +729,21 @@ outgoing hooks can see env vars
   $ rm .hg/hgrc
   $ cat > ../a/.hg/hgrc <<EOF
   > [hooks]
-  > preoutgoing = sh -c "printenv.py preoutgoing"
-  > outgoing = sh -c "printenv.py outgoing"
+  > preoutgoing = sh -c "printenv.py --line preoutgoing"
+  > outgoing = sh -c "printenv.py --line outgoing"
   > EOF
   $ hg pull ../a
   pulling from ../a
   searching for changes
-  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
+  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
+  
   adding changesets
   adding manifests
   adding file changes
@@ -373,13 +757,19 @@ outgoing hooks can see env vars
 preoutgoing hook can prevent outgoing changes
 
   $ cat >> ../a/.hg/hgrc <<EOF
-  > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1"
+  > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
   > EOF
   $ hg pull ../a
   pulling from ../a
   searching for changes
-  preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
-  preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
+  preoutgoing hook: HG_HOOKNAME=preoutgoing
+  HG_HOOKTYPE=preoutgoing
+  HG_SOURCE=pull
+  
+  preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
+  HG_HOOKTYPE=preoutgoing
+  HG_SOURCE=pull
+  
   abort: preoutgoing.forbid hook exited with status 1
   [255]
 
@@ -388,12 +778,19 @@ outgoing hooks work for local clones
   $ cd ..
   $ cat > a/.hg/hgrc <<EOF
   > [hooks]
-  > preoutgoing = sh -c "printenv.py preoutgoing"
-  > outgoing = sh -c "printenv.py outgoing"
+  > preoutgoing = sh -c "printenv.py --line preoutgoing"
+  > outgoing = sh -c "printenv.py --line outgoing"
   > EOF
   $ hg clone a c
-  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
+  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
+  
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm -rf c
@@ -401,11 +798,17 @@ outgoing hooks work for local clones
 preoutgoing hook can prevent outgoing changes for local clones
 
   $ cat >> a/.hg/hgrc <<EOF
-  > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1"
+  > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
   > EOF
   $ hg clone a zzz
-  preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
-  preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
+  preoutgoing hook: HG_HOOKNAME=preoutgoing
+  HG_HOOKTYPE=preoutgoing
+  HG_SOURCE=clone
+  
+  preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
+  HG_HOOKTYPE=preoutgoing
+  HG_SOURCE=clone
+  
   abort: preoutgoing.forbid hook exited with status 1
   [255]
 
@@ -780,10 +1183,16 @@ This also creates the `to` repo for the
   $ cd ..
   $ cat << EOF >> hgrc-with-post-init-hook
   > [hooks]
-  > post-init = sh -c "printenv.py post-init"
+  > post-init = sh -c "printenv.py --line post-init"
   > EOF
   $ HGRCPATH=hgrc-with-post-init-hook hg init to
-  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
+  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
+  
 
 new commits must be visible in pretxnchangegroup (issue3428)
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 04 of 10] test: use `printenv.py --line` in `test-http-bundle1.t`

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671635 -3600
#      Sat Feb 09 01:20:35 2019 +0100
# Node ID 558d98d70bd179e79d8e24510933425062118ace
# Parent  6179e9a9970f23c881187c71705cfe7347ed5c08
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 558d98d70bd1
test: use `printenv.py --line` in `test-http-bundle1.t`

This makes the output easier to update and read.

diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
--- a/tests/test-http-bundle1.t
+++ b/tests/test-http-bundle1.t
@@ -151,7 +151,7 @@ pull
   $ cd copy-pull
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup"
+  > changegroup = sh -c "printenv.py --line changegroup"
   > EOF
   $ hg pull
   pulling from <a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/
@@ -161,7 +161,14 @@ pull
   adding file changes
   added 1 changesets with 1 changes to 1 files
   new changesets 5fed3813f7f5
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=<a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
+  HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=<a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/
+  
   (run 'hg update' to get a working copy)
   $ cd ..
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 05 of 10] test: use `printenv.py --line` in `test-https.t`

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671740 -3600
#      Sat Feb 09 01:22:20 2019 +0100
# Node ID a49388cc4f239e28d47a9f61992a58957e8e2bca
# Parent  558d98d70bd179e79d8e24510933425062118ace
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a49388cc4f23
test: use `printenv.py --line` in `test-https.t`

This makes the output easier to update and read.

diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -207,7 +207,7 @@ pull without cacert
   $ cd copy-pull
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup"
+  > changegroup = sh -c "printenv.py --line changegroup"
   > EOF
   $ hg pull $DISABLECACERTS
   pulling from <a href="https://localhost:$HGPORT/">https://localhost:$HGPORT/
@@ -226,7 +226,14 @@ pull without cacert
   adding file changes
   added 1 changesets with 1 changes to 1 files
   new changesets 5fed3813f7f5
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=<a href="https://localhost:$HGPORT/">https://localhost:$HGPORT/
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
+  HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=<a href="https://localhost:$HGPORT/">https://localhost:$HGPORT/
+  
   (run 'hg update' to get a working copy)
   $ cd ..
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 06 of 10] test: use `printenv.py --line` in `test-push-http.t`

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671809 -3600
#      Sat Feb 09 01:23:29 2019 +0100
# Node ID 57b13716b11564118f9ade8808c4ccff2e0eeaab
# Parent  a49388cc4f239e28d47a9f61992a58957e8e2bca
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 57b13716b115
test: use `printenv.py --line` in `test-push-http.t`

This makes the output easier to update and read.

diff --git a/tests/test-push-http.t b/tests/test-push-http.t
--- a/tests/test-push-http.t
+++ b/tests/test-push-http.t
@@ -74,8 +74,8 @@ expect success
   $ cat >> .hg/hgrc <<EOF
   > allow_push = *
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup 0"
-  > pushkey = sh -c "printenv.py pushkey 0"
+  > changegroup = sh -c "printenv.py --line changegroup 0"
+  > pushkey = sh -c "printenv.py --line pushkey 0"
   > txnclose-phase.test = sh $TESTTMP/hook.sh
   > EOF
   $ req "--debug --config extensions.blackbox="
@@ -94,8 +94,15 @@ expect success
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
-  remote: running hook changegroup: sh -c "printenv.py changegroup 0"
-  remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
+  remote: running hook changegroup: sh -c "printenv.py --line changegroup 0"
+  remote: changegroup hook: HG_HOOKNAME=changegroup
+  remote: HG_HOOKTYPE=changegroup
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
@@ -114,8 +121,15 @@ expect success
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   remote: running hook txnclose-phase.test: sh $TESTTMP/hook.sh
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
-  remote: running hook changegroup: sh -c "printenv.py changegroup 0"
-  remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
+  remote: running hook changegroup: sh -c "printenv.py --line changegroup 0"
+  remote: changegroup hook: HG_HOOKNAME=changegroup
+  remote: HG_HOOKTYPE=changegroup
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
@@ -125,8 +139,8 @@ expect success
   $ cat >> .hg/hgrc <<EOF
   > allow_push = *
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup 0"
-  > pushkey = sh -c "printenv.py pushkey 0"
+  > changegroup = sh -c "printenv.py --line changegroup 0"
+  > pushkey = sh -c "printenv.py --line pushkey 0"
   > txnclose-phase.test = sh $TESTTMP/hook.sh
   > EOF
   $ req
@@ -138,7 +152,15 @@ expect success
   remote: added 1 changesets with 1 changes to 1 files
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
-  remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
+  remote: changegroup hook: HG_BUNDLE2=1
+  remote: HG_HOOKNAME=changegroup
+  remote: HG_HOOKTYPE=changegroup
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
@@ -157,8 +179,16 @@ expect success, server lacks the httphea
   remote: added 1 changesets with 1 changes to 1 files
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
-  remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle1 !)
-  remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle2 !)
+  remote: changegroup hook: HG_HOOKNAME=changegroup (no-bundle2 !)
+  remote: changegroup hook: HG_BUNDLE2=1 (bundle2 !)
+  remote: HG_HOOKNAME=changegroup (bundle2 !)
+  remote: HG_HOOKTYPE=changegroup
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
@@ -176,8 +206,16 @@ expect success, server lacks the unbundl
   remote: added 1 changesets with 1 changes to 1 files
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
-  remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle1 !)
-  remote: changegroup hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) (bundle2 !)
+  remote: changegroup hook: HG_HOOKNAME=changegroup (no-bundle2 !)
+  remote: changegroup hook: HG_BUNDLE2=1 (bundle2 !)
+  remote: HG_HOOKNAME=changegroup (bundle2 !)
+  remote: HG_HOOKTYPE=changegroup
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
@@ -209,6 +247,14 @@ has no parameter
   remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  draft -> public
   remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872:   -> public
   remote: changegroup hook: * (glob)
+  remote: HG_HOOKNAME=changegroup (bundle2 !)
+  remote: HG_HOOKTYPE=changegroup
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
@@ -221,7 +267,7 @@ Test pushing to a publishing repository
   > push_ssl = false
   > allow_push = *
   > [hooks]
-  > prepushkey = sh -c "printenv.py prepushkey 1"
+  > prepushkey = sh -c "printenv.py --line prepushkey 1"
   > [devel]
   > legacy.exchange=phases
   > EOF
@@ -253,7 +299,21 @@ and fails the entire push.
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
+  remote: prepushkey hook: HG_BUNDLE2=1
+  remote: HG_HOOKNAME=prepushkey
+  remote: HG_HOOKTYPE=prepushkey
+  remote: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NAMESPACE=phases
+  remote: HG_NEW=0
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_OLD=1
+  remote: HG_PENDING=$TESTTMP/test
+  remote: HG_PHASES_MOVED=1
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   remote: pushkey-abort: prepushkey hook exited with status 1
   remote: transaction abort!
   remote: rollback completed
@@ -267,7 +327,7 @@ Now remove the failing prepushkey hook.
 
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > prepushkey = sh -c "printenv.py prepushkey 0"
+  > prepushkey = sh -c "printenv.py --line prepushkey 0"
   > EOF
 
 We don't need to test bundle1 because it succeeded above.
@@ -280,7 +340,21 @@ We don't need to test bundle1 because it
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
+  remote: prepushkey hook: HG_BUNDLE2=1
+  remote: HG_HOOKNAME=prepushkey
+  remote: HG_HOOKTYPE=prepushkey
+  remote: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NAMESPACE=phases
+  remote: HG_NEW=0
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_OLD=1
+  remote: HG_PENDING=$TESTTMP/test
+  remote: HG_PHASES_MOVED=1
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
 #endif
 
@@ -293,7 +367,7 @@ Now do a variant of the above, except on
   > [phases]
   > publish = false
   > [hooks]
-  > prepushkey = sh -c "printenv.py prepushkey 1"
+  > prepushkey = sh -c "printenv.py --line prepushkey 1"
   > EOF
 
 #if bundle1
@@ -304,7 +378,13 @@ Now do a variant of the above, except on
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1
+  remote: prepushkey hook: HG_HOOKNAME=prepushkey
+  remote: HG_HOOKTYPE=prepushkey
+  remote: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NAMESPACE=phases
+  remote: HG_NEW=0
+  remote: HG_OLD=1
+  remote:
   remote: pushkey-abort: prepushkey hook exited with status 1
   updating ba677d0156c1 to public failed!
   % serve errors
@@ -318,7 +398,21 @@ Now do a variant of the above, except on
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
+  remote: prepushkey hook: HG_BUNDLE2=1
+  remote: HG_HOOKNAME=prepushkey
+  remote: HG_HOOKTYPE=prepushkey
+  remote: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NAMESPACE=phases
+  remote: HG_NEW=0
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_OLD=1
+  remote: HG_PENDING=$TESTTMP/test
+  remote: HG_PHASES_MOVED=1
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   remote: pushkey-abort: prepushkey hook exited with status 1
   remote: transaction abort!
   remote: rollback completed
@@ -331,7 +425,7 @@ Make phases updates work
 
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > prepushkey = sh -c "printenv.py prepushkey 0"
+  > prepushkey = sh -c "printenv.py --line prepushkey 0"
   > EOF
 
 #if bundle1
@@ -339,7 +433,13 @@ Make phases updates work
   pushing to <a href="http://localhost:$HGPORT/">http://localhost:$HGPORT/
   searching for changes
   no changes found
-  remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1
+  remote: prepushkey hook: HG_HOOKNAME=prepushkey
+  remote: HG_HOOKTYPE=prepushkey
+  remote: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NAMESPACE=phases
+  remote: HG_NEW=0
+  remote: HG_OLD=1
+  remote:
   % serve errors
   [1]
 #endif
@@ -352,7 +452,21 @@ Make phases updates work
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob)
+  remote: prepushkey hook: HG_BUNDLE2=1
+  remote: HG_HOOKNAME=prepushkey
+  remote: HG_HOOKTYPE=prepushkey
+  remote: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NAMESPACE=phases
+  remote: HG_NEW=0
+  remote: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
+  remote: HG_OLD=1
+  remote: HG_PENDING=$TESTTMP/test
+  remote: HG_PHASES_MOVED=1
+  remote: HG_SOURCE=serve
+  remote: HG_TXNID=TXN:$ID$
+  remote: HG_URL=remote:http:$LOCALIP: (glob)
+  remote:
   % serve errors
 #endif
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 07 of 10] test: use `printenv.py --line` in `test-ssh-bundle1.t`

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671829 -3600
#      Sat Feb 09 01:23:49 2019 +0100
# Node ID c9b41ca8817953610befc9a8e89eed6e98b5a8f0
# Parent  57b13716b11564118f9ade8808c4ccff2e0eeaab
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c9b41ca88179
test: use `printenv.py --line` in `test-ssh-bundle1.t`

This makes the output easier to update and read.

diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t
--- a/tests/test-ssh-bundle1.t
+++ b/tests/test-ssh-bundle1.t
@@ -46,7 +46,7 @@ configure for serving
   > uncompressed = True
   >
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog"
+  > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
   > EOF
   $ cd $TESTTMP
 
@@ -131,7 +131,7 @@ verify
   checked 3 changesets with 2 changes to 2 files
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
+  > changegroup = sh -c "printenv.py --line changegroup-in-local 0 ../dummylog"
   > EOF
 
 empty default pull
@@ -514,7 +514,14 @@ debug output
   Got arguments 1:user@dummy 2:hg -R local serve --stdio
   Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
+  changegroup-in-remote hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
+  HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
+  HG_SOURCE=serve
+  HG_TXNID=TXN:$ID$
+  HG_URL=remote:ssh:$LOCALIP
+  
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -524,7 +531,14 @@ debug output
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
+  changegroup-in-remote hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
+  HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
+  HG_SOURCE=serve
+  HG_TXNID=TXN:$ID$
+  HG_URL=remote:ssh:$LOCALIP
+  
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg init 'a repo'
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
@@ -532,7 +546,14 @@ debug output
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
+  changegroup-in-remote hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
+  HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
+  HG_SOURCE=serve
+  HG_TXNID=TXN:$ID$
+  HG_URL=remote:ssh:$LOCALIP
+  
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
 
 remote hook failure is attributed to remote
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 08 of 10] test: use `printenv.py --line` in `test-ssh.t`

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671859 -3600
#      Sat Feb 09 01:24:19 2019 +0100
# Node ID a625670bc72dc8ad2b950d77fb5a72e004b911c7
# Parent  c9b41ca8817953610befc9a8e89eed6e98b5a8f0
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a625670bc72d
test: use `printenv.py --line` in `test-ssh.t`

This makes the output easier to update and read.

diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -36,7 +36,7 @@ configure for serving
   > uncompressed = True
   >
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog"
+  > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
   > EOF
   $ cd $TESTTMP
 
@@ -563,7 +563,15 @@ debug output
   Got arguments 1:user@dummy 2:hg -R local serve --stdio
   Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
+  changegroup-in-remote hook: HG_BUNDLE2=1
+  HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
+  HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
+  HG_SOURCE=serve
+  HG_TXNID=TXN:$ID$
+  HG_URL=remote:ssh:$LOCALIP
+  
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -573,9 +581,25 @@ debug output
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
+  changegroup-in-remote hook: HG_BUNDLE2=1
+  HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
+  HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
+  HG_SOURCE=serve
+  HG_TXNID=TXN:$ID$
+  HG_URL=remote:ssh:$LOCALIP
+  
   Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
-  changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP (chg !)
+  changegroup-in-remote hook: HG_BUNDLE2=1 (chg !)
+  HG_HOOKNAME=changegroup (chg !)
+  HG_HOOKTYPE=changegroup (chg !)
+  HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
+  HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
+  HG_SOURCE=serve (chg !)
+  HG_TXNID=TXN:$ID$ (chg !)
+  HG_URL=remote:ssh:$LOCALIP (chg !)
+   (chg !)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg init 'a repo'
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
@@ -583,9 +607,18 @@ debug output
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
+  changegroup-in-remote hook: HG_BUNDLE2=1
+  HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
+  HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
+  HG_SOURCE=serve
+  HG_TXNID=TXN:$ID$
+  HG_URL=remote:ssh:$LOCALIP
+  
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
 
+
 remote hook failure is attributed to remote
 
   $ cat > $TESTTMP/failhook << EOF
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 09 of 10] test: use `printenv.py --line` in `test-static-http.t`

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671872 -3600
#      Sat Feb 09 01:24:32 2019 +0100
# Node ID 62d13ee8373ad4a7c97192680a4781fe5818a1df
# Parent  a625670bc72dc8ad2b950d77fb5a72e004b911c7
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 62d13ee8373a
test: use `printenv.py --line` in `test-static-http.t`

This makes the output easier to update and read.

diff --git a/tests/test-static-http.t b/tests/test-static-http.t
--- a/tests/test-static-http.t
+++ b/tests/test-static-http.t
@@ -57,7 +57,7 @@ check for HTTP opener failures when cach
   $ cd ../local
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
-  > changegroup = sh -c "printenv.py changegroup"
+  > changegroup = sh -c "printenv.py --line changegroup"
   > EOF
   $ hg pull
   pulling from static-<a href="http://localhost:$HGPORT/remote">http://localhost:$HGPORT/remote
@@ -67,7 +67,14 @@ check for HTTP opener failures when cach
   adding file changes
   added 1 changesets with 1 changes to 1 files
   new changesets 4ac2e3648604
-  changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=<a href="http://localhost:$HGPORT/remote">http://localhost:$HGPORT/remote
+  changegroup hook: HG_HOOKNAME=changegroup
+  HG_HOOKTYPE=changegroup
+  HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432
+  HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
+  HG_SOURCE=pull
+  HG_TXNID=TXN:$ID$
+  HG_URL=<a href="http://localhost:$HGPORT/remote">http://localhost:$HGPORT/remote
+  
   (run 'hg update' to get a working copy)
 
 trying to push
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 10 of 10] transaction: include txnname in the hookargs dictionary

Boris Feld
In reply to this post by Boris Feld
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549749690 -3600
#      Sat Feb 09 23:01:30 2019 +0100
# Node ID f4936120d74a81199068bed14a04ac65f24f6109
# Parent  62d13ee8373ad4a7c97192680a4781fe5818a1df
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f4936120d74a
transaction: include txnname in the hookargs dictionary

There is no reason to not include the txnname alongside the txnid in all case.
So let's do that. If the transaction name is useful to internal code, it can
be useful for hooks.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1811,7 +1811,6 @@ class localrepository(object):
                     args = tr.hookargs.copy()
                     args.update(bookmarks.preparehookargs(name, old, new))
                     repo.hook('pretxnclose-bookmark', throw=True,
-                              txnname=desc,
                               **pycompat.strkwargs(args))
             if hook.hashook(repo.ui, 'pretxnclose-phase'):
                 cl = repo.unfiltered().changelog
@@ -1819,11 +1818,11 @@ class localrepository(object):
                     args = tr.hookargs.copy()
                     node = hex(cl.node(rev))
                     args.update(phases.preparehookargs(node, old, new))
-                    repo.hook('pretxnclose-phase', throw=True, txnname=desc,
+                    repo.hook('pretxnclose-phase', throw=True,
                               **pycompat.strkwargs(args))
 
             repo.hook('pretxnclose', throw=True,
-                      txnname=desc, **pycompat.strkwargs(tr.hookargs))
+                      **pycompat.strkwargs(tr.hookargs))
         def releasefn(tr, success):
             repo = reporef()
             if success:
@@ -1857,6 +1856,7 @@ class localrepository(object):
         tr.changes['bookmarks'] = {}
 
         tr.hookargs['txnid'] = txnid
+        tr.hookargs['txnname'] = desc
         # note: writing the fncache only during finalize mean that the file is
         # outdated when running hooks. As fncache is used for streaming clone,
         # this is not expected to break anything that happen during the hooks.
@@ -1878,7 +1878,7 @@ class localrepository(object):
                         args = tr.hookargs.copy()
                         args.update(bookmarks.preparehookargs(name, old, new))
                         repo.hook('txnclose-bookmark', throw=False,
-                                  txnname=desc, **pycompat.strkwargs(args))
+                                  **pycompat.strkwargs(args))
 
                 if hook.hashook(repo.ui, 'txnclose-phase'):
                     cl = repo.unfiltered().changelog
@@ -1887,10 +1887,10 @@ class localrepository(object):
                         args = tr.hookargs.copy()
                         node = hex(cl.node(rev))
                         args.update(phases.preparehookargs(node, old, new))
-                        repo.hook('txnclose-phase', throw=False, txnname=desc,
+                        repo.hook('txnclose-phase', throw=False,
                                   **pycompat.strkwargs(args))
 
-                repo.hook('txnclose', throw=False, txnname=desc,
+                repo.hook('txnclose', throw=False,
                           **pycompat.strkwargs(hookargs))
             reporef()._afterlock(hookfunc)
         tr.addfinalize('txnclose-hook', txnclosehook)
@@ -1902,7 +1902,7 @@ class localrepository(object):
         def txnaborthook(tr2):
             """To be run if transaction is aborted
             """
-            reporef().hook('txnabort', throw=False, txnname=desc,
+            reporef().hook('txnabort', throw=False,
                            **pycompat.strkwargs(tr2.hookargs))
         tr.addabort('txnabort-hook', txnaborthook)
         # avoid eager cache invalidation. in-memory data should be identical
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -239,6 +239,8 @@ hg -R bundle://../full.hg verify
   HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  bundle:../full.hg
   HG_URL=bundle:../full.hg
   
   (run 'hg heads' to see heads, 'hg merge' to merge)
@@ -270,6 +272,8 @@ Pull full.hg into empty again (using -R;
   HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  bundle:empty+full.hg
   HG_URL=bundle:empty+full.hg
   
   (run 'hg heads' to see heads, 'hg merge' to merge)
diff --git a/tests/test-bundle2-multiple-changegroups.t b/tests/test-bundle2-multiple-changegroups.t
--- a/tests/test-bundle2-multiple-changegroups.t
+++ b/tests/test-bundle2-multiple-changegroups.t
@@ -88,6 +88,8 @@ Pull the new commits in the clone
   HG_PENDING=$TESTTMP/clone
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   remote: changegroup2
@@ -103,6 +105,8 @@ Pull the new commits in the clone
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   new changesets 27547f69f254:f838bfaca5c7
@@ -112,6 +116,8 @@ Pull the new commits in the clone
   HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -119,6 +125,8 @@ Pull the new commits in the clone
   HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   changegroup hook: HG_HOOKNAME=changegroup
@@ -128,6 +136,8 @@ Pull the new commits in the clone
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -136,6 +146,8 @@ Pull the new commits in the clone
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   pullop.cgresult is 1
@@ -204,6 +216,8 @@ pullop.cgresult
   HG_PENDING=$TESTTMP/clone
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   remote: changegroup2
@@ -219,6 +233,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   new changesets b3325c91a4d9:5cd59d311f65
@@ -228,6 +244,8 @@ pullop.cgresult
   HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -235,6 +253,8 @@ pullop.cgresult
   HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -242,6 +262,8 @@ pullop.cgresult
   HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   changegroup hook: HG_HOOKNAME=changegroup
@@ -251,6 +273,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -259,6 +283,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -267,6 +293,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -275,6 +303,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   pullop.cgresult is 3
@@ -343,6 +373,8 @@ pullop.cgresult
   HG_PENDING=$TESTTMP/clone
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   remote: changegroup2
@@ -358,6 +390,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   new changesets 71bd7b46de72:9d18e5bd9ab0
@@ -367,6 +401,8 @@ pullop.cgresult
   HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -374,6 +410,8 @@ pullop.cgresult
   HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   changegroup hook: HG_HOOKNAME=changegroup
@@ -383,6 +421,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   incoming hook: HG_HOOKNAME=incoming
@@ -391,6 +431,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo
   
   pullop.cgresult is -2
diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -252,6 +252,8 @@ test generic hooks
   HG_HOOKTYPE=prechangegroup
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a
   
   adding changesets
@@ -265,6 +267,8 @@ test generic hooks
   HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a
   
   incoming hook: HG_HOOKNAME=incoming
@@ -272,6 +276,8 @@ test generic hooks
   HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a
   
   incoming hook: HG_HOOKNAME=incoming
@@ -279,6 +285,8 @@ test generic hooks
   HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a
   
   incoming hook: HG_HOOKNAME=incoming
@@ -286,6 +294,8 @@ test generic hooks
   HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a
   
   (run 'hg update' to get a working copy)
@@ -543,6 +553,7 @@ pushkey hook
   HG_PUSHKEYCOMPAT=1
   HG_SOURCE=push
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=push
   HG_URL=file:$TESTTMP/a
   
   txnclose hook: HG_BOOKMARK_MOVED=1
@@ -629,6 +640,7 @@ test that prepushkey can prevent incomin
   HG_PUSHKEYCOMPAT=1
   HG_SOURCE=push
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=push
   HG_URL=file:$TESTTMP/a
   
   abort: prepushkey hook exited with status 1
@@ -687,6 +699,8 @@ prechangegroup hook can prevent incoming
   HG_HOOKTYPE=prechangegroup
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a
   
   abort: prechangegroup.forbid hook exited with status 1
@@ -715,6 +729,8 @@ incoming changes no longer there after
   HG_PENDING=$TESTTMP/b
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a
   
   transaction abort!
diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
--- a/tests/test-http-bundle1.t
+++ b/tests/test-http-bundle1.t
@@ -167,6 +167,8 @@ pull
   HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  <a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/
   HG_URL=<a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/
   
   (run 'hg update' to get a working copy)
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -156,6 +156,8 @@ pull
   HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  <a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/
   HG_URL=<a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/
   
   (run 'hg update' to get a working copy)
diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -232,6 +232,8 @@ pull without cacert
   HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  <a href="https://localhost:$HGPORT/">https://localhost:$HGPORT/
   HG_URL=<a href="https://localhost:$HGPORT/">https://localhost:$HGPORT/
   
   (run 'hg update' to get a working copy)
diff --git a/tests/test-push-http.t b/tests/test-push-http.t
--- a/tests/test-push-http.t
+++ b/tests/test-push-http.t
@@ -101,6 +101,8 @@ expect success
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -128,6 +130,8 @@ expect success
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -159,6 +163,7 @@ expect success
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -187,6 +192,8 @@ expect success, server lacks the httphea
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob) (no-bundle2 !)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -214,6 +221,8 @@ expect success, server lacks the unbundl
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob) (no-bundle2 !)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -253,6 +262,8 @@ has no parameter
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob) (no-bundle2 !)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -312,6 +323,7 @@ and fails the entire push.
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   remote: pushkey-abort: prepushkey hook exited with status 1
@@ -353,6 +365,7 @@ We don't need to test bundle1 because it
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -411,6 +424,7 @@ Now do a variant of the above, except on
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   remote: pushkey-abort: prepushkey hook exited with status 1
@@ -465,6 +479,7 @@ Make phases updates work
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t
--- a/tests/test-ssh-bundle1.t
+++ b/tests/test-ssh-bundle1.t
@@ -520,6 +520,8 @@ debug output
   HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
+  remote:ssh:$LOCALIP
   HG_URL=remote:ssh:$LOCALIP
   
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -537,6 +539,8 @@ debug output
   HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
+  remote:ssh:$LOCALIP
   HG_URL=remote:ssh:$LOCALIP
   
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -552,6 +556,8 @@ debug output
   HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
+  remote:ssh:$LOCALIP
   HG_URL=remote:ssh:$LOCALIP
   
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -570,6 +570,7 @@ debug output
   HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
   HG_URL=remote:ssh:$LOCALIP
   
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -588,6 +589,7 @@ debug output
   HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
   HG_URL=remote:ssh:$LOCALIP
   
   Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
@@ -598,6 +600,7 @@ debug output
   HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
   HG_SOURCE=serve (chg !)
   HG_TXNID=TXN:$ID$ (chg !)
+  HG_TXNNAME=serve (chg !)
   HG_URL=remote:ssh:$LOCALIP (chg !)
    (chg !)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -614,6 +617,7 @@ debug output
   HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
   HG_URL=remote:ssh:$LOCALIP
   
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
diff --git a/tests/test-static-http.t b/tests/test-static-http.t
--- a/tests/test-static-http.t
+++ b/tests/test-static-http.t
@@ -73,6 +73,8 @@ check for HTTP opener failures when cach
   HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  <a href="http://localhost:$HGPORT/remote">http://localhost:$HGPORT/remote
   HG_URL=<a href="http://localhost:$HGPORT/remote">http://localhost:$HGPORT/remote
   
   (run 'hg update' to get a working copy)
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 10 of 10] transaction: include txnname in the hookargs dictionary

Pulkit Goyal


On Sun, Feb 10, 2019 at 3:54 AM Boris Feld <[hidden email]> wrote:
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549749690 -3600
#      Sat Feb 09 23:01:30 2019 +0100
# Node ID f4936120d74a81199068bed14a04ac65f24f6109
# Parent  62d13ee8373ad4a7c97192680a4781fe5818a1df
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f4936120d74a
transaction: include txnname in the hookargs dictionary

There is no reason to not include the txnname alongside the txnid in all case.
So let's do that. If the transaction name is useful to internal code, it can
be useful for hooks.

What are the cases when we have transaction name and source different?

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1811,7 +1811,6 @@ class localrepository(object):
                     args = tr.hookargs.copy()
                     args.update(bookmarks.preparehookargs(name, old, new))
                     repo.hook('pretxnclose-bookmark', throw=True,
-                              txnname=desc,
                               **pycompat.strkwargs(args))
             if hook.hashook(repo.ui, 'pretxnclose-phase'):
                 cl = repo.unfiltered().changelog
@@ -1819,11 +1818,11 @@ class localrepository(object):
                     args = tr.hookargs.copy()
                     node = hex(cl.node(rev))
                     args.update(phases.preparehookargs(node, old, new))
-                    repo.hook('pretxnclose-phase', throw=True, txnname=desc,
+                    repo.hook('pretxnclose-phase', throw=True,
                               **pycompat.strkwargs(args))

             repo.hook('pretxnclose', throw=True,
-                      txnname=desc, **pycompat.strkwargs(tr.hookargs))
+                      **pycompat.strkwargs(tr.hookargs))
         def releasefn(tr, success):
             repo = reporef()
             if success:
@@ -1857,6 +1856,7 @@ class localrepository(object):
         tr.changes['bookmarks'] = {}

         tr.hookargs['txnid'] = txnid
+        tr.hookargs['txnname'] = desc
         # note: writing the fncache only during finalize mean that the file is
         # outdated when running hooks. As fncache is used for streaming clone,
         # this is not expected to break anything that happen during the hooks.
@@ -1878,7 +1878,7 @@ class localrepository(object):
                         args = tr.hookargs.copy()
                         args.update(bookmarks.preparehookargs(name, old, new))
                         repo.hook('txnclose-bookmark', throw=False,
-                                  txnname=desc, **pycompat.strkwargs(args))
+                                  **pycompat.strkwargs(args))

                 if hook.hashook(repo.ui, 'txnclose-phase'):
                     cl = repo.unfiltered().changelog
@@ -1887,10 +1887,10 @@ class localrepository(object):
                         args = tr.hookargs.copy()
                         node = hex(cl.node(rev))
                         args.update(phases.preparehookargs(node, old, new))
-                        repo.hook('txnclose-phase', throw=False, txnname=desc,
+                        repo.hook('txnclose-phase', throw=False,
                                   **pycompat.strkwargs(args))

-                repo.hook('txnclose', throw=False, txnname=desc,
+                repo.hook('txnclose', throw=False,
                           **pycompat.strkwargs(hookargs))
             reporef()._afterlock(hookfunc)
         tr.addfinalize('txnclose-hook', txnclosehook)
@@ -1902,7 +1902,7 @@ class localrepository(object):
         def txnaborthook(tr2):
             """To be run if transaction is aborted
             """
-            reporef().hook('txnabort', throw=False, txnname=desc,
+            reporef().hook('txnabort', throw=False,
                            **pycompat.strkwargs(tr2.hookargs))
         tr.addabort('txnabort-hook', txnaborthook)
         # avoid eager cache invalidation. in-memory data should be identical
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -239,6 +239,8 @@ hg -R bundle://../full.hg verify
   HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  bundle:../full.hg
   HG_URL=bundle:../full.hg

   (run 'hg heads' to see heads, 'hg merge' to merge)
@@ -270,6 +272,8 @@ Pull full.hg into empty again (using -R;
   HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  bundle:empty+full.hg
   HG_URL=bundle:empty+full.hg

   (run 'hg heads' to see heads, 'hg merge' to merge)
diff --git a/tests/test-bundle2-multiple-changegroups.t b/tests/test-bundle2-multiple-changegroups.t
--- a/tests/test-bundle2-multiple-changegroups.t
+++ b/tests/test-bundle2-multiple-changegroups.t
@@ -88,6 +88,8 @@ Pull the new commits in the clone
   HG_PENDING=$TESTTMP/clone
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   remote: changegroup2
@@ -103,6 +105,8 @@ Pull the new commits in the clone
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   new changesets 27547f69f254:f838bfaca5c7
@@ -112,6 +116,8 @@ Pull the new commits in the clone
   HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -119,6 +125,8 @@ Pull the new commits in the clone
   HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   changegroup hook: HG_HOOKNAME=changegroup
@@ -128,6 +136,8 @@ Pull the new commits in the clone
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -136,6 +146,8 @@ Pull the new commits in the clone
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   pullop.cgresult is 1
@@ -204,6 +216,8 @@ pullop.cgresult
   HG_PENDING=$TESTTMP/clone
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   remote: changegroup2
@@ -219,6 +233,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   new changesets b3325c91a4d9:5cd59d311f65
@@ -228,6 +244,8 @@ pullop.cgresult
   HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -235,6 +253,8 @@ pullop.cgresult
   HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -242,6 +262,8 @@ pullop.cgresult
   HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   changegroup hook: HG_HOOKNAME=changegroup
@@ -251,6 +273,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -259,6 +283,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -267,6 +293,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -275,6 +303,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   pullop.cgresult is 3
@@ -343,6 +373,8 @@ pullop.cgresult
   HG_PENDING=$TESTTMP/clone
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   remote: changegroup2
@@ -358,6 +390,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   new changesets 71bd7b46de72:9d18e5bd9ab0
@@ -367,6 +401,8 @@ pullop.cgresult
   HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -374,6 +410,8 @@ pullop.cgresult
   HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   changegroup hook: HG_HOOKNAME=changegroup
@@ -383,6 +421,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   incoming hook: HG_HOOKNAME=incoming
@@ -391,6 +431,8 @@ pullop.cgresult
   HG_PHASES_MOVED=1
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/repo (glob)
   HG_URL=file:$TESTTMP/repo

   pullop.cgresult is -2
diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -252,6 +252,8 @@ test generic hooks
   HG_HOOKTYPE=prechangegroup
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a

   adding changesets
@@ -265,6 +267,8 @@ test generic hooks
   HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a

   incoming hook: HG_HOOKNAME=incoming
@@ -272,6 +276,8 @@ test generic hooks
   HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a

   incoming hook: HG_HOOKNAME=incoming
@@ -279,6 +285,8 @@ test generic hooks
   HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a

   incoming hook: HG_HOOKNAME=incoming
@@ -286,6 +294,8 @@ test generic hooks
   HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a

   (run 'hg update' to get a working copy)
@@ -543,6 +553,7 @@ pushkey hook
   HG_PUSHKEYCOMPAT=1
   HG_SOURCE=push
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=push
   HG_URL=file:$TESTTMP/a

   txnclose hook: HG_BOOKMARK_MOVED=1
@@ -629,6 +640,7 @@ test that prepushkey can prevent incomin
   HG_PUSHKEYCOMPAT=1
   HG_SOURCE=push
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=push
   HG_URL=file:$TESTTMP/a

   abort: prepushkey hook exited with status 1
@@ -687,6 +699,8 @@ prechangegroup hook can prevent incoming
   HG_HOOKTYPE=prechangegroup
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a

   abort: prechangegroup.forbid hook exited with status 1
@@ -715,6 +729,8 @@ incoming changes no longer there after
   HG_PENDING=$TESTTMP/b
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  file:/*/$TESTTMP/a (glob)
   HG_URL=file:$TESTTMP/a

   transaction abort!
diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
--- a/tests/test-http-bundle1.t
+++ b/tests/test-http-bundle1.t
@@ -167,6 +167,8 @@ pull
   HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  http://localhost:$HGPORT1/
   HG_URL=http://localhost:$HGPORT1/

   (run 'hg update' to get a working copy)
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -156,6 +156,8 @@ pull
   HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  http://localhost:$HGPORT1/
   HG_URL=http://localhost:$HGPORT1/

   (run 'hg update' to get a working copy)
diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -232,6 +232,8 @@ pull without cacert
   HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  https://localhost:$HGPORT/
   HG_URL=https://localhost:$HGPORT/

   (run 'hg update' to get a working copy)
diff --git a/tests/test-push-http.t b/tests/test-push-http.t
--- a/tests/test-push-http.t
+++ b/tests/test-push-http.t
@@ -101,6 +101,8 @@ expect success
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -128,6 +130,8 @@ expect success
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -159,6 +163,7 @@ expect success
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -187,6 +192,8 @@ expect success, server lacks the httphea
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob) (no-bundle2 !)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -214,6 +221,8 @@ expect success, server lacks the unbundl
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob) (no-bundle2 !)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -253,6 +262,8 @@ has no parameter
   remote: HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
+  remote: remote:http:$LOCALIP: (glob) (no-bundle2 !)
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -312,6 +323,7 @@ and fails the entire push.
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   remote: pushkey-abort: prepushkey hook exited with status 1
@@ -353,6 +365,7 @@ We don't need to test bundle1 because it
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
@@ -411,6 +424,7 @@ Now do a variant of the above, except on
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   remote: pushkey-abort: prepushkey hook exited with status 1
@@ -465,6 +479,7 @@ Make phases updates work
   remote: HG_PHASES_MOVED=1
   remote: HG_SOURCE=serve
   remote: HG_TXNID=TXN:$ID$
+  remote: HG_TXNNAME=serve
   remote: HG_URL=remote:http:$LOCALIP: (glob)
   remote:
   % serve errors
diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t
--- a/tests/test-ssh-bundle1.t
+++ b/tests/test-ssh-bundle1.t
@@ -520,6 +520,8 @@ debug output
   HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
+  remote:ssh:$LOCALIP
   HG_URL=remote:ssh:$LOCALIP

   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -537,6 +539,8 @@ debug output
   HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
+  remote:ssh:$LOCALIP
   HG_URL=remote:ssh:$LOCALIP

   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -552,6 +556,8 @@ debug output
   HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
+  remote:ssh:$LOCALIP
   HG_URL=remote:ssh:$LOCALIP

   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -570,6 +570,7 @@ debug output
   HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
   HG_URL=remote:ssh:$LOCALIP

   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -588,6 +589,7 @@ debug output
   HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
   HG_URL=remote:ssh:$LOCALIP

   Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
@@ -598,6 +600,7 @@ debug output
   HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
   HG_SOURCE=serve (chg !)
   HG_TXNID=TXN:$ID$ (chg !)
+  HG_TXNNAME=serve (chg !)
   HG_URL=remote:ssh:$LOCALIP (chg !)
    (chg !)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -614,6 +617,7 @@ debug output
   HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
   HG_SOURCE=serve
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=serve
   HG_URL=remote:ssh:$LOCALIP

   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
diff --git a/tests/test-static-http.t b/tests/test-static-http.t
--- a/tests/test-static-http.t
+++ b/tests/test-static-http.t
@@ -73,6 +73,8 @@ check for HTTP opener failures when cach
   HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
   HG_SOURCE=pull
   HG_TXNID=TXN:$ID$
+  HG_TXNNAME=pull
+  http://localhost:$HGPORT/remote
   HG_URL=http://localhost:$HGPORT/remote

   (run 'hg update' to get a working copy)
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 01 of 10] test: use `printenv.py --line` in `test-bundle.t`

Pulkit Goyal
In reply to this post by Boris Feld


On Sun, Feb 10, 2019 at 3:39 AM Boris Feld <[hidden email]> wrote:
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549671555 -3600
#      Sat Feb 09 01:19:15 2019 +0100
# Node ID 1736fe7d07d8a96349dc678f7a7bcba29886d1a7
# Parent  e89e78a725eebab0282b4dd669d07797511252f8
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1736fe7d07d8
test: use `printenv.py --line` in `test-bundle.t`

This makes the output easier to update and read.

Queued 1-9, many thanks!

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 10 of 10] transaction: include txnname in the hookargs dictionary

Boris Feld
In reply to this post by Pulkit Goyal
On 09/02/2019 23:34, Pulkit Goyal wrote:


On Sun, Feb 10, 2019 at 3:54 AM Boris Feld <[hidden email]> wrote:
# HG changeset patch
# User Boris Feld <[hidden email]>
# Date 1549749690 -3600
#      Sat Feb 09 23:01:30 2019 +0100
# Node ID f4936120d74a81199068bed14a04ac65f24f6109
# Parent  62d13ee8373ad4a7c97192680a4781fe5818a1df
# EXP-Topic hook.txname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f4936120d74a
transaction: include txnname in the hookargs dictionary

There is no reason to not include the txnname alongside the txnid in all case.
So let's do that. If the transaction name is useful to internal code, it can
be useful for hooks.

What are the cases when we have transaction name and source different?

I don't remember anything specific about the rationale for this patch. It has been laying around for a long while (first version date back from May 2015). At that point, I think the point is mostly to make the shell hook consistent with the python one. (Because the Python one take this argument already).

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel