mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
90b678b4cc
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
34 lines
835 B
C++
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
|