Commit Graph

11 Commits

Author SHA1 Message Date
Tony Tung
87e90f60c3 [fastmanifest] simplify the calculation of node size
Summary: Reuse the function `get_child_ptr_base_offset`, which returns the offset to the first child entry.  Also simplify `get_child_ptr_base_offset` with @wez's suggestions.

Test Plan: pass all unit tests

Reviewers: lcharignon, wez

Reviewed By: wez

Subscribers: mitrandir, mjpieters, wez

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

Signature: t1:3260566:1462423991:565f9ea8100d1392d7fcb3e108823208836fe0fe
2016-05-04 22:20:17 -07:00
Tony Tung
227f3a0146 [fastmanifest] fix calculation of required node size
Summary:
We're adding the name size twice.  #fail

I can't believe I'm discovering bugs like this at this point.

Test Plan: pass unit tests.

Reviewers: lcharignon, wez

Reviewed By: wez

Subscribers: mitrandir, mjpieters

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

Signature: t1:3255048:1462320786:0e2fceeb57bbd49e6bfc2191b2a691ba4ed7d526
2016-05-04 13:13:33 -07:00
Tony Tung
f0dd410a34 [fastmanifest] satisfy gcc's uninitialized variable warnings
Summary:
gcc is stricter about uninitialized variables.  these variables will never be read in these code paths, but gcc is freaking out about them.

i don't know if clang is just smarter about tracing how variables are used across function boundaries or if clang is not properly warning on uninitialized variables.

anyhow, I know these are not used because valgrind would have caught the improper usage.

Test Plan: make local w/ gcc

Reviewers: wez, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

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

Signature: t1:3236365:1461879525:50c15b9b3970f29cd318e8d0c71482b9ed5e22db
2016-04-28 19:18:08 -07:00
Tony Tung
9067c86850 [fastmanifest] reduce the warning spew from mercurial build
Summary:
`setup.py` turns on a couple extra warnings, so add them to our list and resolve them.  Most of them are 64->32 bit conversions.  In most cases, we test and abort if we're outside the 32-bit range.

I also removed const from `contains_path` because enforcing it means code duplicating, which is never a great thing.

Test Plan: pass unit tests

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mitrandir, mjpieters

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

Tasks: 10652171

Signature: t1:3194045:1461605953:1a7012fbc75ca8808130c8ad00ed4b2e8fa96f91
2016-04-25 11:58:38 -07:00
Tony Tung
aaf816f8ea [fastmanifest] clone_node fails to copy all metadata
Summary: It doesn't copy the checksum_sz and flags fields over.  This is a serious problem as they are used in checksum calculation.

Test Plan: wrote unit test to verify the metadata is copied over.  failed.  updated code to copy the metadata over.  tests pass!

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters

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

Tasks: 10644245

Signature: t1:3155393:1460136520:10d75c5181eda88139df26d57a560af95f8ed69d
2016-04-18 11:37:14 -07:00
Tony Tung
495ee1e2c7 [fastmanifest] initialize_node doesn't need the max_children
Summary: It's unused.  Get rid of the parameter.

Test Plan: pass unit tests

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters

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

Signature: t1:3140664:1460070644:047933753763797fe40504bc1cf883e4f8f8adc7
2016-04-18 11:33:28 -07:00
Tony Tung
deadce5eb8 [fastmanifest fix all the other places where the pointer style is inconsistent
Test Plan: run unit tests.

Reviewers: #sourcecontrol, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

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

Signature: t1:3130423:1459811638:268cb647facbde3f2cf2d37118bdfe56bce0e637
2016-04-08 22:33:07 -07:00
Tony Tung
fceff111a7 [fastmanifest] search children should return an illegal value when it fails
Summary: 0 is actually a legit index, so if someone checks that instead of the node pointer, then we might find the wrong thing.

Test Plan: pass unit tests.

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir, mjpieters

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

Signature: t1:3130262:1459557188:661eae1363bf603a77e1d17960db0a5f8f33834b
2016-04-06 12:40:32 -07:00
Tony Tung
24ff723f4f [fastmanifest] make a ROOT node type
Summary: On remove_path, we need to remove the implicit nodes that are empty after we remove the leaf node.  Actually typing the nodes differently makes this easier.

Test Plan: pass unit tests.

Reviewers: #sourcecontrol, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

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

Signature: t1:3128497:1459811588:d3132edc7044061263457c7d0b5ee072b67204c9
2016-04-04 16:24:22 -07:00
Tony Tung
91a9f27549 [fastmanifest] suppress check-code on fastmanifest
Summary: It's not going to pass.

Test Plan: run check-code

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mitrandir, mjpieters

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

Tasks: 10662043

Signature: t1:3126493:1459523935:54449c39abfef97b596e9c34743583afa8b983d5
2016-04-01 11:19:53 -07:00
Tony Tung
14a8f27f55 [fastmanifest] initial checkin
Summary:
Still missing:

== Code and tests: ==
* remove path
* contains path (but this is essentially the same as get path)
* read/write from file

== Tests: ==
* checksumming directories

Test Plan: well, it kind of builds.

Reviewers: durham, simpkins, lcharignon

Reviewed By: lcharignon

Subscribers: net-systems-diffs@, mitrandir, mjpieters, akushner, rmcelroy

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

Signature: t1:3120166:1459464981:60f19dd1e36d62776a69fa88c018122a4be27d87
2016-04-01 00:46:28 -07:00