sapling/eden/fs/inodes/overlay.thrift
Adam Simpkins 8be3b57eed fix issues updating TreeInode materialization status during checkout
Summary:
This updates the TreeInode code to remove the redundant materialized flag.
A TreeInode should have a Tree Hash if and only if it is dematerialized, so
there is no need for an extra `materialized` boolean.

This diff also fixes an issue in TreeInode::saveOverlayPostCheckout() where it
was not correctly informing it's parent TreeInode of the change if it moved
from one dematerialized state to another (with a different TreeInode hash).
This fixes the code to correctly call `parent->childDematerialized()` when it
needs to inform the parent that it now refers to a different source control
hash.

Reviewed By: wez

Differential Revision: D5336629

fbshipit-source-id: b4d86ecdef2f5faefbc243a09d869c02384ae95c
2017-07-07 18:45:02 -07:00

44 lines
1.3 KiB
Thrift

include "eden/fs/inodes/hgdirstate.thrift"
namespace cpp2 facebook.eden.overlay
namespace py facebook.eden.overlay
typedef binary Hash
typedef string PathComponent
typedef string RelativePath
struct OverlayEntry {
// Holds the mode_t data, which encodes the file type and permissions
1: i32 mode
// The inodeNumber of the child, if it is materialized.
// If the child is not materialized this will be 0, and the hash will
// contain the hash of a source control Tree or Blob.
2: i64 inodeNumber
// If inodeNumber is 0, then this child is identical to an existing
// source control Tree or Blob. This contains the hash of that Tree or Blob.
3: Hash hash
}
struct OverlayDir {
// The contents of this dir.
1: map<PathComponent, OverlayEntry> entries
}
struct OverlayData {
// A map of RelativePath -> OverlayDir for the entire contents of the
// overlay area. The assumption is that the locally materialized data
// (since it should be O(things-changed-in-1-diff) should reasonably
// fit in memory and thus that this won't be too big to work with.
1: map<RelativePath, OverlayDir> localDirs
}
enum UserStatusDirective {
Add = 0x0,
Remove = 0x1,
}
struct DirstateData {
1: map<RelativePath, hgdirstate.DirstateTuple> hgDirstateTuples
2: map<RelativePath, RelativePath> hgDestToSourceCopyMap
}