Simplified Workspace interface

Removed Workspace::setDefaultRemoteUrl since Fossil::setRemoteUrl is Fossil specific

FossilOrigin-Name: 3a62c3b4808b76d14fd48839f7aba68e4502c6ad
This commit is contained in:
Kostas 2015-09-14 15:56:27 +00:00
parent 9d750f0135
commit 9c74c3774f
4 changed files with 29 additions and 35 deletions

View File

@ -1,5 +1,5 @@
C All\sgeneric\sFossil\soperations\sare\snow\sencapsulated\sin\sWorkspace\n C Simplified\sWorkspace\sinterface\nRemoved\sWorkspace::setDefaultRemoteUrl\ssince\sFossil::setRemoteUrl\sis\sFossil\sspecific
D 2015-09-14T15:46:16.231 D 2015-09-14T15:56:27.963
F .fossil-settings/manifest a09a968bf05a50058f3ad50132730b719bc39e76 F .fossil-settings/manifest a09a968bf05a50058f3ad50132730b719bc39e76
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
@ -232,7 +232,7 @@ F src/FslSettingsDialog.cpp e00907d493fba469e48a008aecda88426350b5ac
F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7 F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
F src/MainWindow.cpp 4268a41085afaa2bc0bb08b580e99e201b00234f F src/MainWindow.cpp be50d276b0cba6234b1699f92f9f5aa9b9e4fc00
F src/MainWindow.h fd8bb12f0bf49a6cb5ce9b875ad5277426380e3f F src/MainWindow.h fd8bb12f0bf49a6cb5ce9b875ad5277426380e3f
F src/RemoteDialog.cpp 1a57a15465f689057d5354a29ad3015e54582343 F src/RemoteDialog.cpp 1a57a15465f689057d5354a29ad3015e54582343
F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d
@ -247,7 +247,7 @@ F src/SettingsDialog.h 5eb3ae2cbb00ab5544e1889860f5376f69fe47cd
F src/Utils.cpp fb9fe1caeef47dca310079f8f10b41c838defaa5 F src/Utils.cpp fb9fe1caeef47dca310079f8f10b41c838defaa5
F src/Utils.h c52be757cd0045e34ab14c51f35a61af8f8870a4 F src/Utils.h c52be757cd0045e34ab14c51f35a61af8f8870a4
F src/Workspace.cpp 88ec8258920d7d450c3bb6110085fb07b30ee01a F src/Workspace.cpp 88ec8258920d7d450c3bb6110085fb07b30ee01a
F src/Workspace.h 12646718c49441e7160e231d0e8681d51a601d4e F src/Workspace.h a0ae8f0a2c32da3a8b51a74fa68b0b09167d79c5
F src/main.cpp d8c65ea5e54102e4989fef9fd8cfd4f13ef8a8f0 F src/main.cpp d8c65ea5e54102e4989fef9fd8cfd4f13ef8a8f0
F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x
F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x
@ -261,7 +261,7 @@ F ui/MainWindow.ui ad04643d071fe513b46ef413749a493909a90ad1
F ui/RemoteDialog.ui 424b2d4a3d0162f84fdccf6af02c1cfce07a06f5 F ui/RemoteDialog.ui 424b2d4a3d0162f84fdccf6af02c1cfce07a06f5
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1 F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1
P 96e4a4d8642ec96578155bb8762a1772b9351e3c P b29c19caa92280f7378e78f0febb56fc4fec7b03
R 784c02219b7ef58afdd4d5fd40274aec R ed37893ba3f997333ca438479bd642f9
U Kostas U Kostas
Z 80978a3c0bcc7673709be80a4e657974 Z ed5d827e4559238ecc2dbcfb924fbdc5

View File

@ -1 +1 @@
b29c19caa92280f7378e78f0febb56fc4fec7b03 3a62c3b4808b76d14fd48839f7aba68e4502c6ad

View File

