1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
|
log("<b>> fossil "+params+"</b><br>", true);
}
QString wkdir = getCurrentWorkspace();
QString fossil = getFossilPath();
if(detached)
return QProcess::startDetached(fossil, args, wkdir);
// Make StatusBar message
QString status_msg = tr("Running Fossil");
if(args.length() > 0)
status_msg = QString("Fossil %0").arg(args[0].toCaseFolded());
ScopedStatus status(status_msg, ui, progressBar);
// Create fossil process
LoggedProcess process(this);
process.setWorkingDirectory(wkdir);
process.start(fossil, args);
if(!process.waitForStarted())
{
log(tr("Could not start Fossil executable '%0'").arg(fossil)+"\n");
return false;
}
const QChar EOL_MARK('\n');
QString ans_yes = 'y' + EOL_MARK;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
|
log("<b>> fossil "+params+"</b><br>", true);
}
QString wkdir = getCurrentWorkspace();
QString fossil = getFossilPath();
// Detached processes use the command-line only, to avoid having to wait
// for the temporary args file to be released before returing
if(detached)
return QProcess::startDetached(fossil, args, wkdir);
// Make StatusBar message
QString status_msg = tr("Running Fossil");
if(args.length() > 0)
status_msg = QString("Fossil %0").arg(args[0].toCaseFolded());
ScopedStatus status(status_msg, ui, progressBar);
// Generate args file
const QStringList *final_args = &args;
QTemporaryFile args_file;
if(!args_file.open())
{
QMessageBox::critical(this, tr("Error"), tr("Could not generate command line file"), QMessageBox::Ok );
return false;
}
// Write BOM
args_file.write(reinterpret_cast<const char *>(UTF8_BOM), sizeof(UTF8_BOM));
// Write Args
foreach(const QString &arg, args)
{
args_file.write(arg.toUtf8());
args_file.write("\n");
}
args_file.close();
// Replace args with args filename
QStringList run_args;
run_args.append("--args");
run_args.append(args_file.fileName());
final_args = &run_args;
// Create fossil process
LoggedProcess process(this);
process.setWorkingDirectory(wkdir);
process.start(fossil, *final_args);
if(!process.waitForStarted())
{
log(tr("Could not start Fossil executable '%0'").arg(fossil)+"\n");
return false;
}
const QChar EOL_MARK('\n');
QString ans_yes = 'y' + EOL_MARK;
|