mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
0ca941a08a
Summary: This diff is part of a series to cleanup fb-hgext and make it pass check-code. Test Plan: all tests pass Reviewers: #sourcecontrol, ttung, mitrandir, akushner Reviewed By: akushner Subscribers: mpm, akushner, mitrandir Differential Revision: https://phabricator.fb.com/D2811997 Signature: t1:2811997:1452200059:9e4fca501a22f95d2d9a22d234758f55e292ea9a
59 lines
1.4 KiB
Perl
59 lines
1.4 KiB
Perl
$ 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/pushvars.py $TESTTMP # use $TESTTMP substitution in message
|
|
$ cat >> $HGRCPATH << EOF
|
|
> [extensions]
|
|
> pushvars=$TESTTMP/pushvars.py
|
|
> [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]
|