File renaming

Reviewed-By: con
Reviewed-By: Friedemann Kleint

We now support renaming files. The version control system tries first to
rename, if that doesn't support or can't rename the file we do a normal
rename. (Note: git, hg, perforce > 2009.02 support renaming, cvs not.
(perforce untested)). We correctly notify all editors of the renamed
file and tell the project manager to rename the file in the project.

Note: Only the qt4projectmanager knows how to rename files.

Note: renaming folders, moving files to different folders, renaming
.pro/.pri files is not supported. Those things can be later added after
this has proven to work correctly in the simple case.

Also we don't do any actions based on the renaming like renaming
classes, changing include guards or #include lines.
This commit is contained in:
dt
2010-05-11 14:13:38 +02:00
parent e65e011706
commit 9bc9fe73e1
58 changed files with 365 additions and 35 deletions

View File

@@ -95,6 +95,14 @@ bool MercurialClient::remove(const QString &workingDir, const QString &filename)
return executeHgSynchronously(workingDir, args, &stdOut);
}
bool MercurialClient::move(const QString &workingDir, const QString &from, const QString &to)
{
QStringList args;
args << QLatin1String("rename") << from << to;
QByteArray stdOut;
return executeHgSynchronously(workingDir, args, &stdOut);
}
bool MercurialClient::manifestSync(const QString &repository, const QString &relativeFilename)
{
// This only works when called from the repo and outputs paths relative to it.