sapling/eden/fs/inodes/Differ.h
Adam Simpkins 2fedc3bcea update getScmStatus() to require the commit hash as an argument
Summary:
Change getScmStatus() so that callers must explicitly specify the commit to
diff against.  This should help avoid race conditions around commit or checkout
operations where the parent commit has just changed and eden returns status
information against a commit that wasn't what the client was expecting.

This should still maintain backwards compatibility with older clients that do
not send this parameter yet: we will simply receive the hash as an empty string
in this case, and we still provide the old behavior in this case.

Reviewed By: wez

Differential Revision: D7512338

fbshipit-source-id: 1fb4645dda13b9108c66c2daaa802ea3445ac5f2
2018-04-06 12:51:31 -07:00

38 lines
940 B
C++

/*
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <iosfwd>
#include "eden/fs/model/Hash.h"
#include "eden/fs/service/gen-cpp2/EdenService.h"
namespace folly {
template <typename T>
class Future;
}
namespace facebook {
namespace eden {
class EdenMount;
/**
* Returns the single-char representation for the ScmFileStatus used by
* SCMs such as Git and Mercurial.
*/
char scmStatusCodeChar(ScmFileStatus code);
std::ostream& operator<<(std::ostream& os, const ScmStatus& status);
folly::Future<std::unique_ptr<ScmStatus>>
diffMountForStatus(const EdenMount* mount, Hash commitHash, bool listIgnored);
} // namespace eden
} // namespace facebook