subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1717775 - in /subversion/branches/ra-git/subversion/libsvn_ra_git: fetch.c ra_git.h session.c
Date Thu, 03 Dec 2015 14:40:54 GMT
Author: rhuijben
Date: Thu Dec  3 14:40:54 2015
New Revision: 1717775

URL: http://svn.apache.org/viewvc?rev=1717775&view=rev
Log:
On the ra-git branch: Fix some compilation issues introduced when cleaning
up the libsvn_ra_git revamp patch. Remove some dead code.

* subversion/libsvn_ra_git/ra_git.h
  (svn_ra_git__ensure_local_session): Remove function.

* subversion/libsvn_ra_git/fetch.c
  (do_update_head): Remove function.
  (svn_ra_git__git_fetch): Update caller.
  (cleanup_temporary_repos): Remove function.

* subversion/libsvn_ra_git/session.c
  (ensure_local_session): Make static.
  (ra_git_ensure_local_session): Rename to...
  (ensure_local_session): ... this and make static.
  (*): Update caller.
  (svn_ra_git_init): Rename to...
  (svn_ra_git__init): ... this to avoid collision with macro generated
    version of this function.

Modified:
    subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c
    subversion/branches/ra-git/subversion/libsvn_ra_git/ra_git.h
    subversion/branches/ra-git/subversion/libsvn_ra_git/session.c

