@@ -62,9 +62,13 @@ class AprAutoPool
62
62
AprAutoPool &operator =(const AprAutoPool &);
63
63
public:
64
64
inline AprAutoPool (apr_pool_t *parent = NULL )
65
- { pool = svn_pool_create (parent); }
66
- inline ~AprAutoPool ()
67
- { svn_pool_destroy (pool); }
65
+ {
66
+ pool = svn_pool_create (parent);
67
+ }
68
+ inline ~AprAutoPool ()
69
+ {
70
+ svn_pool_destroy (pool);
71
+ }
68
72
69
73
inline void clear () { svn_pool_clear (pool); }
70
74
inline apr_pool_t *data () const { return pool; }
@@ -88,6 +92,7 @@ class SvnPrivate
88
92
89
93
private:
90
94
AprAutoPool global_pool;
95
+ AprAutoPool scratch_pool;
91
96
svn_fs_t *fs;
92
97
svn_revnum_t youngest_rev;
93
98
};
@@ -145,7 +150,7 @@ bool Svn::exportRevision(int revnum)
145
150
}
146
151
147
152
SvnPrivate::SvnPrivate (const QString &pathToRepository)
148
- : global_pool(NULL )
153
+ : global_pool(NULL ) , scratch_pool( NULL )
149
154
{
150
155
if ( openRepository (pathToRepository) != EXIT_SUCCESS) {
151
156
qCritical () << " Failed to open repository" ;
@@ -156,10 +161,7 @@ SvnPrivate::SvnPrivate(const QString &pathToRepository)
156
161
svn_fs_youngest_rev (&youngest_rev, fs, global_pool);
157
162
}
158
163
159
- SvnPrivate::~SvnPrivate ()
160
- {
161
- svn_pool_destroy (global_pool);
162
- }
164
+ SvnPrivate::~SvnPrivate () {}
163
165
164
166
int SvnPrivate::youngestRevision ()
165
167
{
@@ -172,7 +174,7 @@ int SvnPrivate::openRepository(const QString &pathToRepository)
172
174
QString path = pathToRepository;
173
175
while (path.endsWith (' /' )) // no trailing slash allowed
174
176
path = path.mid (0 , path.length ()-1 );
175
- SVN_ERR (svn_repos_open (&repos, QFile::encodeName (path), global_pool));
177
+ SVN_ERR (svn_repos_open3 (&repos, QFile::encodeName (path), NULL , global_pool, scratch_pool ));
176
178
fs = svn_repos_fs (repos);
177
179
178
180
return EXIT_SUCCESS;
@@ -297,7 +299,7 @@ static int dumpBlob(Repository::Transaction *txn, svn_fs_root_t *fs_root,
297
299
if (!CommandLineParser::instance ()->contains (" dry-run" )) {
298
300
QByteArray buf;
299
301
buf.reserve (len);
300
- SVN_ERR (svn_stream_read (in_stream, buf.data (), &len));
302
+ SVN_ERR (svn_stream_read_full (in_stream, buf.data (), &len));
301
303
if (len == strlen (" link " ) && strncmp (buf, " link " , len) == 0 ) {
302
304
mode = 0120000 ;
303
305
stream_length -= len;
@@ -316,9 +318,7 @@ static int dumpBlob(Repository::Transaction *txn, svn_fs_root_t *fs_root,
316
318
if (!CommandLineParser::instance ()->contains (" dry-run" )) {
317
319
// open a generic svn_stream_t for the QIODevice
318
320
out_stream = streamForDevice (io, dumppool);
319
- SVN_ERR (svn_stream_copy (in_stream, out_stream, dumppool));
320
- svn_stream_close (out_stream);
321
- svn_stream_close (in_stream);
321
+ SVN_ERR (svn_stream_copy3 (in_stream, out_stream, NULL , NULL , dumppool));
322
322
323
323
// print an ending newline
324
324
io->putChar (' \n ' );
@@ -430,15 +430,15 @@ class SvnRevision
430
430
int fetchRevProps ();
431
431
int commit ();
432
432
433
- int exportEntry (const char *path, const svn_fs_path_change_t *change, apr_hash_t *changes);
434
- int exportDispatch (const char *path, const svn_fs_path_change_t *change,
433
+ int exportEntry (const char *path, const svn_fs_path_change2_t *change, apr_hash_t *changes);
434
+ int exportDispatch (const char *path, const svn_fs_path_change2_t *change,
435
435
const char *path_from, svn_revnum_t rev_from,
436
436
apr_hash_t *changes, const QString ¤t, const Rules::Match &rule,
437
437
const MatchRuleList &matchRules, apr_pool_t *pool);
438
- int exportInternal (const char *path, const svn_fs_path_change_t *change,
438
+ int exportInternal (const char *path, const svn_fs_path_change2_t *change,
439
439
const char *path_from, svn_revnum_t rev_from,
440
440
const QString ¤t, const Rules::Match &rule, const MatchRuleList &matchRules);
441
- int recurse (const char *path, const svn_fs_path_change_t *change,
441
+ int recurse (const char *path, const svn_fs_path_change2_t *change,
442
442
const char *path_from, const MatchRuleList &matchRules, svn_revnum_t rev_from,
443
443
apr_hash_t *changes, apr_pool_t *pool);
444
444
};
@@ -477,15 +477,15 @@ int SvnRevision::prepareTransactions()
477
477
{
478
478
// find out what was changed in this revision:
479
479
apr_hash_t *changes;
480
- SVN_ERR (svn_fs_paths_changed (&changes, fs_root, pool));
480
+ SVN_ERR (svn_fs_paths_changed2 (&changes, fs_root, pool));
481
481
482
- QMap<QByteArray, svn_fs_path_change_t *> map;
482
+ QMap<QByteArray, svn_fs_path_change2_t *> map;
483
483
for (apr_hash_index_t *i = apr_hash_first (pool, changes); i; i = apr_hash_next (i)) {
484
484
const void *vkey;
485
485
void *value;
486
486
apr_hash_this (i, &vkey, NULL , &value);
487
487
const char *key = reinterpret_cast <const char *>(vkey);
488
- svn_fs_path_change_t *change = reinterpret_cast <svn_fs_path_change_t *>(value);
488
+ svn_fs_path_change2_t *change = reinterpret_cast <svn_fs_path_change2_t *>(value);
489
489
// If we mix path deletions with path adds/replaces we might erase a
490
490
// branch after that it has been reset -> history truncated
491
491
if (map.contains (QByteArray (key))) {
@@ -502,7 +502,7 @@ int SvnRevision::prepareTransactions()
502
502
map.insertMulti (QByteArray (key), change);
503
503
}
504
504
505
- QMapIterator<QByteArray, svn_fs_path_change_t *> i (map);
505
+ QMapIterator<QByteArray, svn_fs_path_change2_t *> i (map);
506
506
while (i.hasNext ()) {
507
507
i.next ();
508
508
if (exportEntry (i.key (), i.value (), changes) == EXIT_FAILURE)
@@ -561,7 +561,7 @@ int SvnRevision::commit()
561
561
return EXIT_SUCCESS;
562
562
}
563
563
564
- int SvnRevision::exportEntry (const char *key, const svn_fs_path_change_t *change,
564
+ int SvnRevision::exportEntry (const char *key, const svn_fs_path_change2_t *change,
565
565
apr_hash_t *changes)
566
566
{
567
567
AprAutoPool revpool (pool.data ());
@@ -647,7 +647,7 @@ int SvnRevision::exportEntry(const char *key, const svn_fs_path_change_t *change
647
647
return EXIT_SUCCESS;
648
648
}
649
649
650
- int SvnRevision::exportDispatch (const char *key, const svn_fs_path_change_t *change,
650
+ int SvnRevision::exportDispatch (const char *key, const svn_fs_path_change2_t *change,
651
651
const char *path_from, svn_revnum_t rev_from,
652
652
apr_hash_t *changes, const QString ¤t,
653
653
const Rules::Match &rule, const MatchRuleList &matchRules, apr_pool_t *pool)
@@ -685,7 +685,7 @@ int SvnRevision::exportDispatch(const char *key, const svn_fs_path_change_t *cha
685
685
return EXIT_FAILURE;
686
686
}
687
687
688
- int SvnRevision::exportInternal (const char *key, const svn_fs_path_change_t *change,
688
+ int SvnRevision::exportInternal (const char *key, const svn_fs_path_change2_t *change,
689
689
const char *path_from, svn_revnum_t rev_from,
690
690
const QString ¤t, const Rules::Match &rule, const MatchRuleList &matchRules)
691
691
{
@@ -837,7 +837,7 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
837
837
return EXIT_SUCCESS;
838
838
}
839
839
840
- int SvnRevision::recurse (const char *path, const svn_fs_path_change_t *change,
840
+ int SvnRevision::recurse (const char *path, const svn_fs_path_change2_t *change,
841
841
const char *path_from, const MatchRuleList &matchRules, svn_revnum_t rev_from,
842
842
apr_hash_t *changes, apr_pool_t *pool)
843
843
{
@@ -882,8 +882,8 @@ int SvnRevision::recurse(const char *path, const svn_fs_path_change_t *change,
882
882
entryFrom = path_from + QByteArray (" /" ) + i.key ();
883
883
884
884
// check if this entry is in the changelist for this revision already
885
- svn_fs_path_change_t *otherchange =
886
- (svn_fs_path_change_t *)apr_hash_get (changes, entry.constData (), APR_HASH_KEY_STRING);
885
+ svn_fs_path_change2_t *otherchange =
886
+ (svn_fs_path_change2_t *)apr_hash_get (changes, entry.constData (), APR_HASH_KEY_STRING);
887
887
if (otherchange && otherchange->change_kind == svn_fs_path_change_add) {
888
888
qDebug () << entry << " rev" << revnum
889
889
<< " is in the change-list, deferring to that one" ;
0 commit comments