forked from qt-creator/qt-creator
Adapt to upstream changes
* FilePathification * SynchronousProcess -> QtcProcess Change-Id: I973ff68585788c8742652f69a7c057e28aafbaf4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -261,8 +261,8 @@ unsigned int FossilClient::synchronousBinaryVersion() const
|
||||
|
||||
QStringList args("version");
|
||||
|
||||
SynchronousProcess proc;
|
||||
vcsFullySynchronousExec(proc, QString(), args);
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, FilePath(), args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return 0;
|
||||
|
||||
@@ -294,13 +294,13 @@ QList<BranchInfo> FossilClient::branchListFromOutput(const QString &output, cons
|
||||
});
|
||||
}
|
||||
|
||||
BranchInfo FossilClient::synchronousCurrentBranch(const QString &workingDirectory)
|
||||
BranchInfo FossilClient::synchronousCurrentBranch(const FilePath &workingDirectory)
|
||||
{
|
||||
if (workingDirectory.isEmpty())
|
||||
return BranchInfo();
|
||||
|
||||
// First try to get the current branch from the list of open branches
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"branch", "list"});
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return BranchInfo();
|
||||
@@ -312,7 +312,7 @@ BranchInfo FossilClient::synchronousCurrentBranch(const QString &workingDirector
|
||||
|
||||
if (!currentBranch.isCurrent()) {
|
||||
// If not available from open branches, request it from the list of closed branches.
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"branch", "list", "--closed"});
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return BranchInfo();
|
||||
@@ -326,7 +326,7 @@ BranchInfo FossilClient::synchronousCurrentBranch(const QString &workingDirector
|
||||
return currentBranch;
|
||||
}
|
||||
|
||||
QList<BranchInfo> FossilClient::synchronousBranchQuery(const QString &workingDirectory)
|
||||
QList<BranchInfo> FossilClient::synchronousBranchQuery(const FilePath &workingDirectory)
|
||||
{
|
||||
// Return a list of all branches, including the closed ones.
|
||||
// Sort the list by branch name.
|
||||
@@ -335,7 +335,7 @@ QList<BranchInfo> FossilClient::synchronousBranchQuery(const QString &workingDir
|
||||
return QList<BranchInfo>();
|
||||
|
||||
// First get list of open branches
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, {"branch", "list"});
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return QList<BranchInfo>();
|
||||
@@ -371,7 +371,8 @@ QStringList FossilClient::parseRevisionCommentLine(const QString &commentLine)
|
||||
return QStringList({match.captured(1), match.captured(2)});
|
||||
}
|
||||
|
||||
RevisionInfo FossilClient::synchronousRevisionQuery(const QString &workingDirectory, const QString &id,
|
||||
RevisionInfo FossilClient::synchronousRevisionQuery(const FilePath &workingDirectory,
|
||||
const QString &id,
|
||||
bool getCommentMsg) const
|
||||
{
|
||||
// Query details of the given revision/check-out id,
|
||||
@@ -383,7 +384,7 @@ RevisionInfo FossilClient::synchronousRevisionQuery(const QString &workingDirect
|
||||
if (!id.isEmpty())
|
||||
args << id;
|
||||
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args, ShellCommand::SuppressCommandLogging);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return RevisionInfo();
|
||||
@@ -433,7 +434,7 @@ RevisionInfo FossilClient::synchronousRevisionQuery(const QString &workingDirect
|
||||
return RevisionInfo(revisionId, parentId, mergeParentIds, commentMsg, committer);
|
||||
}
|
||||
|
||||
QStringList FossilClient::synchronousTagQuery(const QString &workingDirectory, const QString &id)
|
||||
QStringList FossilClient::synchronousTagQuery(const FilePath &workingDirectory, const QString &id)
|
||||
{
|
||||
// Return a list of tags for the given revision.
|
||||
// If no revision specified, all defined tags are listed.
|
||||
@@ -447,7 +448,7 @@ QStringList FossilClient::synchronousTagQuery(const QString &workingDirectory, c
|
||||
if (!id.isEmpty())
|
||||
args << id;
|
||||
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return QStringList();
|
||||
@@ -457,7 +458,7 @@ QStringList FossilClient::synchronousTagQuery(const QString &workingDirectory, c
|
||||
return output.split('\n', Qt::SkipEmptyParts);
|
||||
}
|
||||
|
||||
RepositorySettings FossilClient::synchronousSettingsQuery(const QString &workingDirectory)
|
||||
RepositorySettings FossilClient::synchronousSettingsQuery(const FilePath &workingDirectory)
|
||||
{
|
||||
if (workingDirectory.isEmpty())
|
||||
return RepositorySettings();
|
||||
@@ -470,7 +471,7 @@ RepositorySettings FossilClient::synchronousSettingsQuery(const QString &working
|
||||
|
||||
const QStringList args("settings");
|
||||
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return RepositorySettings();
|
||||
@@ -507,7 +508,7 @@ RepositorySettings FossilClient::synchronousSettingsQuery(const QString &working
|
||||
return repoSettings;
|
||||
}
|
||||
|
||||
bool FossilClient::synchronousSetSetting(const QString &workingDirectory,
|
||||
bool FossilClient::synchronousSetSetting(const FilePath &workingDirectory,
|
||||
const QString &property, const QString &value, bool isGlobal)
|
||||
{
|
||||
// set a repository property to the given value
|
||||
@@ -525,13 +526,13 @@ bool FossilClient::synchronousSetSetting(const QString &workingDirectory,
|
||||
if (isGlobal)
|
||||
args << "--global";
|
||||
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
return (proc.result() == QtcProcess::Finished);
|
||||
}
|
||||
|
||||
|
||||
bool FossilClient::synchronousConfigureRepository(const QString &workingDirectory, const RepositorySettings &newSettings,
|
||||
bool FossilClient::synchronousConfigureRepository(const FilePath &workingDirectory, const RepositorySettings &newSettings,
|
||||
const RepositorySettings ¤tSettings)
|
||||
{
|
||||
if (workingDirectory.isEmpty())
|
||||
@@ -575,14 +576,14 @@ bool FossilClient::synchronousConfigureRepository(const QString &workingDirector
|
||||
return true;
|
||||
}
|
||||
|
||||
QString FossilClient::synchronousUserDefaultQuery(const QString &workingDirectory)
|
||||
QString FossilClient::synchronousUserDefaultQuery(const FilePath &workingDirectory)
|
||||
{
|
||||
if (workingDirectory.isEmpty())
|
||||
return QString();
|
||||
|
||||
const QStringList args({"user", "default"});
|
||||
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return QString();
|
||||
@@ -592,26 +593,26 @@ QString FossilClient::synchronousUserDefaultQuery(const QString &workingDirector
|
||||
return output.trimmed();
|
||||
}
|
||||
|
||||
bool FossilClient::synchronousSetUserDefault(const QString &workingDirectory, const QString &userName)
|
||||
bool FossilClient::synchronousSetUserDefault(const FilePath &workingDirectory, const QString &userName)
|
||||
{
|
||||
if (workingDirectory.isEmpty() || userName.isEmpty())
|
||||
return false;
|
||||
|
||||
// set repository-default user
|
||||
const QStringList args({"user", "default", userName, "--user", userName});
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
return (proc.result() == QtcProcess::Finished);
|
||||
}
|
||||
|
||||
QString FossilClient::synchronousGetRepositoryURL(const QString &workingDirectory)
|
||||
QString FossilClient::synchronousGetRepositoryURL(const FilePath &workingDirectory)
|
||||
{
|
||||
if (workingDirectory.isEmpty())
|
||||
return QString();
|
||||
|
||||
const QStringList args("remote-url");
|
||||
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return QString();
|
||||
@@ -626,7 +627,7 @@ QString FossilClient::synchronousGetRepositoryURL(const QString &workingDirector
|
||||
return output;
|
||||
}
|
||||
|
||||
QString FossilClient::synchronousTopic(const QString &workingDirectory)
|
||||
QString FossilClient::synchronousTopic(const FilePath &workingDirectory)
|
||||
{
|
||||
if (workingDirectory.isEmpty())
|
||||
return QString();
|
||||
@@ -640,7 +641,7 @@ QString FossilClient::synchronousTopic(const QString &workingDirectory)
|
||||
return branchInfo.name();
|
||||
}
|
||||
|
||||
bool FossilClient::synchronousCreateRepository(const QString &workingDirectory, const QStringList &extraOptions)
|
||||
bool FossilClient::synchronousCreateRepository(const FilePath &workingDirectory, const QStringList &extraOptions)
|
||||
{
|
||||
VcsBase::VcsOutputWindow *outputWindow = VcsBase::VcsOutputWindow::instance();
|
||||
|
||||
@@ -648,7 +649,7 @@ bool FossilClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
// use the configured default repository location for path
|
||||
// use the configured default user for admin
|
||||
|
||||
const QString repoName = QDir(workingDirectory).dirName().simplified();
|
||||
const QString repoName = workingDirectory.fileName().simplified();
|
||||
const QString repoPath = settings().defaultRepoPath.value();
|
||||
const QString adminUser = settings().userName.value();
|
||||
|
||||
@@ -665,7 +666,7 @@ bool FossilClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
if (!adminUser.isEmpty())
|
||||
args << "--admin-user" << adminUser;
|
||||
args << extraOptions << repoFilePath.toUserOutput();
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return false;
|
||||
@@ -706,7 +707,7 @@ bool FossilClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FossilClient::synchronousMove(const QString &workingDir,
|
||||
bool FossilClient::synchronousMove(const FilePath &workingDir,
|
||||
const QString &from, const QString &to,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
@@ -719,12 +720,12 @@ bool FossilClient::synchronousMove(const QString &workingDir,
|
||||
|
||||
QStringList args(vcsCommandString(MoveCommand));
|
||||
args << extraOptions << from << to;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return (proc.result() == QtcProcess::Finished);
|
||||
}
|
||||
|
||||
bool FossilClient::synchronousPull(const QString &workingDir, const QString &srcLocation, const QStringList &extraOptions)
|
||||
bool FossilClient::synchronousPull(const FilePath &workingDir, const QString &srcLocation, const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args(vcsCommandString(PullCommand));
|
||||
if (srcLocation.isEmpty()) {
|
||||
@@ -741,15 +742,15 @@ bool FossilClient::synchronousPull(const QString &workingDir, const QString &src
|
||||
VcsBase::VcsCommand::SshPasswordPrompt
|
||||
| VcsBase::VcsCommand::ShowStdOut
|
||||
| VcsBase::VcsCommand::ShowSuccessMessage;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
const bool success = (proc.result() == QtcProcess::Finished);
|
||||
if (success)
|
||||
emit changed(QVariant(workingDir));
|
||||
emit changed(workingDir.toVariant());
|
||||
return success;
|
||||
}
|
||||
|
||||
bool FossilClient::synchronousPush(const QString &workingDir, const QString &dstLocation, const QStringList &extraOptions)
|
||||
bool FossilClient::synchronousPush(const FilePath &workingDir, const QString &dstLocation, const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args(vcsCommandString(PushCommand));
|
||||
if (dstLocation.isEmpty()) {
|
||||
@@ -766,20 +767,19 @@ bool FossilClient::synchronousPush(const QString &workingDir, const QString &dst
|
||||
VcsBase::VcsCommand::SshPasswordPrompt
|
||||
| VcsBase::VcsCommand::ShowStdOut
|
||||
| VcsBase::VcsCommand::ShowSuccessMessage;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
return (proc.result() == QtcProcess::Finished);
|
||||
}
|
||||
|
||||
void FossilClient::commit(const QString &repositoryRoot, const QStringList &files,
|
||||
void FossilClient::commit(const FilePath &repositoryRoot, const QStringList &files,
|
||||
const QString &commitMessageFile, const QStringList &extraOptions)
|
||||
{
|
||||
VcsBaseClient::commit(repositoryRoot, files, commitMessageFile,
|
||||
QStringList(extraOptions) << "-M" << commitMessageFile);
|
||||
}
|
||||
|
||||
VcsBase::VcsBaseEditorWidget *FossilClient::annotate(
|
||||
const QString &workingDir, const QString &file, const QString &revision,
|
||||
VcsBase::VcsBaseEditorWidget *FossilClient::annotate(const FilePath &workingDir, const QString &file, const QString &revision,
|
||||
int lineNumber, const QStringList &extraOptions)
|
||||
{
|
||||
// 'fossil annotate' command has a variant 'fossil blame'.
|
||||
@@ -852,10 +852,10 @@ FilePath FossilClient::findTopLevelForFile(const FilePath &file) const
|
||||
return VcsBase::findRepositoryForFile(file, Constants::FOSSILREPO);
|
||||
}
|
||||
|
||||
bool FossilClient::managesFile(const QString &workingDirectory, const QString &fileName) const
|
||||
bool FossilClient::managesFile(const FilePath &workingDirectory, const QString &fileName) const
|
||||
{
|
||||
const QStringList args({"finfo", fileName});
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::Finished)
|
||||
return false;
|
||||
@@ -927,8 +927,8 @@ void FossilClient::view(const QString &source, const QString &id, const QStringL
|
||||
{
|
||||
QStringList args("diff");
|
||||
|
||||
const QFileInfo fi(source);
|
||||
const QString workingDirectory = fi.isFile() ? fi.absolutePath() : source;
|
||||
const FilePath fPath = FilePath::fromString(source);
|
||||
const FilePath workingDirectory = fPath.isFile() ? fPath.absolutePath() : fPath;
|
||||
|
||||
RevisionInfo revisionInfo = synchronousRevisionQuery(workingDirectory,id);
|
||||
|
||||
@@ -992,7 +992,7 @@ void FossilLogHighlighter::highlightBlock(const QString &text)
|
||||
}
|
||||
}
|
||||
|
||||
void FossilClient::log(const QString &workingDir, const QStringList &files,
|
||||
void FossilClient::log(const FilePath &workingDir, const QStringList &files,
|
||||
const QStringList &extraOptions,
|
||||
bool enableAnnotationContextMenu)
|
||||
{
|
||||
@@ -1045,7 +1045,7 @@ void FossilClient::log(const QString &workingDir, const QStringList &files,
|
||||
enqueueJob(createCommand(workingDir, fossilEditor), args);
|
||||
}
|
||||
|
||||
void FossilClient::logCurrentFile(const QString &workingDir, const QStringList &files,
|
||||
void FossilClient::logCurrentFile(const FilePath &workingDir, const QStringList &files,
|
||||
const QStringList &extraOptions,
|
||||
bool enableAnnotationContextMenu)
|
||||
{
|
||||
@@ -1095,7 +1095,7 @@ void FossilClient::logCurrentFile(const QString &workingDir, const QStringList &
|
||||
enqueueJob(createCommand(workingDir, fossilEditor), args);
|
||||
}
|
||||
|
||||
void FossilClient::revertFile(const QString &workingDir,
|
||||
void FossilClient::revertFile(const FilePath &workingDir,
|
||||
const QString &file,
|
||||
const QString &revision,
|
||||
const QStringList &extraOptions)
|
||||
@@ -1108,12 +1108,12 @@ void FossilClient::revertFile(const QString &workingDir,
|
||||
|
||||
// Indicate file list
|
||||
VcsBase::VcsCommand *cmd = createCommand(workingDir);
|
||||
cmd->setCookie(QStringList(workingDir + "/" + file));
|
||||
cmd->setCookie(QStringList(workingDir.toString() + "/" + file));
|
||||
connect(cmd, &VcsBase::VcsCommand::success, this, &VcsBase::VcsBaseClient::changed, Qt::QueuedConnection);
|
||||
enqueueJob(cmd, args);
|
||||
}
|
||||
|
||||
void FossilClient::revertAll(const QString &workingDir, const QString &revision, const QStringList &extraOptions)
|
||||
void FossilClient::revertAll(const FilePath &workingDir, const QString &revision, const QStringList &extraOptions)
|
||||
{
|
||||
// Fossil allows whole tree revert to latest revision (effectively undoing uncommitted changes).
|
||||
// However it disallows revert to a specific revision for the whole tree, only for selected files.
|
||||
@@ -1134,7 +1134,7 @@ void FossilClient::revertAll(const QString &workingDir, const QString &revision,
|
||||
|
||||
// Indicate repository change
|
||||
VcsBase::VcsCommand *cmd = createCommand(workingDir);
|
||||
cmd->setCookie(QStringList(workingDir));
|
||||
cmd->setCookie(QStringList(workingDir.toString()));
|
||||
connect(cmd, &VcsBase::VcsCommand::success, this, &VcsBase::VcsBaseClient::changed, Qt::QueuedConnection);
|
||||
enqueueJob(createCommand(workingDir), args);
|
||||
}
|
||||
|
||||
@@ -67,50 +67,51 @@ public:
|
||||
FossilSettings &settings() const;
|
||||
|
||||
unsigned int synchronousBinaryVersion() const;
|
||||
BranchInfo synchronousCurrentBranch(const QString &workingDirectory);
|
||||
QList<BranchInfo> synchronousBranchQuery(const QString &workingDirectory);
|
||||
RevisionInfo synchronousRevisionQuery(const QString &workingDirectory, const QString &id = QString(),
|
||||
BranchInfo synchronousCurrentBranch(const Utils::FilePath &workingDirectory);
|
||||
QList<BranchInfo> synchronousBranchQuery(const Utils::FilePath &workingDirectory);
|
||||
RevisionInfo synchronousRevisionQuery(const Utils::FilePath &workingDirectory,
|
||||
const QString &id = QString(),
|
||||
bool getCommentMsg = false) const;
|
||||
QStringList synchronousTagQuery(const QString &workingDirectory, const QString &id = QString());
|
||||
RepositorySettings synchronousSettingsQuery(const QString &workingDirectory);
|
||||
bool synchronousSetSetting(const QString &workingDirectory, const QString &property,
|
||||
QStringList synchronousTagQuery(const Utils::FilePath &workingDirectory, const QString &id = {});
|
||||
RepositorySettings synchronousSettingsQuery(const Utils::FilePath &workingDirectory);
|
||||
bool synchronousSetSetting(const Utils::FilePath &workingDirectory, const QString &property,
|
||||
const QString &value = QString(), bool isGlobal = false);
|
||||
bool synchronousConfigureRepository(const QString &workingDirectory, const RepositorySettings &newSettings,
|
||||
bool synchronousConfigureRepository(const Utils::FilePath &workingDirectory, const RepositorySettings &newSettings,
|
||||
const RepositorySettings ¤tSettings = RepositorySettings());
|
||||
QString synchronousUserDefaultQuery(const QString &workingDirectory);
|
||||
bool synchronousSetUserDefault(const QString &workingDirectory, const QString &userName);
|
||||
QString synchronousGetRepositoryURL(const QString &workingDirectory);
|
||||
QString synchronousTopic(const QString &workingDirectory);
|
||||
bool synchronousCreateRepository(const QString &workingDirectory,
|
||||
QString synchronousUserDefaultQuery(const Utils::FilePath &workingDirectory);
|
||||
bool synchronousSetUserDefault(const Utils::FilePath &workingDirectory, const QString &userName);
|
||||
QString synchronousGetRepositoryURL(const Utils::FilePath &workingDirectory);
|
||||
QString synchronousTopic(const Utils::FilePath &workingDirectory);
|
||||
bool synchronousCreateRepository(const Utils::FilePath &workingDirectory,
|
||||
const QStringList &extraOptions = QStringList()) final;
|
||||
bool synchronousMove(const QString &workingDir,
|
||||
bool synchronousMove(const Utils::FilePath &workingDir,
|
||||
const QString &from, const QString &to,
|
||||
const QStringList &extraOptions = QStringList()) final;
|
||||
bool synchronousPull(const QString &workingDir,
|
||||
bool synchronousPull(const Utils::FilePath &workingDir,
|
||||
const QString &srcLocation,
|
||||
const QStringList &extraOptions = QStringList()) final;
|
||||
bool synchronousPush(const QString &workingDir,
|
||||
bool synchronousPush(const Utils::FilePath &workingDir,
|
||||
const QString &dstLocation,
|
||||
const QStringList &extraOptions = QStringList()) final;
|
||||
void commit(const QString &repositoryRoot, const QStringList &files,
|
||||
void commit(const Utils::FilePath &repositoryRoot, const QStringList &files,
|
||||
const QString &commitMessageFile, const QStringList &extraOptions = QStringList()) final;
|
||||
VcsBase::VcsBaseEditorWidget *annotate(
|
||||
const QString &workingDir, const QString &file, const QString &revision = QString(),
|
||||
const Utils::FilePath &workingDir, const QString &file, const QString &revision = {},
|
||||
int lineNumber = -1, const QStringList &extraOptions = QStringList()) final;
|
||||
void log(const QString &workingDir, const QStringList &files = QStringList(),
|
||||
void log(const Utils::FilePath &workingDir, const QStringList &files = QStringList(),
|
||||
const QStringList &extraOptions = QStringList(),
|
||||
bool enableAnnotationContextMenu = false) final;
|
||||
void logCurrentFile(const QString &workingDir, const QStringList &files = QStringList(),
|
||||
void logCurrentFile(const Utils::FilePath &workingDir, const QStringList &files = QStringList(),
|
||||
const QStringList &extraOptions = QStringList(),
|
||||
bool enableAnnotationContextMenu = false);
|
||||
void revertFile(const QString &workingDir, const QString &file,
|
||||
void revertFile(const Utils::FilePath &workingDir, const QString &file,
|
||||
const QString &revision = QString(),
|
||||
const QStringList &extraOptions = QStringList()) final;
|
||||
void revertAll(const QString &workingDir, const QString &revision = QString(),
|
||||
void revertAll(const Utils::FilePath &workingDir, const QString &revision = QString(),
|
||||
const QStringList &extraOptions = QStringList()) final;
|
||||
bool isVcsFileOrDirectory(const Utils::FilePath &filePath) const;
|
||||
Utils::FilePath findTopLevelForFile(const Utils::FilePath &file) const final;
|
||||
bool managesFile(const QString &workingDirectory, const QString &fileName) const;
|
||||
bool managesFile(const Utils::FilePath &workingDirectory, const QString &fileName) const;
|
||||
unsigned int binaryVersion() const;
|
||||
QString binaryVersionString() const;
|
||||
SupportedFeatures supportedFeatures() const;
|
||||
|
||||
@@ -90,8 +90,7 @@ QString FossilEditorWidget::decorateVersion(const QString &revision) const
|
||||
static const int shortChangesetIdSize(10);
|
||||
static const int maxTextSize(120);
|
||||
|
||||
const QFileInfo fi(source());
|
||||
const QString workingDirectory = fi.absolutePath();
|
||||
const Utils::FilePath workingDirectory = Utils::FilePath::fromString(source()).parentDir();
|
||||
const FossilClient *client = FossilPlugin::client();
|
||||
RevisionInfo revisionInfo =
|
||||
client->synchronousRevisionQuery(workingDirectory, revision, true);
|
||||
@@ -112,8 +111,7 @@ QString FossilEditorWidget::decorateVersion(const QString &revision) const
|
||||
QStringList FossilEditorWidget::annotationPreviousVersions(const QString &revision) const
|
||||
{
|
||||
QStringList revisions;
|
||||
const QFileInfo fi(source());
|
||||
const QString workingDirectory = fi.absolutePath();
|
||||
const Utils::FilePath workingDirectory = Utils::FilePath::fromString(source()).parentDir();
|
||||
const FossilClient *client = FossilPlugin::client();
|
||||
RevisionInfo revisionInfo =
|
||||
client->synchronousRevisionQuery(workingDirectory, revision);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Internal {
|
||||
|
||||
class FossilEditorWidgetPrivate;
|
||||
|
||||
class FossilEditorWidget : public VcsBase::VcsBaseEditorWidget
|
||||
class FossilEditorWidget final : public VcsBase::VcsBaseEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
|
||||
QString refreshTopic(const FilePath &repository) final
|
||||
{
|
||||
return m_client->synchronousTopic(repository.toString());
|
||||
return m_client->synchronousTopic(repository);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
// Submit editor actions
|
||||
QAction *m_menuAction = nullptr;
|
||||
|
||||
QString m_submitRepository;
|
||||
Utils::FilePath m_submitRepository;
|
||||
bool m_submitActionTriggered = false;
|
||||
|
||||
// To be connected to the VcsTask's success signal to emit the repository/
|
||||
@@ -729,8 +729,7 @@ void FossilPluginPrivate::showCommitWidget(const QList<VcsBase::VcsBaseClient::S
|
||||
}
|
||||
setSubmitEditor(commitEditor);
|
||||
|
||||
const QString msg = tr("Commit changes for \"%1\".").
|
||||
arg(QDir::toNativeSeparators(m_submitRepository));
|
||||
const QString msg = tr("Commit changes for \"%1\".").arg(m_submitRepository.toUserOutput());
|
||||
commitEditor->document()->setPreferredDisplayName(msg);
|
||||
|
||||
const RevisionInfo currentRevision = m_client.synchronousRevisionQuery(m_submitRepository);
|
||||
@@ -739,7 +738,7 @@ void FossilPluginPrivate::showCommitWidget(const QList<VcsBase::VcsBaseClient::S
|
||||
QStringList tags = m_client.synchronousTagQuery(m_submitRepository, currentRevision.id);
|
||||
// Fossil includes branch name in tag list -- remove.
|
||||
tags.removeAll(currentBranch.name());
|
||||
commitEditor->setFields(m_submitRepository, currentBranch, tags, currentUser, status);
|
||||
commitEditor->setFields(m_submitRepository.toString(), currentBranch, tags, currentUser, status);
|
||||
|
||||
connect(commitEditor, &VcsBase::VcsBaseSubmitEditor::diffSelectedFiles,
|
||||
this, &FossilPluginPrivate::diffFromEditorSelected);
|
||||
@@ -763,27 +762,27 @@ void FossilPluginPrivate::createRepository()
|
||||
// re-implemented from void VcsBasePlugin::createRepository()
|
||||
|
||||
// Find current starting directory
|
||||
QString directory;
|
||||
Utils::FilePath directory;
|
||||
if (const ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectTree::currentProject())
|
||||
directory = currentProject->projectDirectory().toString();
|
||||
directory = currentProject->projectDirectory();
|
||||
// Prompt for a directory that is not under version control yet
|
||||
QWidget *mw = Core::ICore::mainWindow();
|
||||
do {
|
||||
directory = QFileDialog::getExistingDirectory(mw, tr("Choose Checkout Directory"), directory);
|
||||
directory = FileUtils::getExistingDirectory(tr("Choose Checkout Directory"), directory);
|
||||
if (directory.isEmpty())
|
||||
return;
|
||||
const Core::IVersionControl *managingControl = Core::VcsManager::findVersionControlForDirectory(directory);
|
||||
if (managingControl == 0)
|
||||
break;
|
||||
const QString question = tr("The directory \"%1\" is already managed by a version control system (%2)."
|
||||
" Would you like to specify another directory?").arg(directory, managingControl->displayName());
|
||||
" Would you like to specify another directory?").arg(directory.toUserOutput(), managingControl->displayName());
|
||||
|
||||
if (!ask(mw, tr("Repository already under version control"), question))
|
||||
return;
|
||||
} while (true);
|
||||
// Create
|
||||
const bool rc = vcsCreateRepository(FilePath::fromString(directory));
|
||||
const QString nativeDir = QDir::toNativeSeparators(directory);
|
||||
const bool rc = vcsCreateRepository(directory);
|
||||
const QString nativeDir = directory.toUserOutput();
|
||||
if (rc) {
|
||||
QMessageBox::information(mw, tr("Repository Created"),
|
||||
tr("A version control repository has been created in %1.").
|
||||
@@ -915,7 +914,7 @@ bool FossilPluginPrivate::managesDirectory(const FilePath &directory, FilePath *
|
||||
|
||||
bool FossilPluginPrivate::managesFile(const FilePath &workingDirectory, const QString &fileName) const
|
||||
{
|
||||
return m_client.managesFile(workingDirectory.toString(), fileName);
|
||||
return m_client.managesFile(workingDirectory, fileName);
|
||||
}
|
||||
|
||||
bool FossilPluginPrivate::isConfigured() const
|
||||
@@ -967,34 +966,31 @@ bool FossilPluginPrivate::vcsOpen(const FilePath &filePath)
|
||||
|
||||
bool FossilPluginPrivate::vcsAdd(const FilePath &filePath)
|
||||
{
|
||||
const QFileInfo fi = filePath.toFileInfo();
|
||||
return m_client.synchronousAdd(fi.absolutePath(), fi.fileName());
|
||||
return m_client.synchronousAdd(filePath.absolutePath(), filePath.fileName());
|
||||
}
|
||||
|
||||
bool FossilPluginPrivate::vcsDelete(const FilePath &filePath)
|
||||
{
|
||||
const QFileInfo fi = filePath.toFileInfo();
|
||||
return m_client.synchronousRemove(fi.absolutePath(), fi.fileName());
|
||||
return m_client.synchronousRemove(filePath.absolutePath(), filePath.fileName());
|
||||
}
|
||||
|
||||
bool FossilPluginPrivate::vcsMove(const FilePath &from, const FilePath &to)
|
||||
{
|
||||
const QFileInfo fromInfo = from.toFileInfo();
|
||||
const QFileInfo toInfo = to.toFileInfo();
|
||||
return m_client.synchronousMove(fromInfo.absolutePath(),
|
||||
fromInfo.absoluteFilePath(),
|
||||
toInfo.absoluteFilePath());
|
||||
return m_client.synchronousMove(from.absolutePath(),
|
||||
fromInfo.absoluteFilePath(),
|
||||
toInfo.absoluteFilePath());
|
||||
}
|
||||
|
||||
bool FossilPluginPrivate::vcsCreateRepository(const FilePath &directory)
|
||||
{
|
||||
return m_client.synchronousCreateRepository(directory.toString());
|
||||
return m_client.synchronousCreateRepository(directory);
|
||||
}
|
||||
|
||||
void FossilPluginPrivate::vcsAnnotate(const FilePath &filePath, int line)
|
||||
{
|
||||
const QFileInfo fi = filePath.toFileInfo();
|
||||
m_client.annotate(fi.absolutePath(), fi.fileName(), QString(), line);
|
||||
m_client.annotate(filePath.absolutePath(), filePath.fileName(), QString(), line);
|
||||
}
|
||||
|
||||
void FossilPluginPrivate::vcsDescribe(const FilePath &source, const QString &id) { m_client.view(source.toString(), id); }
|
||||
@@ -1018,7 +1014,7 @@ Core::ShellCommand *FossilPluginPrivate::createInitialCheckoutCommand(const QStr
|
||||
// -- open/checkout an existing local fossil
|
||||
// Clone URL is an absolute local path and is the same as the local fossil.
|
||||
|
||||
const QString checkoutPath = baseDirectory.pathAppended(localName).toString();
|
||||
const Utils::FilePath checkoutPath = baseDirectory.pathAppended(localName);
|
||||
const QString fossilFile = options.value("fossil-file");
|
||||
const Utils::FilePath fossilFilePath = Utils::FilePath::fromUserInput(QDir::fromNativeSeparators(fossilFile));
|
||||
const QString fossilFileNative = fossilFilePath.toUserOutput();
|
||||
@@ -1043,12 +1039,10 @@ Core::ShellCommand *FossilPluginPrivate::createInitialCheckoutCommand(const QStr
|
||||
|
||||
// first create the checkout directory,
|
||||
// as it needs to become a working directory for wizard command jobs
|
||||
|
||||
const QDir checkoutDir(checkoutPath);
|
||||
checkoutDir.mkpath(checkoutPath);
|
||||
checkoutPath.createDir();
|
||||
|
||||
// Setup the wizard page command job
|
||||
auto command = new VcsBase::VcsCommand(checkoutDir.path(), m_client.processEnvironment());
|
||||
auto command = new VcsBase::VcsCommand(checkoutPath, m_client.processEnvironment());
|
||||
|
||||
if (!isLocalRepository
|
||||
&& !cloneRepository.exists()) {
|
||||
@@ -1116,7 +1110,7 @@ void FossilPluginPrivate::changed(const QVariant &v)
|
||||
{
|
||||
switch (v.type()) {
|
||||
case QVariant::String:
|
||||
emit repositoryChanged(v.toString());
|
||||
emit repositoryChanged(Utils::FilePath::fromVariant(v));
|
||||
break;
|
||||
case QVariant::StringList:
|
||||
emit filesChanged(v.toStringList());
|
||||
|
||||
Reference in New Issue
Block a user