Skip to content

Commit 5caa913

Browse files
TobiXtnyblom
authored andcommitted
Allow compiling against SVN 1.8. (#22)
1 parent 437beb4 commit 5caa913

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/svn.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <svn_pools.h>
4343
#include <svn_repos.h>
4444
#include <svn_types.h>
45+
#include <svn_version.h>
4546

4647
#include <QFile>
4748
#include <QDebug>
@@ -51,6 +52,10 @@
5152
#undef SVN_ERR
5253
#define SVN_ERR(expr) SVN_INT_ERR(expr)
5354

55+
#if SVN_VER_MAJOR == 1 && SVN_VER_MINOR < 9
56+
#define svn_stream_read_full svn_stream_read
57+
#endif
58+
5459
typedef QList<Rules::Match> MatchRuleList;
5560
typedef QHash<QString, Repository *> RepositoryHash;
5661
typedef QHash<QByteArray, QByteArray> IdentityHash;
@@ -174,7 +179,11 @@ int SvnPrivate::openRepository(const QString &pathToRepository)
174179
QString path = pathToRepository;
175180
while (path.endsWith('/')) // no trailing slash allowed
176181
path = path.mid(0, path.length()-1);
182+
#if SVN_VER_MAJOR == 1 && SVN_VER_MINOR < 9
183+
SVN_ERR(svn_repos_open2(&repos, QFile::encodeName(path), NULL, global_pool));
184+
#else
177185
SVN_ERR(svn_repos_open3(&repos, QFile::encodeName(path), NULL, global_pool, scratch_pool));
186+
#endif
178187
fs = svn_repos_fs(repos);
179188

180189
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)