Commit Graph

22 Commits

Author SHA1 Message Date
Durham Goode
6370628aeb treemanifest: move store logic to a separate function
Summary:
In a future diff we'll be adding a function that also needs to turn a
python store into a ManifestFetcher. So let's move that logic to a separate
function.

Reviewed By: quark-zju

Differential Revision: D8216728

fbshipit-source-id: f6d2e9577eccfcb015797a519264bd3b241ebae5
2018-06-04 18:23:03 -07:00
Durham Goode
18945e39b6 treemanifest: remove py_treemanifest from iterators
Summary:
Now that the subtree iterator doesn't contain a reference to the
treemanifest directly (it instead holds a ManifestPtr reference), we no longer
need to persist a reference to it at the python layer.

Reviewed By: quark-zju

Differential Revision: D8206301

fbshipit-source-id: 531d4399f0f54a47e0eb741f419e6242188a83ad
2018-06-04 18:23:03 -07:00
Durham Goode
aa1e1a5604 treemanifest: remove resultEntry from iterators
Summary:
Now that markPermanent no longer requires a ManifestEntry to update the
node, the resultEntry field on all the iterators is unused. Let's delete it.

Reviewed By: quark-zju

Differential Revision: D8156808

fbshipit-source-id: 21aeb050c91552c7e8973a33dd7e347457125a64
2018-06-04 18:23:03 -07:00
Durham Goode
4708242f44 treemanifest: remove logic that updates ManifestEntry.node
Summary:
Now that the node field is accessed via a getter that can lazily
compute it, let's get rid of the logic that proactively sets it. This will make
it easier to refactor the subtree iterator in a later diff.

Reviewed By: quark-zju

Differential Revision: D8156809

fbshipit-source-id: aabc3f68cc41baea0c166b9a2bd68bea6b1a6a03
2018-06-04 18:23:03 -07:00
Durham Goode
63834775d7 treemanifest: move ManifestEntry node behind an accessor
Summary:
Previously the ManifestEntry node field was public and consumers could
read it directly. This required that the node field be updated manually, which
added complications to other code paths. In a future diff we'll be simplifying
the SubTreeIterator code to not require setting node, and to do so we make node
calculated in this accessor.

Reviewed By: quark-zju

Differential Revision: D8156807

fbshipit-source-id: e1908b2149bc0ec8fb1279e37b8a66988ff125c6
2018-06-04 18:23:03 -07:00
Durham Goode
0bbc6b6666 treemanifest: switch native iterators to use ManifestPtr
Summary:
This switches the treemanifest native iterators to use the ManifestPtr
class instead of Manifest*. ManifestPtr does ref counting, and in a future diff
we'll use this ability to have the subtree iterator iterate over a portion of a
larger tree so we can serve just parts of trees to gettreepack requests.

Reviewed By: quark-zju

Differential Revision: D8156806

fbshipit-source-id: 4dbb60d008ac8d0c789c3f2db8f7e567c5869539
2018-06-04 18:23:03 -07:00
Sergey Zhupanov
7d44cb5f01 Enabled additional compiler warnings in Eden.
Summary:
1. Enabled a number of additional C++ compiler warnings in Eden.
2. Fixed warnings-turned-errors that resulted from this change.

Reviewed By: simpkins

Differential Revision: D8132543

fbshipit-source-id: 2290ffaaab55024d582e29201a1bcaa1152e6b3e
2018-06-01 11:10:54 -07:00
Durham Goode
1aa9db8542 treemanifest: include p2 when creating trees
Summary:
Previously we weren't including p2 when creating trees, this resulted
in incorrect conversions.

Reviewed By: phillco

Differential Revision: D8152253

fbshipit-source-id: c4f8c79b40532c5162b15032962fbc6a78d44b5f
2018-05-30 18:20:57 -07:00
Sergey Zhupanov
3288f45188 Minor cleanup of interfaces in some scm classes.
Summary: Added const and override where appropriate to some classes in scm.

Reviewed By: aary

Differential Revision: D8176501

fbshipit-source-id: a9247aee569692973a822d002e951dad42c42be6
2018-05-29 13:26:31 -07:00
David Lai
a2411f090d - Fix unused parameter warnings
Summary:
The changes in this diff comments out unused parameters.
This will allow us to enable -Wunused-parameter as error.

Reviewed By: yfeldblum

Differential Revision: D7634823

