Changeset 297768095e6b…
Parent ede9f8247280…
by
Changes to 3 files · Browse files at 297768095e6b Showing diff from parent ede9f8247280 Diff from another changeset...
@@ -18,16 +18,21 @@ std::string hgcmd = Quote(dir + "\\hgtk.exe") + cmd;
std::string cwd;
- std::vector<std::string> filelist;
+ std::string filelist;
if (!myFolder.empty())
{
cwd = myFolder;
- filelist.push_back(GetHgRepoRoot(myFolder));
+ filelist = GetHgRepoRoot(myFolder);
+ filelist += "\n";
}
else if (!myFiles.empty())
{
cwd = IsDirectory(myFiles[0])? myFiles[0] : DirName(myFiles[0]);
- filelist = myFiles;
+ for( DWORD i = 0 ; i < myFiles.size() ; i++ )
+ {
+ filelist += myFiles[i];
+ filelist += "\n";
+ }
}
else
{
@@ -35,7 +40,7 @@ return;
}
- if (!filelist.empty())
+ if ( !filelist.empty() )
hgcmd += " --listfile -";
LaunchCommand(hgcmd, cwd, filelist);
|
@@ -91,7 +91,7 @@ // Note: if the command is a batch file and the [full] path to the
// batch contains spaces, the path must be double-quoted.
// (see http://www.encocoservices.com/createprocess.html)
-bool LaunchCommand(const std::string& command, const std::string& cwd, std::vector<std::string> filelist)
+bool LaunchCommand(const std::string& command, const std::string& cwd, const std::string& filelist)
{
TDEBUG_TRACE("LaunchCommand: " << command);
PROCESS_INFORMATION processInfo;
@@ -142,18 +142,10 @@ return false;
}
- std::string writename;
- for( DWORD i = 0 ; i < filelist.size(); i++ )
+ if( !filelist.empty() )
{
- bool bSuccess;
DWORD dwWritten;
-
- writename = filelist[i];
- writename.push_back('\n');
-
- bSuccess = WriteFile(hChildStd_IN_Wr, writename.c_str(), writename.size(), &dwWritten, NULL);
- if ( !bSuccess )
- break;
+ WriteFile(hChildStd_IN_Wr, filelist.c_str(), filelist.size(), &dwWritten, NULL);
}
if ( !CloseHandle(hChildStd_IN_Wr) )
|
@@ -31,7 +31,7 @@ bool IsDirectory(const std::string&);
std::string DirName(const std::string&);
std::string BaseName(const std::string&);
-bool LaunchCommand(const std::string& command, const std::string& cwd, const std::vector<std::string> filelist);
+bool LaunchCommand(const std::string& command, const std::string& cwd, const std::string& filelist);
HICON GetTortoiseIcon(const std::string & iconname);
std::string GetHgRepoRoot(const std::string& path);
bool IsHgRepo(const std::string& path);
|
Loading...