Add logging for EdenServiceHandler::hgGetDirstateTuple

Summary:
This was helpful when debugging interactions between Mercurial's
dirstate and the related Thrift calls to Eden server.

Reviewed By: simpkins

Differential Revision: D5664872

fbshipit-source-id: 4e6ef3b034f4fc81f0d467974311a58f54b6e47b
This commit is contained in:
Michael Bolin 2017-08-18 21:36:27 -07:00 committed by Facebook Github Bot
parent 43f27195b6
commit 45ae415877

View File

@ -425,8 +425,21 @@ void EdenServiceHandler::hgGetDirstateTuple(
auto dirstate = server_->getMount(*mountPoint)->getDirstate(); auto dirstate = server_->getMount(*mountPoint)->getDirstate();
DCHECK(dirstate != nullptr) << "Failed to get dirstate for " DCHECK(dirstate != nullptr) << "Failed to get dirstate for "
<< mountPoint.get(); << mountPoint.get();
auto filename = RelativePathPiece{*relativePath}; auto filename = RelativePathPiece{*relativePath};
out = dirstate->hgGetDirstateTuple(filename); try {
out = dirstate->hgGetDirstateTuple(filename);
// Print this before invoking hgGetDirstateTuple(), as it may throw.
XLOG(DBG2) << "hgGetDirstateTuple(" << *relativePath << ") returning "
<< _DirstateNonnormalFileStatus_VALUES_TO_NAMES.at(
out.get_status())
<< " "
<< _DirstateMergeState_VALUES_TO_NAMES.at(out.get_mergeState());
} catch (const std::exception& e) {
XLOG(DBG2) << "hgGetDirstateTuple(" << *relativePath << ") failed with "
<< e.what();
throw;
}
} }
void EdenServiceHandler::hgSetDirstateTuple( void EdenServiceHandler::hgSetDirstateTuple(