fbshipit-source-id: fed215b805e9396d14feada19a6e959a180218d4
2018-04-16 10:35:14 -07:00
Kostia Balytskyi
dc1583e347 hg: remove extra semicolons in structs
Summary:
`PyObject_HEAD` is macro that ends with a semicolon when is is resolved. Thus `PyObject_HEAD;` ends in two semicolons.
Tolerating extra semicolons is a gcc feature, not a standard one.
I am adding the explanation for `// clang-format off` only once per file.

https://stackoverflow.com/questions/49529130/are-extra-semicolons-allowed-inside-struct-declarations?rq=1&utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Differential Revision: D7568269

fbshipit-source-id: 5afcfd7d96dc638cd0673d25809c9c43d58d00de
2018-04-13 21:51:51 -07:00
Kostia Balytskyi
3fd779e8be hg: migrate datapackstore to portability's dirent.h
Summary: Just start including a different header.

Differential Revision: D7555760

fbshipit-source-id: 7b0cd273a01db29cc31044b0cc0cff144b13a22b
2018-04-13 21:51:50 -07:00
Kostia Balytskyi
0ef59877cd hg: some portability fixes to py-cdatapack.h
Summary:
1. Variable Length Arrays are not supported by MSVC, but since this is a C++ code, we can just use heap allocation
2. Replacing `inet` with portability version

Depends on D7196403

Reviewed By: quark-zju

Differential Revision: D7196605

fbshipit-source-id: a0d88b6e06f255ef648c0b35a99b42ba3bee538a
2018-04-13 21:51:24 -07:00
Durham Goode
75da4fb2e6 hg: add add/removeStore to cuniondatapackstore
Summary:
In a future diff we'll need the ability to modify the union store on
the fly, so let's add addstore and removestore apis.

Reviewed By: ryanmce

Differential Revision: D7051102

fbshipit-source-id: 901a50720bfdf4e5c59714d092830e65edccdfce
2018-04-13 21:51:17 -07:00
Durham Goode
f0d99a2e09 hg: clang format the cstore code
Summary: The linters complain about this now, so let's format everything.

Reviewed By: ryanmce

Differential Revision: D7057989

fbshipit-source-id: 987ad0dcaa2f4e8fb74b3aa19c496f378765a533
2018-04-13 21:51:17 -07:00
Adam Simpkins
a16342c83e cleanup: remove more copy-and-pasted code
Summary: copypasta

Differential Revision: D7064623

fbshipit-source-id: 09e34e86fa67c009e6f7803aa480d5de1328365c
2018-04-13 21:51:15 -07:00
Adam Simpkins
4ae93819ee delete copy-and-pasted bitmanipulation.h
Summary:
Delete hgext/extlib/cstore/bitmanipulation.h, and just use the existing
mercurial/bitmanipulation.h header file instead.

It looks like there are quite a few other copy-and-pasted files between these
directories too, which should probably still be cleaned up.

Reviewed By: quark-zju

Differential Revision: D7008478

fbshipit-source-id: 1fdc779b470242d3083a3948dace3951922e836c
2018-04-13 21:51:14 -07:00
Kostia Balytskyi
efd44d683d hg: build mpatch and sha1detectcoll on Windows
Reviewed By: quark-zju

Differential Revision: D6979094

fbshipit-source-id: 8d617ae9d961e2203504b8eadbbf8d3e85f6befb
2018-04-13 21:51:11 -07:00
Wez Furlong
a3e8a19f3c merge in datapack fixes from eden
Summary:
pull in the following revisions from the copy of this code
we had under fbsource/scm/hgext:

2f7e4f11e002cf33e4878df77d6a0472adf31245 D6099388
e2a5a711e36c7392129b8753bea37c89a5d73a9c D6099754
77b975dcde28cd7c3d4ae2302bddb625682d1994 D6099753

Reviewed By: simpkins

Differential Revision: D6792967

fbshipit-source-id: e91a74329cddaf322172d3c7d9e1a05b3b6cba02
2018-04-13 21:50:57 -07:00
Wez Furlong
326c2cca4f clang-format datapackstore.cpp
Summary: No functional changes.

Reviewed By: bolinfest

Differential Revision: D6793943

fbshipit-source-id: ad709c4ea29e0ab265d6aac3c3f1a18733706e46
2018-04-13 21:50:56 -07:00
Durham Goode
55eddfbd07 ctreemanifest: fix imports 2018-01-09 15:23:52 -08:00
Durham Goode
228e6a901e cstore: move to hgext/extlib/
Summary: Moves cstore to hgext/extlib/ and makes it build.

Test Plan: make local && run-tests.py

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D6678852
2018-01-08 17:55:53 -08:00