Commit Graph

7 Commits

Author SHA1 Message Date
Durham Goode
195cb62bde ctreemanifest: remove PythonObj from manifest data structures
Summary:
The old code kept a PythonObj around inside the ManifestFetcher for fetching
manifest contents from the store. As part of moving the treemanifest code to use
the new native cstore API let's make the manifest code depend on a Store
abstraction and have one implementation be a PythonStore.

This removes almost all of the python dependencies from the core treemanifest
code, except some logic around running the python matcher during iteration and
writing directly to the python result dict during diff. We'll abstract those
away later.

Test Plan: Built and ran the tests

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: simonfar, mjpieters

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

Signature: t1:4569944:1487847102:d005b6484fd7de9335961b0bc4530505b25f961d
2017-02-23 14:03:03 -08:00
Durham Goode
b179a3593c treemanifest: sort parent nodes for hash computation
Summary:
Core mercurial sorts p1 and p2 before computing the hash, so it's deterministic.
We need to do the same.

Test Plan: Ran the tests, saw a hash changed

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D4202063
2016-11-29 15:37:58 -08:00
Durham Goode
89ad596f78 treemanifest: allow find() to get files and directories
Previously find would only return files. For treemanifest.hasdir() we needed it
to find directories as well. This patch adds a new enum for indicating if the
find should return files, directories, or both.
2016-10-14 16:01:12 -07:00
Durham Goode
e8554fc3d9 treemanifest: add concept of mutability to manifest, and use it during edits
This adds the concept of mutable and immutable Manifests. During a treemanifest
copy, any sub-manifests that are immutable (such as ones that had been loaded
from a store, or those that are in memory but have been mark immutable), do not
need to be copied. This dramatically reduces the amount of memory allocation
happening when copying trees during automatic tree creation during hg pull.
2016-10-14 16:01:12 -07:00
Durham Goode
1faefff046 treemanifest: convert all ownership Manifest references to ManifestPtr
Now that we have a ManifestPtr object, let's use it in all the places we
currently have Manifest ownership and cleanup happening. We don't need to fix up
any places that are just using Manifests from a readonly, non-lifetime related
perspective.

This gets rid of all the 'delete' calls on Manifest, except the one inside
~ManiestPtr;
2016-10-14 16:01:12 -07:00
Durham Goode
b84ba7af52 treemanifest: introduce ManifestPtr and refcount
Copying our tree manifests is currently the most expensive part of converting
manifests to trees on the fly. Let's introduce refcounting to the Manifest
lifetime, so we can share Manifests across treemanifest instances. Future diffs
will convert all uses of Manifest* to ManifestPtr, then even more future diffs
will change copy and edit operations to be copy-on-write.
2016-10-14 16:01:12 -07:00
Durham Goode
50d6b599f4 Move ctreemanifest and cdatapack out of remotefilelog
These don't really have any dependencies on remotefilelog, so let's move them
out.
2016-09-21 13:55:12 -07:00