mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
Run hg debugedenimporthelper with CWD as repository
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
This commit is contained in:
parent
29dba2fab3
commit
3878986e2c
@ -330,7 +330,10 @@ HgImporter::HgImporter(
|
||||
cmd.push_back(folly::to<string>((int)childInPipe->readHandle));
|
||||
|
||||
helper_.createSubprocess(
|
||||
cmd, std::move(childInPipe), std::move(childOutPipe));
|
||||
cmd,
|
||||
repoPath.value().str().c_str(),
|
||||
std::move(childInPipe),
|
||||
std::move(childOutPipe));
|
||||
helperIn_ = helper_.childInPipe_->writeHandle;
|
||||
helperOut_ = helper_.childOutPipe_->readHandle;
|
||||
|
||||
|
@ -27,6 +27,7 @@ Subprocess::~Subprocess() {}
|
||||
|
||||
void Subprocess::createSubprocess(
|
||||
const std::vector<string>& cmd,
|
||||
const char* currentDir,
|
||||
std::unique_ptr<Pipe> childInPipe,
|
||||
std::unique_ptr<Pipe> childOutPipe) {
|
||||
childInPipe_ = std::move(childInPipe);
|
||||
@ -48,14 +49,14 @@ void Subprocess::createSubprocess(
|
||||
XLOG(DBG1) << "Creating the process: " << cmdToProcess.c_str() << std::endl;
|
||||
|
||||
status = CreateProcessA(
|
||||
NULL,
|
||||
nullptr,
|
||||
(LPSTR)cmdToProcess.c_str(),
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
TRUE, // inherit the handles
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
currentDir,
|
||||
&startupInfo,
|
||||
&procInfo);
|
||||
|
||||
|
@ -22,6 +22,7 @@ class 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user