sapling/tests/test-tweakdefaults-ordering.t
Jun Wu 4a936cee21 codemod: remove extpath in tests
Summary:
Previously, the following pattern is common in our tests:

```
   $ extpath=`dirname $TESTDIR`
   $ cp $extpath/hgext3rd/name.py $TESTTMP # use $TESTTMP substitution in message
   $ cat >> $HGRCPATH<<EOF
   > [extensions]
   > name=$TESTTMP/name.py
   > EOF
```

Now, it gets simplified to:

```
   $ cat >> $HGRCPATH<<EOF
   > [extensions]
   > name=$TESTDIR/../hgext3rd/name.py
   > EOF
```

This removes unnecessary `dirname` and `cp`.

Also fixed a regex that does not match `bytes`:

```
-  transferred 268 bytes in [\d.]+ seconds \([\d.]+ KB/sec\) (re)
+  transferred 268 bytes in 0.3 seconds (939 bytes/sec)
```

Test Plan: arc unit

Reviewers: #mercurial, phillco

Reviewed By: phillco

Subscribers: medson, mjpieters

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

Signature: t1:5270897:1497663052:bf860a0b480c751b1e4b53cebf6526193f0f6652
2017-06-16 18:31:25 -07:00

31 lines
743 B
Perl

Skip test if remotenames not present
$ . $TESTDIR/require-ext.sh remotenames
Set up extensions (order is important here, we must test tweakdefaults loading last)
$ cat >> $HGRCPATH << EOF
> [extensions]
> rebase=
> remotenames=
> tweakdefaults=$TESTDIR/../hgext3rd/tweakdefaults.py
> EOF
Run test
$ hg init repo
$ cd repo
$ touch a
$ hg commit -Aqm a
$ touch b
$ hg commit -Aqm b
$ hg bookmark AB
$ hg up ".^"
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(leaving bookmark AB)
$ touch c
$ hg commit -Aqm c
$ hg bookmark C -t AB
$ hg rebase
rebasing 2:d5e255ef74f8 "c" (tip C)
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d5e255ef74f8-7d2cc323-backup.hg (glob)