@ -405,7 +405,7 @@ bool MainWindow::openWorkspace(const QString &path)
} }
// Ok open the repository file // Ok open the repository file
if(!getWorkspace().createWorkspace(fi.absoluteFilePath(), wkspace)) if(!getWorkspace().create(fi.absoluteFilePath(), wkspace))
{ {
QMessageBox::critical(this, tr("Error"), tr("Could not open repository."), QMessageBox::Ok ); QMessageBox::critical(this, tr("Error"), tr("Could not open repository."), QMessageBox::Ok );
return false; return false;
@ -517,7 +517,7 @@ void MainWindow::on_actionNewRepository_triggered()
return; return;
} }
if(!getWorkspace().createWorkspace(repo_abs_path, wkdir)) if(!getWorkspace().create(repo_abs_path, wkdir))
{ {
QMessageBox::critical(this, tr("Error"), tr("Could not open repository."), QMessageBox::Ok ); QMessageBox::critical(this, tr("Error"), tr("Could not open repository."), QMessageBox::Ok );
return; return;
@ -533,14 +533,14 @@ void MainWindow::on_actionNewRepository_triggered()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void MainWindow::on_actionCloseRepository_triggered() void MainWindow::on_actionCloseRepository_triggered()
{ {
if(getWorkspace().getWorkspaceState()!=Fossil::WORKSPACE_STATE_OK) if(getWorkspace().getState()!=Fossil::WORKSPACE_STATE_OK)
return; return;
if(QMessageBox::Yes !=DialogQuery(this, tr("Close Workspace"), tr("Are you sure you want to close this workspace?"))) if(QMessageBox::Yes !=DialogQuery(this, tr("Close Workspace"), tr("Are you sure you want to close this workspace?")))
return; return;
// Close Repo // Close Repo
if(!getWorkspace().closeWorkspace()) if(!getWorkspace().close())
{ {
QMessageBox::critical(this, tr("Error"), tr("Cannot close the workspace.\nAre there still uncommitted changes available?"), QMessageBox::Ok ); QMessageBox::critical(this, tr("Error"), tr("Cannot close the workspace.\nAre there still uncommitted changes available?"), QMessageBox::Ok );
return; return;
@ -693,7 +693,7 @@ bool MainWindow::scanWorkspace()
bool valid = true; bool valid = true;
// Load repository info // Load repository info
Fossil::WorkspaceState st = getWorkspace().getWorkspaceState(); Fossil::WorkspaceState st = getWorkspace().getState();
QString status; QString status;
if(st==Fossil::WORKSPACE_STATE_NOTFOUND) if(st==Fossil::WORKSPACE_STATE_NOTFOUND)
@ -1740,7 +1740,7 @@ void MainWindow::on_actionUndo_triggered()
QStringList res; QStringList res;
// Do test Undo // Do test Undo
if(!getWorkspace().undoWorkspace(res, true)) if(!getWorkspace().undo(res, true))
QMessageBox::critical(this, tr("Error"), tr("Could not undo changes."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not undo changes."), QMessageBox::Ok);
if(res.length()>0 && res[0]=="No undo or redo is available") if(res.length()>0 && res[0]=="No undo or redo is available")
@ -1750,7 +1750,7 @@ void MainWindow::on_actionUndo_triggered()
return; return;
// Do Undo // Do Undo
if(!getWorkspace().undoWorkspace(res, false)) if(!getWorkspace().undo(res, false))
QMessageBox::critical(this, tr("Error"), tr("Could not undo changes."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not undo changes."), QMessageBox::Ok);
refresh(); refresh();
@ -2568,7 +2568,7 @@ void MainWindow::updateRevision(const QString &revision)
QStringList res; QStringList res;
// Do test update // Do test update
if(!getWorkspace().updateWorkspace(res, selected_revision, true)) if(!getWorkspace().update(res, selected_revision, true))
{ {
QMessageBox::critical(this, tr("Error"), tr("Could not update the repository."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not update the repository."), QMessageBox::Ok);
return; return;
@ -2588,7 +2588,7 @@ void MainWindow::updateRevision(const QString &revision)
return; return;
// Do update // Do update
if(!getWorkspace().updateWorkspace(res, selected_revision, false)) if(!getWorkspace().update(res, selected_revision, false))
QMessageBox::critical(this, tr("Error"), tr("Could not update the repository."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not update the repository."), QMessageBox::Ok);
refresh(); refresh();
@ -2776,7 +2776,7 @@ void MainWindow::on_actionPushRemote_triggered()
if(!url.isLocalFile()) if(!url.isLocalFile())
KeychainGet(this, url, *settings.GetStore()); KeychainGet(this, url, *settings.GetStore());
if(!getWorkspace().pushWorkspace(url)) if(!getWorkspace().push(url))
QMessageBox::critical(this, tr("Error"), tr("Could not push to the remote repository."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not push to the remote repository."), QMessageBox::Ok);
} }
@ -2794,7 +2794,7 @@ void MainWindow::on_actionPullRemote_triggered()
if(!url.isLocalFile()) if(!url.isLocalFile())
KeychainGet(this, url, *settings.GetStore()); KeychainGet(this, url, *settings.GetStore());
if(!getWorkspace().pullWorkspace(url)) if(!getWorkspace().pull(url))
QMessageBox::critical(this, tr("Error"), tr("Could not pull from the remote repository."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not pull from the remote repository."), QMessageBox::Ok);
} }
@ -2813,7 +2813,7 @@ void MainWindow::on_actionPush_triggered()
if(!url.isLocalFile()) if(!url.isLocalFile())
KeychainGet(this, url, *settings.GetStore()); KeychainGet(this, url, *settings.GetStore());
if(!getWorkspace().pushWorkspace(url)) if(!getWorkspace().push(url))
QMessageBox::critical(this, tr("Error"), tr("Could not push to the remote repository."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not push to the remote repository."), QMessageBox::Ok);
} }
@ -2832,7 +2832,7 @@ void MainWindow::on_actionPull_triggered()
if(!url.isLocalFile()) if(!url.isLocalFile())
KeychainGet(this, url, *settings.GetStore()); KeychainGet(this, url, *settings.GetStore());
if(!getWorkspace().pullWorkspace(url)) if(!getWorkspace().pull(url))
QMessageBox::critical(this, tr("Error"), tr("Could not pull from the remote repository."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not pull from the remote repository."), QMessageBox::Ok);
} }
@ -2856,7 +2856,7 @@ void MainWindow::on_actionSetDefaultRemote_triggered()
// so only set the remote url when there is no password set // so only set the remote url when there is no password set
if(url.password().isEmpty()) if(url.password().isEmpty())
{ {
if(!getWorkspace().setDefaultRemoteUrl(url)) if(!getWorkspace().fossil().setRemoteUrl(url))
QMessageBox::critical(this, tr("Error"), tr("Could not set the remote repository."), QMessageBox::Ok); QMessageBox::critical(this, tr("Error"), tr("Could not set the remote repository."), QMessageBox::Ok);
} }
} }

View File

@ -166,7 +166,7 @@ public:
fossil().Init(callback, exePath); fossil().Init(callback, exePath);
} }
bool createWorkspace(const QString &repositoryPath, const QString& workspacePath) bool create(const QString &repositoryPath, const QString& workspacePath)
{ {
return fossil().createWorkspace(repositoryPath, workspacePath); return fossil().createWorkspace(repositoryPath, workspacePath);
} }
@ -176,12 +176,12 @@ public:
return fossil().createRepository(repositoryPath); return fossil().createRepository(repositoryPath);
} }
Fossil::WorkspaceState getWorkspaceState() Fossil::WorkspaceState getState()
{ {
return fossil().getWorkspaceState(); return fossil().getWorkspaceState();
} }
bool closeWorkspace() bool close()
{ {
return fossil().closeWorkspace(); return fossil().closeWorkspace();
} }
@ -191,22 +191,22 @@ public:
return fossil().cloneRepository(repository, url, proxyUrl); return fossil().cloneRepository(repository, url, proxyUrl);
} }
bool pushWorkspace(const QUrl& url) bool push(const QUrl& url)
{ {
return fossil().pushWorkspace(url); return fossil().pushWorkspace(url);
} }
bool pullWorkspace(const QUrl& url) bool pull(const QUrl& url)
{ {
return fossil().pullWorkspace(url); return fossil().pullWorkspace(url);
} }
bool updateWorkspace(QStringList& result, const QString& revision, bool explainOnly) bool update(QStringList& result, const QString& revision, bool explainOnly)
{ {
return fossil().updateWorkspace(result, revision, explainOnly); return fossil().updateWorkspace(result, revision, explainOnly);
} }
bool undoWorkspace(QStringList& result, bool explainOnly) bool undo(QStringList& result, bool explainOnly)
{ {
return fossil().undoWorkspace(result, explainOnly); return fossil().undoWorkspace(result, explainOnly);
} }
@ -299,12 +299,6 @@ public:
return fossil().branchMerge(res, revision, integrate, force, testOnly); return fossil().branchMerge(res, revision, integrate, force, testOnly);
} }
// Remotes
bool setDefaultRemoteUrl(const QUrl& url)
{
return fossil().setRemoteUrl(url);
}
bool getInterfaceVersion(QString &version) bool getInterfaceVersion(QString &version)
{ {
return fossil().getExeVersion(version); return fossil().getExeVersion(version);