Commit Graph

15 Commits

Author SHA1 Message Date
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
Don Stewart
bc85e8a4cf hgext: accept a --unified param for lines of diff context
Summary: Added -U/--unified NUM to fbshow.py, and used that to set diff.unified=NUM.

Test Plan: hg show --help; hg show -U 1; hg show -U 2; hg show -U by induction.

Reviewers: mburman, simonfar, ikostia

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

Tasks: 10006036

Tags: python
2017-05-15 05:59:55 -07:00
Jeroen Vaelen
8bc1e221b6 hgext: rename show.py to fbshow.py to prevent upstream collision
Summary:
Upstream recently introduced show as an extension. Because the file
name is the same and it lives in core, extensions.show now points to it.

It behaves differently. Rename our extension. In the next diff I'll update
facebook.rc to make extensions.show point to our version.

Test Plan: Ran tests

Reviewers: durham, #sourcecontrol

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4845959
2017-04-06 13:36:18 -07:00
Kostia Balytskyi
d66dc36bfa tests_: fix test-show.t
Summary: Make `test-show.t` pass again!

Test Plan: - run test locally, see it passing

Reviewers: #sourcecontrol, simonfar

Reviewed By: simonfar

Subscribers: simonfar, mjpieters

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

Signature: t1:4636012:1488401012:da051bd55c91890c637f954aaf151d88ea37a978
2017-03-01 12:49:53 -08:00
Durham Goode
a2c090cba3 show-tests: remove help string that core changed
Upstream removed this experimental flag, so we need to update the test.
2017-03-01 12:48:26 -08:00
Kostia Balytskyi
dfb3ca4276 tests_: expect --color in global options
Summary: As per upstream's https://www.mercurial-scm.org/repo/hg-committed/rev/8fb2c95d816a, we need to add `--color` to help messages.

Test Plan: - run test locally, see it passing

Reviewers: #sourcecontrol, mitrandir, simonfar

Reviewed By: mitrandir, simonfar

Subscribers: simonfar, mitrandir, mjpieters

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

Signature: t1:4627818:1488296052:eff62a80e71c24965072d13e2f67b0e78b3f4ea3
2017-02-28 07:35:09 -08:00
Kostia Balytskyi
71cda7492d tests_: add pager help to test-show.t
Differential Revision: https://phabricator.intern.facebook.com/D4591081
2017-02-21 06:47:12 -08:00
Simon Farnsworth
be87628803 Catch up with upstream changes so that our tests pass
Summary: Upstream's done a few changes that we need to catch up with.

Test Plan: Run tests locally on my devserver

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters

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

Signature: t1:4058640:1477065516:e2ab2483d054e47b4fe75c6eba185dfd5179f57a
2016-10-21 08:58:52 -07:00
Kostia Balytskyi
db64f55505 tests_: fixing tests in accoring to cmd option negation added by upstream
Differential Revision: https://phabricator.intern.facebook.com/D3950940
2016-10-03 02:01:18 -07:00
Kostia Balytskyi
ded4c889ca tests_: fix failures related to recent renames
Summary: We need to start fixing test failures to test hgbuild e2e :)

Test Plan: run-tests.py against changed files shows that these ones were fixed

Reviewers: quark, mjpieters, rmcelroy, simonfar

Subscribers: mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D3907217
2016-09-22 07:44:34 -07:00
Jun Wu
8a3a99ba21 hgext: move single file extensions to hgext3rd
Summary:
Be a better citizen under system python path.

Fix all tests issues and change setup.py to use glob pattern to include
all extensions.

Test Plan:
Run tests and `make local`.
Also build and install the package and run `hg sl` in major repos.

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, durham, mjpieters

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

Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2
2016-07-08 13:15:42 +01:00
timeless@gmail.com
cd35432d91 spelling: fix numerous spelling errors 2016-04-04 12:48:01 -07:00
Simon Farnsworth
26167ac6dd show: Learn to do hg show REV FILES
Summary:
Make hg show closer in behaviour to git show - it's useful to restrict the files it examines, not just the revision

Also update githelp.py to match.

Test Plan: Run the updated testcases.

Reviewers: lcharignon, pyd, rmcelroy, durham

Reviewed By: durham

Subscribers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2917091

Tasks: 9323445

Signature: t1:2917091:1455240831:305be81ada4b832a9685f5bf38f3c3232c47fdfb
2016-02-12 03:07:11 -08:00
Durham Goode
3a50b8338f show: fix test with new quotes
Upstream has switched to using single quotes in help text, so we need to update
our tests.
2016-01-20 13:40:15 -08:00
Simon Farnsworth
86662e0f15 Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:

1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').

2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.

As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.

Test Plan:
Run the new automatic test test-show.t:

: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.

Note that this means that review needs to cover the automatic test, too, in case I've missed anything important

Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy

Reviewed By: lcharignon, rmcelroy

Subscribers: rmcelroy, lcharignon, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2820421

Tasks: 9323445, 9599994

Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 11:20:28 -08:00