mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
3878986e2c
Summary: hg debugedenimporthelper should either have the repo path as argument or the current working directory should be inside a repo. Setting the current working directory for the process. Reviewed By: strager Differential Revision: D16565042 fbshipit-source-id: d6e826bebf58fd58f5250e6c477849ca147628c8
38 lines
792 B
C++
38 lines
792 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
#pragma once
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
class Pipe;
|
|
|
|
class Subprocess {
|
|
public:
|
|
Subprocess();
|
|
Subprocess(const std::vector<std::string>& cmd);
|
|
~Subprocess();
|
|
|
|
void createSubprocess(
|
|
const std::vector<std::string>& cmd,
|
|
const char* currentDir = nullptr,
|
|
std::unique_ptr<Pipe> childInPipe = nullptr,
|
|
std::unique_ptr<Pipe> childOutPipe = nullptr);
|
|
|
|
std::unique_ptr<Pipe> childInPipe_;
|
|
std::unique_ptr<Pipe> childOutPipe_;
|
|
|
|
private:
|
|
const int bufferSize_ = 4096;
|
|
};
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|