comparison hgrunner.cpp @ 64:794db9353c7f

* Start rejigging the settings/repo-path dialog setup: startup dialog now asks for user name and email only
author Chris Cannam
date Wed, 17 Nov 2010 17:49:16 +0000
parents 68aebc316898
children 10eb97683aa9
comparison
equal deleted inserted replaced
63:2340b00561d2 64:794db9353c7f
74 74
75 void HgRunner::saveOutput() 75 void HgRunner::saveOutput()
76 { 76 {
77 stdOut = QString::fromUtf8(proc -> readAllStandardOutput()); 77 stdOut = QString::fromUtf8(proc -> readAllStandardOutput());
78 stdErr = QString::fromUtf8(proc -> readAllStandardError()); 78 stdErr = QString::fromUtf8(proc -> readAllStandardError());
79
80 DEBUG << "saveOutput: " << stdOut.split("\n").size() << " line(s) of stdout, " << stdErr.split("\n").size() << " line(s) of stderr" << endl;
81
82 // std::cerr << "stdout was " << stdOut.toStdString() << std::endl;
79 } 83 }
80 84
81 void HgRunner::setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus) 85 void HgRunner::setProcExitInfo(int procExitCode, QProcess::ExitStatus procExitStatus)
82 { 86 {
83 exitCode = procExitCode; 87 exitCode = procExitCode;
84 exitStatus = procExitStatus; 88 exitStatus = procExitStatus;
85
86 DEBUG << "setProcExitInfo: " << stdOut.split("\n").size() << " line(s) of stdout, " << stdErr.split("\n").size() << " line(s) of stderr";
87
88 // std::cerr << "stdout was " << stdOut.toStdString() << std::endl;
89 } 89 }
90 90
91 QString HgRunner::getLastCommandLine() 91 QString HgRunner::getLastCommandLine()
92 { 92 {
93 return QString("Command line: " + lastHgCommand + " " + lastParams); 93 return QString("Command line: " + lastHgCommand + " " + lastParams);
94 } 94 }
95 95
96 void HgRunner::finished(int procExitCode, QProcess::ExitStatus procExitStatus) 96 void HgRunner::finished(int procExitCode, QProcess::ExitStatus procExitStatus)
97 { 97 {
98 setProcExitInfo(procExitCode, procExitStatus); 98 setProcExitInfo(procExitCode, procExitStatus);
99 saveOutput();
99 isRunning = false; 100 isRunning = false;
100 101
101 if (procExitCode == 0 || procExitStatus == QProcess::NormalExit) { 102 if (procExitCode == 0 || procExitStatus == QProcess::NormalExit) {
102 emit commandCompleted(); 103 emit commandCompleted();
103 } else { 104 } else {
140 lastHgCommand = command; 141 lastHgCommand = command;
141 lastParams = params.join(" "); 142 lastParams = params.join(" ");
142 143
143 QString cmdline = command; 144 QString cmdline = command;
144 foreach (QString param, params) cmdline += " " + param; 145 foreach (QString param, params) cmdline += " " + param;
145 DEBUG << "HgRunner: starting: " << cmdline; 146 DEBUG << "HgRunner: starting: " << cmdline << " with cwd "
147 << workingDir << endl;
146 148
147 proc -> start(command, params); 149 proc -> start(command, params);
148 } 150 }
149 151
150 int HgRunner::getExitCode() 152 int HgRunner::getExitCode()