Modified: subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c?rev=1717775&r1=1717774&r2=1717775&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_git/fetch.c Thu Dec  3 14:40:54 2015
@@ -233,70 +233,6 @@ svn_ra_git__split_url(const char **repos
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *
-do_update_head(svn_ra_session_t *session,
-               apr_pool_t *scratch_pool)
-{
-#if 0
-  int error = 0;
-  size_t refs_len;
-  git_refspec *refspec;
-  const git_remote_head *remote_head, **refs;
-  const git_oid *remote_head_id;
-  git_buf remote_master_name = GIT_BUF_INIT;
-  git_buf branch = GIT_BUF_INIT;
-
-  if ((error = git_remote_ls(&refs, &refs_len, remote)) < 0)
-    return error;
-
-  /* We cloned an empty repository or one with an unborn HEAD */
-  if (refs_len == 0 || strcmp(refs[0]->name, GIT_HEAD_FILE))
-    return setup_tracking_config(
-      repo, "master", GIT_REMOTE_ORIGIN, GIT_REFS_HEADS_MASTER_FILE);
-
-  /* We know we have HEAD, let's see where it points */
-  remote_head = refs[0];
-  assert(remote_head);
-
-  remote_head_id = &remote_head->oid;
-
-  error = git_remote_default_branch(&branch, remote);
-  if (error == GIT_ENOTFOUND) {
-    error = git_repository_set_head_detached(
-      repo, remote_head_id);
-    goto cleanup;
-  }
-
-  refspec = git_remote__matching_refspec(remote, git_buf_cstr(&branch));
-
-  if (refspec == NULL) {
-    giterr_set(GITERR_NET, "the remote's default branch does not fit the refspec configuration");
-    error = GIT_EINVALIDSPEC;
-    goto cleanup;
-  }
-
-  /* Determine the remote tracking reference name from the local master */
-  if ((error = git_refspec_transform(
-    &remote_master_name,
-    refspec,
-    git_buf_cstr(&branch))) < 0)
-    goto cleanup;
-
-  error = update_head_to_new_branch(
-    repo,
-    remote_head_id,
-    git_buf_cstr(&branch),
-    reflog_message);
-
-cleanup:
-  git_buf_free(&remote_master_name);
-  git_buf_free(&branch);
-
-  return error;
-#endif
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_ra_git__git_fetch(svn_ra_session_t *session,
                       svn_boolean_t refresh,
@@ -335,8 +271,6 @@ svn_ra_git__git_fetch(svn_ra_session_t *
 
   sess->fetch_done = TRUE;
 
-  SVN_ERR(do_update_head(session, scratch_pool));
-
   /* This makes svn_fs_git() add new revisions to the mapping system */
   SVN_ERR(svn_repos_recover4(sess->local_repos_abspath, FALSE,
                              NULL, NULL,
@@ -400,22 +334,6 @@ get_username(const char **username,
 }
 
 /*----------------------------------------------------------------*/
-
-static apr_status_t
-cleanup_temporary_repos(void *data)
-{
-  svn_ra_session_t *session = data;
-  svn_ra_git__session_t *sess = session->priv;
-
-  svn_error_clear(svn_io_remove_dir2(sess->local_repos_abspath, TRUE,
-                                     session->cancel_func,
-                                     session->cancel_baton,
-                                     session->pool));
-
-  return APR_SUCCESS;
-}
-
-/*----------------------------------------------------------------*/
 /* git remote callbacks - Wrapped into Subversion like wrapper to
                           allow using normal apis */
 

Modified: subversion/branches/ra-git/subversion/libsvn_ra_git/ra_git.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_git/ra_git.h?rev=1717775&r1=1717774&r2=1717775&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_git/ra_git.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_git/ra_git.h Thu Dec  3 14:40:54 2015
@@ -108,10 +108,6 @@ svn_ra_git__split_url(const char **repos
                       apr_pool_t *scratch_pool);
 
 svn_error_t *
-svn_ra_git__ensure_local_session(svn_ra_session_t *session,
-                                 apr_pool_t *scratch_pool);
-
-svn_error_t *
 svn_ra_git__git_fetch(svn_ra_session_t *session,
                       svn_boolean_t refresh,
                       apr_pool_t *scratch_pool);

Modified: subversion/branches/ra-git/subversion/libsvn_ra_git/session.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_ra_git/session.c?rev=1717775&r1=1717774&r2=1717775&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_ra_git/session.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_ra_git/session.c Thu Dec  3 14:40:54 2015
@@ -194,9 +194,9 @@ ra_git_set_svn_ra_open(svn_ra_session_t
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-ra_git_ensure_local_session(svn_ra_session_t *session,
-                            apr_pool_t *scratch_pool)
+static svn_error_t *
+ensure_local_session(svn_ra_session_t *session,
+                     apr_pool_t *scratch_pool)
 {
   svn_ra_git__session_t *sess = session->priv;
 
@@ -317,7 +317,7 @@ ra_git_get_latest_revnum(svn_ra_session_
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, pool));
+  SVN_ERR(ensure_local_session(session, pool));
 
   return svn_error_trace(
     svn_ra_get_latest_revnum(sess->local_session, latest_revnum, pool));
@@ -335,7 +335,7 @@ ra_git_get_file_revs(svn_ra_session_t *s
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, pool));
+  SVN_ERR(ensure_local_session(session, pool));
 
   return svn_error_trace(
     svn_ra_get_file_revs2(sess->local_session, path, start, end,
@@ -351,7 +351,7 @@ ra_git_get_dated_revision(svn_ra_session
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, pool));
+  SVN_ERR(ensure_local_session(session, pool));
 
   return svn_error_trace(
     svn_ra_get_dated_revision(sess->local_session, revision, tm, pool));
@@ -367,7 +367,7 @@ ra_git_change_rev_prop(svn_ra_session_t
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, pool));
+  SVN_ERR(ensure_local_session(session, pool));
 
   return svn_error_trace(
     svn_ra_change_rev_prop2(sess->local_session, rev, name, old_value_p,
@@ -404,7 +404,7 @@ ra_git_rev_proplist(svn_ra_session_t *se
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, pool));
+  SVN_ERR(ensure_local_session(session, pool));
 
   return svn_error_trace(
     svn_ra_rev_proplist(sess->local_session, rev, props, pool));
@@ -419,7 +419,7 @@ ra_git_rev_prop(svn_ra_session_t *sessio
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, pool));
+  SVN_ERR(ensure_local_session(session, pool));
 
   return svn_error_trace(
     svn_ra_rev_prop(sess->local_session, rev, name, value, pool));
@@ -451,7 +451,7 @@ ra_git_get_mergeinfo(svn_ra_session_t *s
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, pool));
+  SVN_ERR(ensure_local_session(session, pool));
 
   return svn_error_trace(
     svn_ra_get_mergeinfo(sess->local_session, catalog, paths, revision,
@@ -475,7 +475,7 @@ ra_git_do_update(svn_ra_session_t *sessi
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, scratch_pool));
+  SVN_ERR(ensure_local_session(session, scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, scratch_pool));
 
   return svn_error_trace(
@@ -505,7 +505,7 @@ ra_git_do_switch(svn_ra_session_t *sessi
 {
   svn_ra_git__session_t *sess = session->priv;
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, scratch_pool));
+  SVN_ERR(ensure_local_session(session, scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, scratch_pool));
 
   return svn_error_trace(
@@ -534,7 +534,7 @@ ra_git_do_status(svn_ra_session_t *sessi
 
   svn_pool_clear(sess->scratch_pool);
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -563,7 +563,7 @@ ra_git_do_diff(svn_ra_session_t *session
 
   svn_pool_clear(sess->scratch_pool);
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, TRUE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -592,7 +592,7 @@ ra_git_get_log(svn_ra_session_t *session
 
   svn_pool_clear(sess->scratch_pool);
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -613,7 +613,7 @@ ra_git_do_check_path(svn_ra_session_t *s
 
   svn_pool_clear(sess->scratch_pool);
 
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
 
   /* ### TODO: Check if we can use the branch name cache for easy result */
 
@@ -632,7 +632,7 @@ ra_git_stat(svn_ra_session_t *session,
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -652,7 +652,7 @@ ra_git_get_file(svn_ra_session_t *sessio
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -674,7 +674,7 @@ ra_git_get_dir(svn_ra_session_t *session
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -694,7 +694,7 @@ ra_git_get_locations(svn_ra_session_t *s
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -716,7 +716,7 @@ ra_git_get_location_segments(svn_ra_sess
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -737,7 +737,7 @@ ra_git_lock(svn_ra_session_t *session,
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
 
   return svn_error_trace(
     svn_ra_lock(sess->local_session, path_revs, comment, steal_lock, lock_func,
@@ -756,7 +756,7 @@ ra_git_unlock(svn_ra_session_t *session,
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
 
   return svn_error_trace(
     svn_ra_unlock(sess->local_session, path_tokens, break_lock,
@@ -772,7 +772,7 @@ ra_git_get_lock(svn_ra_session_t *sessio
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
 
   return svn_error_trace(
     svn_ra_get_lock(sess->local_session, lock, path, pool));
@@ -788,7 +788,7 @@ ra_git_get_locks(svn_ra_session_t *sessi
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
 
   return svn_error_trace(
     svn_ra_get_locks2(sess->local_session, locks, path, depth, pool));
@@ -807,7 +807,7 @@ ra_git_replay(svn_ra_session_t *session,
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -830,7 +830,7 @@ ra_git_replay_range(svn_ra_session_t *se
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -849,7 +849,7 @@ ra_git_has_capability(svn_ra_session_t *
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
 
   if (strcmp(capability, SVN_RA_CAPABILITY_COMMIT_REVPROPS) == 0
       || strcmp(capability, SVN_RA_CAPABILITY_ATOMIC_REVPROPS) == 0
@@ -875,7 +875,7 @@ ra_git_get_deleted_rev(svn_ra_session_t
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -895,7 +895,7 @@ ra_git_get_inherited_props(svn_ra_sessio
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
   SVN_ERR(svn_ra_git__git_fetch(session, FALSE, sess->scratch_pool));
 
   return svn_error_trace(
@@ -910,7 +910,7 @@ ra_git_register_editor_shim_callbacks(sv
   svn_ra_git__session_t *sess = session->priv;
 
   svn_pool_clear(sess->scratch_pool);
-  SVN_ERR(svn_ra_git__ensure_local_session(session, sess->scratch_pool));
+  SVN_ERR(ensure_local_session(session, sess->scratch_pool));
 
   return svn_error_trace(
     svn_ra__register_editor_shim_callbacks(sess->local_session, callbacks));
@@ -979,9 +979,9 @@ static const svn_ra__vtable_t ra_git_vta
 /** The One Public Routine, called by libsvn_ra **/
 
 svn_error_t *
-svn_ra_git_init(const svn_version_t *loader_version,
-                const svn_ra__vtable_t **vtable,
-                apr_pool_t *pool)
+svn_ra_git__init(const svn_version_t *loader_version,
+                 const svn_ra__vtable_t **vtable,
+                 apr_pool_t *pool)
 {
   static const svn_version_checklist_t checklist[] =
   {



Mime
View raw message