cleanup: use backtick instead of parent to capture output of shell cmd

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
This commit is contained in:
Laurent Charignon 2016-01-07 18:30:24 -08:00
parent f35e1510b0
commit 0ca941a08a
30 changed files with 45 additions and 38 deletions

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/automv.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/commitextras.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,5 +1,5 @@
$ . "$TESTDIR/copytrace.sh"
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cat >> $HGRCPATH << EOF
> [ui]
> ssh = python "$RUNTESTDIR/dummyssh"

View File

@ -1,5 +1,5 @@
$ . "$TESTDIR/copytrace.sh"
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cat >> $HGRCPATH << EOF
> [extensions]
> copytrace=$extpath/copytrace

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/dirsync.py $TESTTMP
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/errorredirect.py $TESTTMP
$ cat > $TESTTMP/crash.py << EOF
> from mercurial import cmdutil

View File

@ -1,6 +1,6 @@
Test functionality is present
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/fbamend.py $TESTTMP # use $TESTTMP substitution in message
$ cp $extpath/fbhistedit.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF

View File

@ -1,12 +1,13 @@
$ . "$TESTDIR/histedit-helpers.sh"
$ extpath=`dirname $TESTDIR`
$ cp $extpath/fbhistedit.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH <<EOF
> [extensions]
> histedit=
> fbhistedit=$TESTTMP/fbhistedit.py
> EOF
$ echo "fbhistedit=$(echo $(dirname $TESTDIR))/fbhistedit.py" >> $HGRCPATH
Enable obsolete
$ cat > ${TESTTMP}/obs.py << EOF

View File

@ -1,12 +1,13 @@
$ . "$TESTDIR/histedit-helpers.sh"
$ extpath=`dirname $TESTDIR`
$ cp $extpath/fbhistedit.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH <<EOF
> [extensions]
> histedit=
> fbhistedit=$TESTTMP/fbhistedit.py
> EOF
$ echo "fbhistedit=$(echo $(dirname $TESTDIR))/fbhistedit.py" >> $HGRCPATH
$ initrepo ()
> {
> hg init r

View File

@ -1,15 +1,16 @@
$ . "$TESTDIR/histedit-helpers.sh"
$ extpath=`dirname $TESTDIR`
$ cp $extpath/fbhistedit.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH <<EOF
> [experimental]
> histeditng=True
> [extensions]
> rebase=
> histedit=
> fbhistedit=$TESTTMP/fbhistedit.py
> EOF
$ echo "fbhistedit=$(echo $(dirname $TESTDIR))/fbhistedit.py" >> $HGRCPATH
$ initrepo ()
> {
> hg init r

View File

@ -1,12 +1,13 @@
$ . "$TESTDIR/histedit-helpers.sh"
$ extpath=`dirname $TESTDIR`
$ cp $extpath/fbhistedit.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH <<EOF
> [extensions]
> histedit=
> fbhistedit=$TESTTMP/fbhistedit.py
> EOF
$ echo "fbhistedit=$(echo $(dirname $TESTDIR))/fbhistedit.py" >> $HGRCPATH
Enable obsolete
$ cat > ${TESTTMP}/obs.py << EOF

View File

@ -1,12 +1,13 @@
$ . "$TESTDIR/histedit-helpers.sh"
$ extpath=`dirname $TESTDIR`
$ cp $extpath/fbhistedit.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH <<EOF
> [extensions]
> histedit=
> fbhistedit=$TESTTMP/fbhistedit.py
> EOF
$ echo "fbhistedit=$(echo $(dirname $TESTDIR))/fbhistedit.py" >> $HGRCPATH
$ initrepo ()
> {
> hg init r

View File

@ -1,5 +1,5 @@
$ . "$TESTDIR/copytrace.sh"
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cat >> $HGRCPATH << EOF
> [extensions]
> fbamend=$extpath/fbamend.py

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/githelp.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,6 +1,6 @@
Setup
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/manifestdiskcache.py $TESTTMP # use $TESTTMP substitution in message
Test functionality is present

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/mergedriver.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,10 +1,15 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/morestatus.py $TESTTMP # use $TESTTMP substitution in message
$ cp $extpath/fbhistedit.py $TESTTMP # use $TESTTMP substitution in message
$ cp $extpath/reset.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [morestatus]
> show=True
> [extensions]
> morestatus=$TESTTMP/morestatus.py
> histedit=
> reset=$TESTTMP/reset.py
> fbhistedit=$TESTTMP/fbhistedit.py
> EOF
$ cat >> $TESTTMP/breakupdate.py << EOF
> import sys
@ -20,8 +25,6 @@ Test An empty repo should return no extra output
$ hg status
Test status on histedit stop
$ echo "histedit=" >> $HGRCPATH
$ echo "fbhistedit=$(echo $(dirname $TESTDIR))/fbhistedit.py" >> $HGRCPATH
$ echo 'a' > a
$ hg commit -Am 'a' -q
$ hg histedit -q --commands - . 2> /dev/null << EOF
@ -88,7 +91,6 @@ Test hg status is normal after graft abort
$ rm a.orig
Test unshelve state
$ echo "reset=" >> $HGRCPATH
$ echo "shelve=" >> $HGRCPATH
$ hg reset ".^" -q
resetting without an active bookmark

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/perftweaks.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,5 +1,5 @@
$ $PYTHON -c 'import remotenames' || exit 80
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cat > $TESTTMP/pretxnchangegroup.sh << EOF
> #!/bin/bash
> env | grep -E "^HG_USERVAR"

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cat > $TESTTMP/pretxnchangegroup.sh << EOF
> #!/bin/bash
> env | grep -E "^HG_USERVAR_DEBUG"

View File

@ -1,5 +1,5 @@
$ $PYTHON -c 'import remotenames' || exit 80
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/reflog.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/reflog.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,5 +1,5 @@
$ $PYTHON -c 'import remotenames' || exit 80
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/reset.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/reset.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,6 +1,6 @@
Setup the extension
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/simplecache.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,5 +1,5 @@
$ $PYTHON -c 'import remotenames' || exit 80
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/smartlog.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/tweakdefaults.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -2,7 +2,7 @@ Skip test if remotenames not present
$ $PYTHON -c 'import remotenames' || exit 80
Set up extensions (order is important here, we must test tweakdefaults loading last)
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/tweakdefaults.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -2,7 +2,7 @@ Check for remotenames and skip if not present
$ $PYTHON -c 'import remotenames' || exit 80
Set up
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/tweakdefaults.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1,4 +1,4 @@
$ extpath=$(dirname $TESTDIR)
$ extpath=`dirname $TESTDIR`
$ cp $extpath/tweakdefaults.py $TESTTMP # use $TESTTMP substitution in message
$ cp $extpath/fbamend.py $TESTTMP # use $TESTTMP substitution in message
$ cat >> $HGRCPATH << EOF