Fuel no longer relies on fossil for the default remote.

FossilOrigin-Name: 6f96b3f7c927e06ac740b9df993a3f19d57eb74a
This commit is contained in:
kostas
2015-07-11 14:44:13 +00:00
parent c087569d2b
commit e0c9080555
6 changed files with 19 additions and 24 deletions

View File

@@ -70,10 +70,6 @@ RepoStatus Fossil::getRepoStatus()
}
}
defaultRemoteUrl.clear();
if(run_ok)
getRemoteUrl(defaultRemoteUrl);
return run_ok ? REPO_OK : REPO_NOT_FOUND;
}
@@ -412,10 +408,6 @@ bool Fossil::setRemoteUrl(const QUrl& url)
// Run as silent to avoid displaying credentials in the log
bool ok = runFossil(QStringList() << "remote-url" << u, 0, RUNFLAGS_SILENT_INPUT);
// Retrieve default url
if(ok)
getRemoteUrl(defaultRemoteUrl);
return ok;
}

View File

@@ -126,8 +126,6 @@ public:
const QString &getUIHttpPort() const { return fossilUIPort; }
QString getUIHttpAddress() const;
const QUrl &getDefaultRemoteUrl() const { return defaultRemoteUrl; }
private:
void log(const QString &text, bool isHTML=false)
{
@@ -144,7 +142,6 @@ private:
QString repositoryFile;
QString projectName;
QString currentRevision;
QUrl defaultRemoteUrl;
QStringList currentTags;
LoggedProcess fossilUI;
QString fossilUIPort;

View File

@@ -406,9 +406,15 @@ bool Workspace::setRemoteDefault(const QUrl& url)
}
//------------------------------------------------------------------------------
const QUrl & Workspace::getRemoteDefault() const
QUrl Workspace::getRemoteDefault() const
{
return fossil().getDefaultRemoteUrl();
for(remote_map_t::const_iterator it=remotes.begin(); it!=remotes.end(); ++it)
{
if(it->isDefault)
return it->url;
}
return QUrl();
}
//------------------------------------------------------------------------------

View File

@@ -152,7 +152,7 @@ public:
bool addRemote(const QUrl &url, const QString &name);
bool removeRemote(const QUrl &url);
bool setRemoteDefault(const QUrl& url);
const QUrl &getRemoteDefault() const;
QUrl getRemoteDefault() const;
Remote * findRemote(const QUrl& url);