sapling/eden/fs/config/HgObjectIdFormat.h
Chad Austin caa750d73c remove the ability to generate and store new proxy hashes
Summary:
We are migrating away from proxy hashes with the goal of removing
support for them entirely down the road. This diff removes the ability
for EdenFS to create or store new proxy hashes.

Reviewed By: genevievehelsel

Differential Revision: D40032883

fbshipit-source-id: fe35703ebcfb9b69b0b7ee17e2ed126910e9ea4b
2022-10-04 15:06:11 -07:00

37 lines
1000 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 {
// We used to support a ProxyHash format that indexed through a LocalStore
// keyspace in order to map fixed-size IDs onto variable-size HgBackingStore
// IDs.
// EdenFS will still read IDs of that format, but will not generate them.
/// '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