You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2014/10/28 02:26:23 UTC

git commit: Added support for both 1.8 and earlier versions of svn library.

Repository: mesos
Updated Branches:
  refs/heads/master 17ecc0c0c -> b2d8df780


Added support for both 1.8 and earlier versions of svn library.

Review: https://reviews.apache.org/r/27243


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b2d8df78
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b2d8df78
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b2d8df78

Branch: refs/heads/master
Commit: b2d8df780098322de63caad1d7b70e5cf21e4083
Parents: 17ecc0c
Author: Timothy Chen <tn...@apache.org>
Authored: Mon Oct 27 17:59:38 2014 -0700
Committer: Timothy Chen <tn...@gmail.com>
Committed: Mon Oct 27 18:00:07 2014 -0700

----------------------------------------------------------------------
 .../3rdparty/stout/include/stout/svn.hpp        | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b2d8df78/3rdparty/libprocess/3rdparty/stout/include/stout/svn.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/svn.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/svn.hpp
index 117ab0a..441141f 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/svn.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/svn.hpp
@@ -21,6 +21,7 @@
 #include <svn_delta.h>
 #include <svn_error.h>
 #include <svn_pools.h>
+#include <svn_version.h>
 
 #include <string>
 
@@ -90,12 +91,21 @@ inline Try<Diff> diff(const std::string& from, const std::string& to)
   target.len = to.length();
 
   svn_txdelta_stream_t* delta;
+
+#if SVN_VER_MAJOR >= 1 && SVN_VER_MINOR >= 8
   svn_txdelta2(
       &delta,
       svn_stream_from_string(&source, pool),
       svn_stream_from_string(&target, pool),
       false,
       pool);
+#else
+  svn_txdelta(
+      &delta,
+      svn_stream_from_string(&source, pool),
+      svn_stream_from_string(&target, pool),
+      pool);
+#endif
 
   // Now we want to convert this text delta stream into an svndiff
   // format based diff. Setup the handler that will consume the text
@@ -104,6 +114,7 @@ inline Try<Diff> diff(const std::string& from, const std::string& to)
   void* baton = NULL;
   svn_stringbuf_t* diff = svn_stringbuf_create_ensure(1024, pool);
 
+#if SVN_VER_MAJOR >= 1 && SVN_VER_MINOR >= 7
   svn_txdelta_to_svndiff3(
       &handler,
       &baton,
@@ -111,6 +122,20 @@ inline Try<Diff> diff(const std::string& from, const std::string& to)
       0,
       SVN_DELTA_COMPRESSION_LEVEL_DEFAULT,
       pool);
+#elif SVN_VER_MAJOR >= 1 && SVN_VER_MINOR >= 4
+  svn_txdelta_to_svndiff2(
+      &handler,
+      &baton,
+      svn_stream_from_stringbuf(diff, pool),
+      0,
+      pool);
+#else
+  svn_txdelta_to_svndiff(
+      svn_stream_from_stringbuf(diff, pool),
+      pool,
+      &handler,
+      &baton);
+#endif
 
   // Now feed the text delta to the handler.
   svn_error_t* error = svn_txdelta_send_txstream(delta, handler, baton, pool);