Commit Graph

4 Commits

Author SHA1 Message Date
Jun Wu
4816fb9b86 absorb: fix test-check issues
Summary: This diff fixes test-check issues related to `absorb`.

Test Plan: `arc unit`

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: mjpieters

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

Signature: t1:4050973:1476985180:1bcd81297933c1488372b6c4bb7e5ea46f8105b0
2016-10-20 14:59:20 +01:00
Jun Wu
4637f4c7f2 absorb: fix insertion to an empty file
Summary:
When diffing a with b, if a is empty, we don't insert a "dummyendline" (see
line 214) because we do not have the last line to copy. In this case, if an
insertion happens, we have no "nearbylinenums" (see line 274) to visit.

The current code assumes "nearbylinenums" have at least one element, which
is wrong in the above case and will crash the program.

The fix is to add a check about whether "annotated" (aka. "a") is empty or
not.

Test Plan: Run `test-absorb-filefixupstate.py`

Reviewers: #sourcecontrol, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: durham, mjpieters

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

Tasks: 13371265

Signature: t1:3867686:1474289020:a183e6837e6e0afb8a5d56641689e240e8cd78c9
2016-09-15 00:59:29 +01: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