Fall back to textual diff when gdiff fails
Fossil Exe path needs to be set before applySettings FossilOrigin-Name: a9115a3369a7897bfc665f2a9614f61dbec80493
This commit is contained in:
@@ -229,10 +229,15 @@ bool Fossil::getFossilVersion(QString& version)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool Fossil::diffFile(const QString &repoFile)
|
||||
bool Fossil::diffFile(const QString &repoFile, bool graphical)
|
||||
{
|
||||
// Run the diff detached
|
||||
return runFossil(QStringList() << "gdiff" << QuotePath(repoFile), 0, RUNFLAGS_DETACHED);
|
||||
if(graphical)
|
||||
{
|
||||
// Run the diff detached
|
||||
return runFossil(QStringList() << "gdiff" << QuotePath(repoFile), 0, RUNFLAGS_DETACHED);
|
||||
}
|
||||
else
|
||||
return runFossil(QStringList() << "diff" << QuotePath(repoFile));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@@ -93,7 +93,7 @@ public:
|
||||
bool listFiles(QStringList &files);
|
||||
bool status(QStringList& result);
|
||||
|
||||
bool diffFile(const QString &repoFile);
|
||||
bool diffFile(const QString &repoFile, bool graphical);
|
||||
bool commitFiles(const QStringList &fileList, const QString &comment, const QString& newBranchName, bool isPrivateBranch);
|
||||
bool addFiles(const QStringList& fileList);
|
||||
bool removeFiles(const QStringList& fileList, bool deleteLocal);
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
const QString &getUIHttpPort() const { return fossilUIPort; }
|
||||
QString getUIHttpAddress() const;
|
||||
|
||||
void setFossilPath(const QString &path) { fossilPath = path; }
|
||||
void setExecutablePath(const QString &path) { fossilPath = path; }
|
||||
|
||||
private:
|
||||
void log(const QString &text, bool isHTML=false)
|
||||
|
@@ -297,11 +297,10 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
uiCallback.init(this);
|
||||
// Need to be before applySettings which sets the last workspace
|
||||
fossil().Init(&uiCallback);
|
||||
fossil().setExecutablePath(settings.GetValue(FUEL_SETTING_FOSSIL_PATH).toString());
|
||||
|
||||
applySettings();
|
||||
|
||||
fossil().setFossilPath(settings.GetValue(FUEL_SETTING_FOSSIL_PATH).toString());
|
||||
|
||||
// Apply any explicit workspace path if available
|
||||
if(workspacePath && !workspacePath->isEmpty())
|
||||
openWorkspace(*workspacePath);
|
||||
@@ -1406,7 +1405,10 @@ void MainWindow::getSelectionRemotes(QStringList &remoteUrls)
|
||||
//------------------------------------------------------------------------------
|
||||
bool MainWindow::diffFile(const QString &repoFile)
|
||||
{
|
||||
return fossil().diffFile(repoFile);
|
||||
if(fossil().diffFile(repoFile, true))
|
||||
return true;
|
||||
else
|
||||
return fossil().diffFile(repoFile, false);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -1782,7 +1784,7 @@ void MainWindow::on_actionSettings_triggered()
|
||||
if(!SettingsDialog::run(this, settings))
|
||||
return;
|
||||
|
||||
fossil().setFossilPath(settings.GetValue(FUEL_SETTING_FOSSIL_PATH).toString());
|
||||
fossil().setExecutablePath(settings.GetValue(FUEL_SETTING_FOSSIL_PATH).toString());
|
||||
updateCustomActions();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user