subversion1.9.patch 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. --- rapidsvn-0.12.1/src/svncpp/client_ls.cpp.old 2012-06-28 13:39:33.000000000 +0700
  2. +++ rapidsvn-0.12.1/src/svncpp/client_ls.cpp 2016-01-05 07:13:33.309097969 +0700
  3. @@ -29,6 +29,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"
  9. // svncpp
  10. @@ -37,6 +38,8 @@
  11. #include "svncpp/exception.hpp"
  12. +#if SVN_VER_MAJOR == 1 && SVN_VER_MINOR < 8
  13. +
  14. static int
  15. compare_items_as_paths(const svn_sort__item_t *a, const svn_sort__item_t *b)
  16. {
  17. @@ -90,8 +93,75 @@
  18. }
  19. }
  20. +#else
  21. +
  22. +#include <algorithm>
  23. +
  24. +static svn_error_t* store_entry(
  25. + void *baton,
  26. + const char *path,
  27. + const svn_dirent_t *dirent,
  28. + const svn_lock_t *,
  29. + const char *abs_path,
  30. + const char *,
  31. + const char *,
  32. + apr_pool_t *scratch_pool)
  33. +{
  34. + svn::DirEntries *entries = reinterpret_cast<svn::DirEntries*>(baton);
  35. + if (path[0] == '\0') {
  36. + if (dirent->kind == svn_node_file) {
  37. + // for compatibility with svn_client_ls behaviour, listing a file
  38. + // stores that file name
  39. + entries->push_back(svn::DirEntry(svn_path_basename(abs_path, scratch_pool), dirent));
  40. + }
  41. + } else {
  42. + entries->push_back(svn::DirEntry(path, dirent));
  43. + }
  44. + return SVN_NO_ERROR;
  45. +}
  46. +
  47. +static bool sort_by_path(svn::DirEntry const& a, svn::DirEntry const& b)
  48. +{
  49. + return svn_path_compare_paths(a.name(), b.name()) < 0;
  50. +}
  51. +
  52. +namespace svn
  53. +{
  54. + DirEntries
  55. + Client::list(const char * pathOrUrl,
  56. + svn_opt_revision_t * revision,
  57. + bool recurse) throw(ClientException)
  58. + {
  59. + Pool pool;
  60. + DirEntries entries;
  61. +
  62. + svn_error_t * error =
  63. + svn_client_list3(pathOrUrl,
  64. + revision,
  65. + revision,
  66. + SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse),
  67. + SVN_DIRENT_ALL,
  68. + FALSE, // fetch locks
  69. + FALSE, // include externals
  70. + &store_entry,
  71. + &entries,
  72. + *m_context,
  73. + pool);
  74. +
  75. + if (error != SVN_NO_ERROR)
  76. + throw ClientException(error);
  77. +
  78. + std::sort(entries.begin(), entries.end(), &sort_by_path);
  79. +
  80. + return entries;
  81. + }
  82. +}
  83. +
  84. +#endif
  85. +
  86. /* -----------------------------------------------------------------
  87. * local variables:
  88. * eval: (load-file "../../rapidsvn-dev.el")
  89. * end:
  90. */
  91. +
  92. 50c50
  93. < Data(const char * _name, svn_dirent_t * dirEntry)
  94. ---
  95. > Data(const char * _name, const svn_dirent_t * dirEntry)
  96. 81c81
  97. < DirEntry::DirEntry(const char * name, svn_dirent_t * DirEntry)
  98. ---
  99. > DirEntry::DirEntry(const char * name, const svn_dirent_t * DirEntry)
  100. 153a154
  101. >
  102. --- rapidsvn-0.12.1/include/svncpp/dirent.hpp.old 2012-06-28 13:39:20.000000000 +0700
  103. +++ rapidsvn-0.12.1/include/svncpp/dirent.hpp 2016-01-05 07:11:10.337456433 +0700
  104. @@ -41,7 +41,7 @@
  105. /**
  106. * constructor for existing @a svn_dirent_t entries
  107. */
  108. - DirEntry(const char * name, svn_dirent_t * dirEntry);
  109. + DirEntry(const char * name, const svn_dirent_t * dirEntry);
  110. /**
  111. * copy constructor
  112. @@ -91,3 +91,4 @@
  113. * eval: (load-file "../../rapidsvn-dev.el")
  114. * end:
  115. */
  116. +
  117. --- rapidsvn-0.12.1/src/svncpp/dirent.cpp.old 2016-01-05 07:22:32.647100607 +0700
  118. +++ rapidsvn-0.12.1/src/svncpp/dirent.cpp 2016-01-05 07:23:15.778197025 +0700
  119. @@ -47,7 +47,7 @@
  120. {
  121. }
  122. - Data(const char * _name, svn_dirent_t * dirEntry)
  123. + Data(const char * _name, const svn_dirent_t * dirEntry)
  124. : name(_name), kind(dirEntry->kind), size(dirEntry->size),
  125. hasProps(dirEntry->has_props != 0),
  126. createdRev(dirEntry->created_rev), time(dirEntry->time)
  127. @@ -78,7 +78,7 @@
  128. {
  129. }
  130. - DirEntry::DirEntry(const char * name, svn_dirent_t * DirEntry)
  131. + DirEntry::DirEntry(const char * name, const svn_dirent_t * DirEntry)
  132. : m(new Data(name, DirEntry))
  133. {
  134. }