sapling/tests/test-fastpartialmatch-obsolete.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

68 lines
1.5 KiB
Perl

$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> hg ci -m "$1"
> }
$ cat >> $HGRCPATH << EOF
> [extensions]
> fastpartialmatch=$TESTDIR/../hgext3rd/fastpartialmatch.py
> strip=
> histedit=
> fbamend=$TESTDIR/../hgext3rd/fbamend
> [experimental]
> evolution=createmarkers
> [ui]
> ssh = python "$TESTDIR/dummyssh"
> EOF
$ hg init repo
$ cd repo
$ mkcommit firstcommit
$ hg prune .
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
working directory now at 000000000000
1 changesets pruned
$ hg debugrebuildpartialindex
$ hg debugcheckpartialindex
$ mkcommit first
$ hg debugcheckpartialindex
$ hg prune -q .
$ hg debugcheckpartialindex
Try histedit
$ mkcommit second
$ mkcommit third
$ mkcommit fourth
$ hg log --graph
@ changeset: 4:d5e85d22a345
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: fourth
|
o changeset: 3:a5b4be173947
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: third
|
o changeset: 2:be6305906393
parent: -1:000000000000
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: second
$ hg histedit --commands - <<EOF
> pick d5e85d22a345 3 fourth
> pick a5b4be173947 2 third
> pick be6305906393 1 second
> EOF
$ hg debugcheckpartialindex
Made commit, then amend it. Check partial index
$ mkcommit toamend
$ echo 1 > toamend
$ hg commit --amend -m amended
$ hg debugcheckpartialindex