subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1717231 - in /subversion/branches/ra-git: build/generator/gen_win_dependencies.py subversion/libsvn_ra_git/ra_plugin.c subversion/libsvn_ra_git/reporter.c
Date Mon, 30 Nov 2015 11:47:42 GMT
Author: rhuijben
Date: Mon Nov 30 11:47:42 2015
New Revision: 1717231

URL: http://svn.apache.org/viewvc?rev=1717231&view=rev
Log:
On the libgit2 branch: Fix compilation and linking against libgit2 0.23
on Windows.

* subversion/libsvn_ra_git/ra_plugin.c
  (split_url): Add argument. Update caller.
  (svn_ra_git__open): Fix prototype. Update caller.
  (svn_ra_git__get_file): Use proper type for filesize.
  
* subversion/libsvn_ra_git/reporter.c
  (compare_files,
   detect_blob_relatedness): Update caller.

* build/generator/gen_win_dependencies.py
  (_find_libgit2): Fix library name.

Modified:
    subversion/branches/ra-git/build/generator/gen_win_dependencies.py
    subversion/branches/ra-git/subversion/libsvn_ra_git/ra_plugin.c
    subversion/branches/ra-git/subversion/libsvn_ra_git/reporter.c

Modified: subversion/branches/ra-git/build/generator/gen_win_dependencies.py
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/build/generator/gen_win_dependencies.py?rev=1717231&r1=1717230&r2=1717231&view=diff
==============================================================================
--- subversion/branches/ra-git/build/generator/gen_win_dependencies.py (original)
+++ subversion/branches/ra-git/build/generator/gen_win_dependencies.py Mon Nov 30 11:47:42
2015
@@ -1376,7 +1376,7 @@ class GenDependenciesBase(gen_base.Gener
       inc_dir = os.path.join(self.libgit2_path, 'include')
       lib_dir = os.path.join(self.libgit2_path, 'lib')
 
-      lib_name = 'libgit2.lib'
+      lib_name = 'git2.lib'
     else:
       if (show_warnings):
         print('WARNING: \'git2/version.h\' not found')
@@ -1407,7 +1407,7 @@ class GenDependenciesBase(gen_base.Gener
       return
 
     self._libraries['libgit2'] = SVNCommonLibrary('libgit2', inc_dir, lib_dir,
-                                                   'libgit2.lib', libgit2_version)
+                                                   lib_name, libgit2_version)
 
   def _find_sqlite(self, show_warnings):
     "Find the Sqlite library and version"

Modified: subversion/branches/ra-git/subversion/libsvn_ra_git/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_git/ra_plugin.c?rev=1717231&r1=1717230&r2=1717231&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_git/ra_plugin.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_git/ra_plugin.c Mon Nov 30 11:47:42 2015
@@ -129,12 +129,13 @@ split_url(const char **remote_url,
           svn_stringbuf_t *fs_path,
           git_repository *repos,
           const char *session_url,
+          git_remote_callbacks *callbacks,
           apr_pool_t *result_pool,
           apr_pool_t *scratch_pool)
 {
   svn_boolean_t found_remote = FALSE;
   svn_stringbuf_t *remote_url_buf;
-  
+
   remote_url_buf = svn_stringbuf_create(make_git_url(session_url), scratch_pool);
   while (!found_remote)
     {
@@ -145,13 +146,12 @@ split_url(const char **remote_url,
 
       /* Create an in-memory remote... */
       git_err = git_remote_create_anonymous(&remote, repos,
-                                            remote_url_buf->data,
-                                            RA_GIT_DEFAULT_REFSPEC);
+                                            remote_url_buf->data);
       if (git_err)
         return svn_error_trace(svn_ra_git__wrap_git_error());
 
       /* ... and try to connect to it. */
-      git_err = git_remote_connect(remote, GIT_DIRECTION_FETCH);
+      git_err = git_remote_connect(remote, GIT_DIRECTION_FETCH, callbacks);
       if (git_err)
         {
           apr_size_t slash_pos;
@@ -866,12 +866,15 @@ svn_ra_git__get_schemes(apr_pool_t *pool
 static svn_error_t *
 svn_ra_git__open(svn_ra_session_t *session,
                  const char **corrected_url,
-                 const char *repos_url,
+                 const char *session_URL,
                  const svn_ra_callbacks2_t *callbacks,
                  void *callback_baton,
+                 svn_auth_baton_t *auth_baton,
                  apr_hash_t *config,
-                 apr_pool_t *pool)
+                 apr_pool_t *result_pool,
+                 apr_pool_t *scratch_pool)
 {
+  apr_pool_t *pool = result_pool;
   const char *client_string;
   svn_ra_git__session_baton_t *sess;
   static volatile svn_atomic_t libgit_initialized = 0;
@@ -913,7 +916,7 @@ svn_ra_git__open(svn_ra_session_t *sessi
   sess->fetch_done = FALSE;
   sess->scratch_pool = svn_pool_create(session->pool);
 
-  sess->session_url = apr_pstrdup(pool, repos_url);
+  sess->session_url = apr_pstrdup(pool, session_URL);
   session->priv = sess;
 
   /* Store the git repository within the working copy's admin area,
@@ -950,11 +953,20 @@ svn_ra_git__open(svn_ra_session_t *sessi
   if (git_err)
     return svn_error_trace(svn_ra_git__wrap_git_error());
 
+
+  remote_callbacks = apr_pcalloc(session->pool, sizeof(*remote_callbacks));
+  remote_callbacks->version = GIT_REMOTE_CALLBACKS_VERSION;
+  remote_callbacks->sideband_progress = remote_sideband_progress_cb;
+  remote_callbacks->transfer_progress = remote_transfer_progress_cb;
+  remote_callbacks->update_tips = remote_update_tips_cb;
+  remote_callbacks->payload = sess;
+
   /* Split the session URL into a git remote URL and, possibly, a path within
    * the repository (in sess->fs_path). */
   svn_pool_clear(sess->scratch_pool);
   SVN_ERR(split_url(&sess->remote_url, sess->fs_path, sess->repos,
-                    sess->session_url, session->pool, sess->scratch_pool));
+                    sess->session_url, remote_callbacks,
+                    session->pool, sess->scratch_pool));
 
   /* Check if our remote already exists. */
   git_err = git_remote_lookup(&sess->remote, sess->repos,
@@ -979,14 +991,6 @@ svn_ra_git__open(svn_ra_session_t *sessi
         return svn_error_trace(svn_ra_git__wrap_git_error());
     }
 
-  remote_callbacks = apr_pcalloc(session->pool, sizeof(*remote_callbacks));
-  remote_callbacks->version = GIT_REMOTE_CALLBACKS_VERSION;
-  remote_callbacks->sideband_progress = remote_sideband_progress_cb;
-  remote_callbacks->transfer_progress = remote_transfer_progress_cb;
-  remote_callbacks->update_tips = remote_update_tips_cb;
-  remote_callbacks->payload = sess;
-  git_remote_set_callbacks(sess->remote, remote_callbacks);
-
   git_err = git_revwalk_new(&sess->revwalk, sess->repos);
   if (git_err)
     return svn_error_trace(svn_ra_git__wrap_git_error());
@@ -2066,7 +2070,7 @@ svn_ra_git__get_file(svn_ra_session_t *s
 
   if (stream)
     {
-      apr_size_t total_size;
+      svn_filesize_t total_size;
       const char *data;
       apr_size_t bytes_copied;
 

Modified: subversion/branches/ra-git/subversion/libsvn_ra_git/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_git/reporter.c?rev=1717231&r1=1717230&r2=1717231&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_git/reporter.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_git/reporter.c Mon Nov 30 11:47:42 2015
@@ -896,7 +896,7 @@ compare_files(svn_boolean_t *changed,
   b.parent_is_repos_root = FALSE; /* can be set to anything for our purposes */
   git_err = git_diff_blobs(blob, svn_relpath_basename(path, NULL),
                            other_blob, svn_relpath_basename(other_path, NULL),
-                           NULL, blob_relatedness_cb, NULL, NULL, &b);
+                           NULL, blob_relatedness_cb, NULL, NULL, NULL, &b);
   if (git_err)
     {
       if (git_err == GIT_EUSER)
@@ -1179,7 +1179,7 @@ detect_blob_relatedness(int *distance, g
     {
       b.parent_is_repos_root = TRUE;
       git_err = git_diff_blobs(blob, "", other_blob, "", NULL,
-                               blob_relatedness_cb, NULL, NULL, &b);
+                               blob_relatedness_cb, NULL, NULL, NULL, &b);
       if (git_err)
         {
           if (git_err == GIT_EUSER)
@@ -1204,7 +1204,7 @@ detect_blob_relatedness(int *distance, g
     return svn_error_trace(svn_ra_git__wrap_git_error());
 
   /* Loop over changes, detect adds/deletes/mods of the blob in question. */
-  git_err = git_diff_foreach(diff, blob_relatedness_cb, NULL, NULL, &b);
+  git_err = git_diff_foreach(diff, blob_relatedness_cb, NULL, NULL, NULL, &b);
   if (git_err)
     {
       if (git_err == GIT_EUSER)



Mime
View raw message