sapling/tests/test-pushvars.t
Jun Wu 8a3a99ba21 hgext: move single file extensions to hgext3rd
Summary:
Be a better citizen under system python path.

Fix all tests issues and change setup.py to use glob pattern to include
all extensions.

Test Plan:
Run tests and `make local`.
Also build and install the package and run `hg sl` in major repos.

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, durham, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3534311

Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2
2016-07-08 13:15:42 +01:00

65 lines
1.5 KiB
Perl

Setup
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
$ export PYTHONPATH
$ extpath=`dirname $TESTDIR`
$ cat > $TESTTMP/pretxnchangegroup.sh << EOF
> #!/bin/bash
> env | grep -E "^HG_USERVAR_DEBUG"
> env | grep -E "^HG_USERVAR_BYPASS_REVIEW"
> exit 0
> EOF
$ chmod +x $TESTTMP/pretxnchangegroup.sh
$ cp $extpath/hgext3rd/pushvars.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]
> bundle2hooks=
> pushvars=
> [hooks]
> pretxnchangegroup = $TESTTMP/pretxnchangegroup.sh
> [experimental]
> bundle2-exp = true
> EOF
$ hg init repo
$ hg clone -q repo child
$ cd child
Test pushing vars to repo
$ echo b > a
$ hg commit -Aqm a
$ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
pushing to $TESTTMP/repo (glob)
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
HG_USERVAR_DEBUG=1
HG_USERVAR_BYPASS_REVIEW=true
Test pushing var with empty right-hand side
$ echo b >> a
$ hg commit -Aqm a
$ hg push --pushvars "DEBUG="
pushing to $TESTTMP/repo (glob)
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
HG_USERVAR_DEBUG=
Test pushing bad vars
$ echo b >> a
$ hg commit -Aqm b
$ hg push --pushvars "DEBUG"
pushing to $TESTTMP/repo (glob)
searching for changes
abort: passed in variable needs to be of form var= or var=val. Instead, this was given "DEBUG"
[255]