summaryrefslogtreecommitdiffstats
path: root/plugins/fossil/fossilclient.cpp
diff options
context:
space:
mode:
authorArtur Shepilko <artur.shepilko@nomadbyte.com>2020-06-15 19:22:59 -0500
committerArtur Shepilko <artur.shepilko@nomadbyte.com>2020-06-16 19:29:24 +0000
commit30b04ca9190f139498f59b7e75eea19933ceec4f (patch)
tree7222cf172ed2efa0e71fe0b31a95665728d40d8b /plugins/fossil/fossilclient.cpp
parent9a64faff10162200c31babbccb3a1d9d6acd082d (diff)
Push/pull: Fix the handling of the Default URL
On a successful push/pull operation, Fossil allows user to save the used remote URL, such that the next time it would be used by default. With Fossil plugin, the user is allowed to choose the saved Default location, also it's pre-filled in Remote URL field. A choice is offered to save the newly entered Remote URL, otherwise the entered URL is used only once without saving. To use the Default URL, Fossil push/pull command should be called without specifying any URL explicitly. Otherwise, Fossil client displays a prompt asking whether to save it, even when it matches the currently stored one. Change-Id: I3f517be4b60bef5bf1f5bca19345078ef6d6dda2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'plugins/fossil/fossilclient.cpp')
-rw-r--r--plugins/fossil/fossilclient.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/fossil/fossilclient.cpp b/plugins/fossil/fossilclient.cpp
index 16385c5..a2817d0 100644
--- a/plugins/fossil/fossilclient.cpp
+++ b/plugins/fossil/fossilclient.cpp
@@ -711,11 +711,15 @@ bool FossilClient::synchronousMove(const QString &workingDir,
bool FossilClient::synchronousPull(const QString &workingDir, const QString &srcLocation, const QStringList &extraOptions)
{
- const QString remoteLocation = (!srcLocation.isEmpty() ? srcLocation : synchronousGetRepositoryURL(workingDir));
- if (remoteLocation.isEmpty())
- return false;
+ QStringList args(vcsCommandString(PullCommand));
+ if (srcLocation.isEmpty()) {
+ const QString defaultURL(synchronousGetRepositoryURL(workingDir));
+ if (defaultURL.isEmpty())
+ return false;
+ } else {
+ args << srcLocation;
+ }
- QStringList args({vcsCommandString(PullCommand), remoteLocation});
args << extraOptions;
// Disable UNIX terminals to suppress SSH prompting
const unsigned flags =
@@ -731,11 +735,15 @@ bool FossilClient::synchronousPull(const QString &workingDir, const QString &src
bool FossilClient::synchronousPush(const QString &workingDir, const QString &dstLocation, const QStringList &extraOptions)
{
- const QString remoteLocation = (!dstLocation.isEmpty() ? dstLocation : synchronousGetRepositoryURL(workingDir));
- if (remoteLocation.isEmpty())
- return false;
+ QStringList args(vcsCommandString(PushCommand));
+ if (dstLocation.isEmpty()) {
+ const QString defaultURL(synchronousGetRepositoryURL(workingDir));
+ if (defaultURL.isEmpty())
+ return false;
+ } else {
+ args << dstLocation;
+ }
- QStringList args({vcsCommandString(PushCommand), remoteLocation});
args << extraOptions;
// Disable UNIX terminals to suppress SSH prompting
const unsigned flags =