forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user