Commit Graph

9 Commits

Author SHA1 Message Date
Durham Goode
33a1d6afdc fix: update manifest.diff usages to handle match arg
Summary:
Upstream has added a new match argument to manifest.diff() and removed the
existing manifest.matches() function, so we need to update our internal usage.

A separate diff will update treemanifest to support the new diff() api.

Test Plan:
Ran the tests, some still fail because of the upstream changes, but
future patches fix those.

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D4677002
2017-03-12 10:14:35 -08:00
Tony Tung
eb4da8bafd [cfastmanifest] add PyObject_Del to dealloc method
Summary: It's actually desirable!  Removed the suspicious comment.

Test Plan: make local

Reviewers: #fastmanifest, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

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

Signature: t1:3689658:1470765228:dc1af38e4b7931802e1adfea31486860d81dbed9
2016-08-09 13:47:49 -07:00
Tony Tung
568dc0d745 [fastmanifest] inline a bunch of ifastmanifest* methods
Summary: Most of them are pretty simple and don't need to be standalone functions.

Test Plan:
```
[andromeda]:~/work/mercurial/facebook-hg-rpms/fb-hgext:ae2ccaa> make local
<snipped>
[andromeda]:~/work/mercurial/facebook-hg-rpms/fb-hgext:ae2ccaa> cd tests/
[andromeda]:~/work/mercurial/facebook-hg-rpms/fb-hgext/tests:ae2ccaa> PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/mutable-history/hgext  python ~/work/mercurial/facebook-hg-rpms/hg-crew/tests/run-tests.py -j32 test-fastmanifest*.{py,t}
.........
# Ran 9 tests, 0 skipped, 0 warned, 0 failed.
[andromeda]:~/work/mercurial/facebook-hg-rpms/fb-hgext/tests:ae2ccaa>
```

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: durham, mjpieters, mitrandir

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

Signature: t1:3659242:1470340089:e1a569ce05bc3d40af043369b7bc4c76616f5b88
2016-08-08 23:28:18 -07:00
Tony Tung
ac2510f68f [fastmanifest] remove lmiter struct
Summary: It's the same as the fmiter struct.  *clowntown*

Test Plan: `make local && cd tests && PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/mutable-history/hgext  python ~/work/mercurial/facebook-hg-rpms/hg-crew/tests/run-tests.py -j32 test-fastmanifest*.{py,t}`

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: mitrandir, mjpieters

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

Signature: t1:3656960:1470175548:b313a8b745113ba4d773acd9e8da4add1f1a2567
2016-08-02 15:36:14 -07:00
Tony Tung
3f57bb07a1 [fastmanifest] API to return the number of bytes a fastmanifest will occupy on disk
Summary: This is actually, strictly speaking, an upper bound.  This is because we haven't gone and done the work of compacting the tree.  Since the tree may have undergone deletions, the directory nodes may be oversized.

Test Plan: used in later diff.

Reviewers: lcharignon, durham

Reviewed By: durham

Subscribers: mitrandir, mjpieters, quark

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

Signature: t1:3538944:1468268102:45f2cbaa3dc156352ff3f71d0c53393f2445813a
2016-07-11 14:09:02 -07:00
Tony Tung
4aa6ac9795 [fastmanifest] use Py_RETURN_NONE
Summary: @quark suggested it in D3519183.  It does not work in both places because the other is not an immediate return.

Test Plan: make local && pass fastmanifest unit tests

Reviewers: lcharignon, quark

Reviewed By: quark

Subscribers: mitrandir, mjpieters, quark

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

Signature: t1:3530652:1467927107:99c9aeb6b873ab3cdca974f526c3984f4256e201
2016-07-07 16:49:44 -07:00
Tony Tung
bf8ae84996 [fastmanifest] increment ref to Py_None before using it
Summary: We cannot return Py_None without incrementing its refcount.

Test Plan: hg revert -r .^ no longer crashes.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

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

Tasks: 12074015

Signature: t1:3519183:1467757321:f9f834132e8b3f87c67fb7448afcc33d5bf25cab
2016-07-05 15:26:13 -07:00
Tony Tung
520195e68c [fastmanifest] rename save to _save
Summary: It's not for public consumption.

Test Plan: run `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/mutable-history/hgext  python ~/work/mercurial/facebook-hg-rpms/hg-crew/tests/run-tests.py -j32 test-fastmanifest*.{py,t}`

Reviewers: simonfar, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

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

Tasks: 11375421

Signature: t1:3471404:1466694921:2ec80e6ca3b460cc42cc766af96d9551f9100c75
2016-06-23 13:42:24 -07:00
Tony Tung
e62d8fd12b [fastmanifes] rename fastmanifest_wrapper as cfastmanifest
Summary: Depends on D3351021

Test Plan: run unit tests.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

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

Signature: t1:3351039:1464284522:d63f5011c6ca1981408519f5f7378e9a33aaecfe
2016-05-26 11:34:56 -07:00