VCS[git/hg]: Prevent search for repository from creating folders

... when autofs is involved. Check for files instead of folders
and stop checking/recursing up at '/' or $HOME. Further fixup
will follow.

Task-number: QTCREATORBUG-1361
Task-number: QTBUG-10495
This commit is contained in:
Friedemann Kleint
2010-05-19 17:41:14 +02:00
parent 9af9c91f93
commit b4b177fa27
5 changed files with 49 additions and 20 deletions

View File

@@ -556,15 +556,10 @@ void MercurialClient::commit(const QString &repositoryRoot, const QStringList &f
QString MercurialClient::findTopLevelForFile(const QFileInfo &file)
{
const QString repositoryTopDir = QLatin1String(Constants::MECURIALREPO);
QDir dir = file.isDir() ? QDir(file.absoluteFilePath()) : QDir(file.absolutePath());
do {
if (QFileInfo(dir, repositoryTopDir).exists())
return dir.absolutePath();
} while (dir.cdUp());
return QString();
const QString repositoryCheckFile = QLatin1String(Constants::MECURIALREPO) + QLatin1String("/requires");
return file.isDir() ?
VCSBase::VCSBasePlugin::findRepositoryForDirectory(file.absoluteFilePath(), repositoryCheckFile) :
VCSBase::VCSBasePlugin::findRepositoryForDirectory(file.absolutePath(), repositoryCheckFile);
}
void MercurialClient::settingsChanged()