Commit 1ef3d9df authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Subversion: Bump minimum subversion version to 1.7.0 or later



Change-Id: Iaca84fb6b5c218f37ce415e72d409893c2306254
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 2669813c
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
\row \row
\li Subversion \li Subversion
\li \l{http://subversion.apache.org/} \li \l{http://subversion.apache.org/}
\li Subversion version 1.6.17 and later \li Subversion version 1.7.0 and later
\endtable \endtable
\section1 Setting Up Version Control Systems \section1 Setting Up Version Control Systems
......
...@@ -234,11 +234,7 @@ void SubversionClient::diff(const QString &workingDir, const QStringList &files, ...@@ -234,11 +234,7 @@ void SubversionClient::diff(const QString &workingDir, const QStringList &files,
const QStringList &extraOptions) const QStringList &extraOptions)
{ {
QStringList args(extraOptions); QStringList args(extraOptions);
Version v = svnVersion(); args.append(QLatin1String("--internal-diff"));
// --internal-diff is new in v1.7.0
if (v.majorVersion > 1 || (v.majorVersion == 1 && v.minorVersion >= 7))
args.append(QLatin1String("--internal-diff"));
const bool hasAuth = settings()->hasAuthentication(); const bool hasAuth = settings()->hasAuthentication();
const QString userName = hasAuth ? settings()->stringValue(SubversionSettings::userKey) : QString(); const QString userName = hasAuth ? settings()->stringValue(SubversionSettings::userKey) : QString();
......
...@@ -1188,7 +1188,7 @@ bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLe ...@@ -1188,7 +1188,7 @@ bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLe
* parents may be svn:externals. */ * parents may be svn:externals. */
QDir parentDir = dir; QDir parentDir = dir;
while (!parentDir.isRoot()) { while (!parentDir.isRoot()) {
if (checkSVNSubDir(parentDir, QLatin1String("wc.db"))) { if (checkSVNSubDir(parentDir)) {
if (topLevel) if (topLevel)
*topLevel = parentDir.absolutePath(); *topLevel = parentDir.absolutePath();
return true; return true;
...@@ -1197,24 +1197,7 @@ bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLe ...@@ -1197,24 +1197,7 @@ bool SubversionPlugin::managesDirectory(const QString &directory, QString *topLe
break; break;
} }
/* Subversion < 1.7 has ".svn" directory in each directory return false;
* it manages. The top level is the first directory
* under the directory that does not have a ".svn".*/
if (!checkSVNSubDir(dir))
return false;
if (topLevel) {
QDir lastDirectory = dir;
for (parentDir = lastDirectory;
!parentDir.isRoot() && parentDir.cdUp();
lastDirectory = parentDir) {
if (!checkSVNSubDir(parentDir)) {
*topLevel = lastDirectory.absolutePath();
break;
}
}
}
return true;
} }
bool SubversionPlugin::managesFile(const QString &workingDirectory, const QString &fileName) const bool SubversionPlugin::managesFile(const QString &workingDirectory, const QString &fileName) const
...@@ -1227,14 +1210,14 @@ bool SubversionPlugin::managesFile(const QString &workingDirectory, const QStrin ...@@ -1227,14 +1210,14 @@ bool SubversionPlugin::managesFile(const QString &workingDirectory, const QStrin
} }
// Check whether SVN management subdirs exist. // Check whether SVN management subdirs exist.
bool SubversionPlugin::checkSVNSubDir(const QDir &directory, const QString &fileName) const bool SubversionPlugin::checkSVNSubDir(const QDir &directory) const
{ {
const int dirCount = m_svnDirectories.size(); const int dirCount = m_svnDirectories.size();
for (int i = 0; i < dirCount; i++) { for (int i = 0; i < dirCount; i++) {
const QDir svnDir(directory.absoluteFilePath(m_svnDirectories.at(i))); const QDir svnDir(directory.absoluteFilePath(m_svnDirectories.at(i)));
if (!svnDir.exists()) if (!svnDir.exists())
continue; continue;
if (!fileName.isEmpty() && !svnDir.exists(fileName)) if (!svnDir.exists(QLatin1String("wc.db")))
continue; continue;
return true; return true;
} }
......
...@@ -152,7 +152,7 @@ private: ...@@ -152,7 +152,7 @@ private:
bool enableAnnotationContextMenu = false); bool enableAnnotationContextMenu = false);
void svnStatus(const QString &workingDir, const QString &relativePath = QString()); void svnStatus(const QString &workingDir, const QString &relativePath = QString());
void svnUpdate(const QString &workingDir, const QString &relativePath = QString()); void svnUpdate(const QString &workingDir, const QString &relativePath = QString());
bool checkSVNSubDir(const QDir &directory, const QString &fileName = QString()) const; bool checkSVNSubDir(const QDir &directory) const;
void startCommit(const QString &workingDir, const QStringList &files = QStringList()); void startCommit(const QString &workingDir, const QStringList &files = QStringList());
inline SubversionControl *subVersionControl() const; inline SubversionControl *subVersionControl() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment