sapling/eden/fs/config/HgObjectIdFormat.h
Chad Austin 90b678b4cc add support for an embedded proxy hash that contains a path
Summary:
To make it possible to eliminate proxy hashes before we migrate
entirely to EdenAPI, introduce an intermediate object ID format that
includes a path.

Reviewed By: kmancini

Differential Revision: D33200747

fbshipit-source-id: 1ac95b545a6c478bca1b6f3026d1170d88e76ac4
2022-03-03 17:17:25 -08:00

34 lines
835 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include "eden/fs/config/FieldConverter.h"
namespace facebook::eden {
enum class HgObjectIdFormat {
/// 20 bytes that index into LocalStore's hgproxyhash keyspace
ProxyHash,
/// '1' followed by 20 bytes of hg manifest hash and then a path
WithPath,
/// '2' followed by 20 bytes of hg manifest hash
HashOnly,
};
template <>
class FieldConverter<HgObjectIdFormat> {
public:
folly::Expected<HgObjectIdFormat, std::string> fromString(
folly::StringPiece value,
const std::map<std::string, std::string>& convData) const;
std::string toDebugString(HgObjectIdFormat value) const;
};
} // namespace facebook::eden