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

33 lines
878 B
Perl

$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> hg ci -m "$1"
> }
$ cat >> $HGRCPATH << EOF
> [extensions]
> fastpartialmatch=$TESTDIR/../hgext3rd/fastpartialmatch.py
> strip=
> EOF
$ hg init repo
$ cd repo
$ hg debugbuilddag +2
$ hg log -r 1 -T '{node}\n'
66f7d451a68b85ed82ff5fcc254daf50c74144bd
$ hg strip -r 66f7d451a68b85ed8
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/66f7d451a68b-f4da9ecf-backup.hg (glob)
$ hg debugrebuildpartialindex
$ hg debugcheckpartialindex
$ hg log -r 66f7d451a68b85ed8
abort: unknown revision '66f7d451a68b85ed8'!
[255]
$ hg log --config fastpartialmatch.raiseifinconsistent=True -R $TESTTMP/repo/.hg/strip-backup/* -r 66f7d451a68b85ed8
changeset: 1:66f7d451a68b
tag: tip
user: debugbuilddag
date: Thu Jan 01 00:00:01 1970 +0000
summary: r1