Commit Graph

12 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
Durham Goode
e34660b057 commands: update to use registrar instead of cmdutil
Summary: Upstream has deprecated cmdutil.commands() in favor of registrar.commands()

Test Plan: Ran the tests

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters

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

Signature: t1:5106486:1495485074:0e20f00622cc651e8c9dda837f84dd84cc51099e
2017-05-22 13:38:37 -07:00
Arun Kulshreshtha
a72a47d515 absorb: s/chunks/chunk
Summary: Noticed this minor gramatical error when using absorb.

Test Plan: Unit tests.

Reviewers: quark

Reviewed By: quark

Subscribers: mjpieters

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

Signature: t1:4887040:1492123047:dcae53cabd64f1df13d80a20953c712ce0aaaa09
2017-04-13 16:00:51 -07:00
Jun Wu
08d017f89e absorb: move to a package
Summary:
The ideal interactive mode couldn't be implemented trivially. Move `absorb`
to a directory so we can add related, but decoupled components as separate
files.

Test Plan: `make local`

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:4813909:1491211561:e9c40b1242c9b74230c0b8937723a2d4548e22c3
2017-04-03 10:40:31 -07:00
Jun Wu
93c918c92e absorb: fix an issue where changesets do not get deleted correctly
Summary:
The old code didn't test if the new commit will become empty correctly, if its
"memworkingcopy" contains changes inherited from its parent. This diff fixes
the problem.

Thanks @stash for discovering the issue!

Test Plan: Added a test case for this issue. Make sure the old code cannot pass.

Reviewers: #mercurial, stash

Reviewed By: stash

Subscribers: mjpieters, stash

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

Signature: t1:4113438:1478077373:194104b902bdfe6827858c2916a7f3f0cd83ee6c
2016-11-01 21:16:13 +00: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
Jun Wu
14e90b7003 test-absorb: fix compatibility with POSIX sed
Summary:
POSIX requires that the `sed` "insert" command to be followed by a backslash
and a new line character. Let's make the test more POSIX compliant.

Test Plan: Run the test on both OS X and Linux.

Reviewers: simonfar, #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:4029954:1476720499:0a56da77fa89229ed9606eb9ac3748264fdf12fd
2016-10-17 17:01:02 +01: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
Pierre-Yves David
f1c24eddea absorb: fix a typo in output
From 'changset' to 'changeset'.
2016-09-12 18:00:54 +02:00
Mathias De Maré
96605a0ea5 absorb: correctly pass executable mode in getfile
getfile should return the file mode as (islink, isexec),
but it was returned as (islink, isbinary).
As a result, using 'hg absorb' removed executable mode from
the relevant changeset so the mode change showed up in the working directory.

Issue reported with test case by Thomas De Schampheleire.
2016-09-01 13:05:52 -07:00
Jun Wu
80f57e9dc3 [tests] add missing PYTHONPATH changes
Summary:
The built linelog.so cannot be discovered automatically. Change `PYTHONPATH`
to make sure it can be found.

Also fix the issue that the rename change misses some places in the test.

Test Plan: `unset PYTHONPATH` and run the touched files.

Reviewers: #sourcecontrol, ttung, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters

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

Signature: t1:3771583:1472145156:d05a1bf0d5920dfd0131acd1998698f2dddae1f8

Blame Revision: D3763992
2016-08-25 17:42:23 +01:00
Jun Wu
0184b72cf7 Rename "smartfixup" to "absorb"
Summary:
This seems to be an elegant choice. It does not conflict with other names,
and it does explain the concept to some extent vividly.

Credit goes to [trousers at lobste.rs](https://lobste.rs/s/nws1uj/help_us_name_new_mercurial_feature/comments/u4tsw7#c_u4tsw7).

Test Plan: Run the existing tests.

Reviewers: #sourcecontrol, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:3763992:1472049269:5bb9de3b7b3a0f0dd9587b952151fc38351bc822
2016-08-24 16:28:47 +01:00