biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / version-management / rapidsvn / fix-build.patch
blobca4bc394c2c6c2f7311b339c7250d238f3495f5c
1 --- a/src/svncpp/client_ls.cpp
2 +++ b/src/svncpp/client_ls.cpp
3 @@ -25,6 +25,7 @@
4 #include "svn_client.h"
5 #include "svn_path.h"
6 #include "svn_sorts.h"
7 +#include "svn_version.h"
8 //#include "svn_utf.h"
10 // svncpp
11 @@ -35,6 +36,7 @@
12 #include "m_is_empty.hpp"
15 +#if SVN_VER_MAJOR == 1 && SVN_VER_MINOR < 8
16 static int
17 compare_items_as_paths(const svn_sort__item_t *a, const svn_sort__item_t *b)
19 @@ -84,6 +86,72 @@ namespace svn
23 +#else
25 +#include <algorithm>
27 +static svn_error_t* store_entry(
28 + void *baton,
29 + const char *path,
30 + const svn_dirent_t *dirent,
31 + const svn_lock_t *,
32 + const char *abs_path,
33 + const char *,
34 + const char *,
35 + apr_pool_t *scratch_pool)
37 + svn::DirEntries *entries = reinterpret_cast<svn::DirEntries*>(baton);
38 + if (path[0] == '\0') {
39 + if (dirent->kind == svn_node_file) {
40 + // for compatibility with svn_client_ls behaviour, listing a file
41 + // stores that file name
42 + entries->push_back(svn::DirEntry(svn_path_basename(abs_path, scratch_pool), dirent));
43 + }
44 + } else {
45 + entries->push_back(svn::DirEntry(path, dirent));
46 + }
47 + return SVN_NO_ERROR;
50 +static bool sort_by_path(svn::DirEntry const& a, svn::DirEntry const& b)
52 + return svn_path_compare_paths(a.name(), b.name()) < 0;
55 +namespace svn
57 + DirEntries
58 + Client::list(const char * pathOrUrl,
59 + svn_opt_revision_t * revision,
60 + bool recurse) throw(ClientException)
61 + {
62 + Pool pool;
63 + DirEntries entries;
65 + svn_error_t * error =
66 + svn_client_list3(pathOrUrl,
67 + revision,
68 + revision,
69 + SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse),
70 + SVN_DIRENT_ALL,
71 + FALSE, // fetch locks
72 + FALSE, // include externals
73 + &store_entry,
74 + &entries,
75 + *m_context,
76 + pool);
78 + if (error != SVN_NO_ERROR)
79 + throw ClientException(error);
81 + std::sort(entries.begin(), entries.end(), &sort_by_path);
83 + return entries;
84 + }
87 +#endif
89 /* -----------------------------------------------------------------
90 * local variables:
91 * eval: (load-file "../../rapidsvn-dev.el")
92 --- a/src/svncpp/dirent.cpp 2017-03-19 15:48:58.956827337 +0100
93 +++ b/src/svncpp/dirent.cpp 2017-03-19 15:50:19.111527279 +0100
94 @@ -47,7 +47,7 @@
98 - Data(const char * _name, svn_dirent_t * dirEntry)
99 + Data(const char * _name, const svn_dirent_t * dirEntry)
100 : name(_name), kind(dirEntry->kind), size(dirEntry->size),
101 hasProps(dirEntry->has_props != 0),
102 createdRev(dirEntry->created_rev), time(dirEntry->time)
103 @@ -78,7 +78,7 @@
107 - DirEntry::DirEntry(const char * name, svn_dirent_t * DirEntry)
108 + DirEntry::DirEntry(const char * name, const svn_dirent_t * DirEntry)
109 : m(new Data(name, DirEntry))
112 --- a/include/svncpp/dirent.hpp 2017-03-19 15:50:54.860506116 +0100
113 +++ b/include/svncpp/dirent.hpp 2017-03-19 15:50:58.314407598 +0100
114 @@ -41,7 +41,7 @@
116 * constructor for existing @a svn_dirent_t entries
118 - DirEntry(const char * name, svn_dirent_t * dirEntry);
119 + DirEntry(const char * name, const svn_dirent_t * dirEntry);
122 * copy constructor