Author: stsp
Date: Thu Nov 24 09:49:51 2011
New Revision: 1205769
URL: http://svn.apache.org/viewvc?rev=1205769&view=rev
Log:
On the moves-scan-log branch, add a constructor for svn_wc_repos_move_info_t.
* subversion/include/svn_wc.h
(svn_wc_repos_move_info_t): Note that API users should not allocate
objects of this type directly.
(svn_wc_create_repos_move_info): Declare.
* subversion/libsvn_wc/util.c
(svn_wc_create_repos_move_info): New.
* subversion/libsvn_client/update.c
(scan_moves_log_receiver): Use the new constructor instead of apr_palloc().
Modified:
subversion/branches/moves-scan-log/subversion/include/svn_wc.h
subversion/branches/moves-scan-log/subversion/libsvn_client/update.c
subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c
Modified: subversion/branches/moves-scan-log/subversion/include/svn_wc.h
URL:
http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/include/svn_wc.h?rev=1205769&r1=1205768&r2=1205769&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/include/svn_wc.h (original)
+++ subversion/branches/moves-scan-log/subversion/include/svn_wc.h Thu Nov 24
09:49:51 2011
@@ -1716,8 +1716,25 @@ typedef struct svn_wc_repos_move_info_t
* within interesting history. */
struct svn_wc_repos_move_info_t *prev;
struct svn_wc_repos_move_info_t *next;
+
+ /* @note Fields may be added to the end of this structure in future
+ * versions. Therefore, to preserve binary compatibility, users
+ * should not directly allocate structures of this type but should use
+ * svn_wc_create_repos_move_info(). */
} svn_wc_repos_move_info_t;
+/** Create a svn_wc_repos_move_info_t structure.
+ * @see svn_wc_repos_move_info_t
+ * @since New in 1.8. */
+svn_wc_repos_move_info_t *
+svn_wc_create_repos_move_info(const char *moved_from_repos_relpath,
+ const char *moved_to_repos_relpath,
+ svn_revnum_t revision,
+ svn_revnum_t copyfrom_rev,
+ svn_wc_repos_move_info_t *prev,
+ svn_wc_repos_move_info_t *next,
+ apr_pool_t *result_pool);
+
/** A struct that describes a conflict that has occurred in the
* working copy.
Modified: subversion/branches/moves-scan-log/subversion/libsvn_client/update.c
URL:
http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_client/update.c?rev=1205769&r1=1205768&r2=1205769&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_client/update.c
(original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_client/update.c Thu
Nov 24 09:49:51 2011
@@ -400,17 +400,13 @@ scan_moves_log_receiver(void *baton,
* "copy from the past + delete". */
/* Remember details of this move. */
- new_move = apr_palloc(result_pool, sizeof(*new_move));
- new_move->moved_from_repos_relpath = apr_pstrdup(
- result_pool,
- deleted_path);
- new_move->moved_to_repos_relpath = apr_pstrdup(
- result_pool,
- copy->copyto_path);
- new_move->revision = log_entry->revision;
- new_move->copyfrom_rev = copy->copyfrom_rev;
- new_move->prev = NULL;
- new_move->next = NULL;
+ new_move = svn_wc_create_repos_move_info(apr_pstrdup(result_pool,
+ deleted_path),
+ apr_pstrdup(result_pool,
+ copy->copyto_path),
+ log_entry->revision,
+ copy->copyfrom_rev,
+ NULL, NULL, result_pool);
/* Link together multiple moves of the same node. */
prior_move = apr_hash_get(b->moves_by_target_path,
Modified: subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c
URL:
http://svn.apache.org/viewvc/subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c?rev=1205769&r1=1205768&r2=1205769&view=diff
==============================================================================
--- subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/moves-scan-log/subversion/libsvn_wc/util.c Thu Nov 24
09:49:51 2011
@@ -581,3 +581,25 @@ svn_wc__fetch_props_func(apr_hash_t **pr
return SVN_NO_ERROR;
}
+
+
+svn_wc_repos_move_info_t *
+svn_wc_create_repos_move_info(const char *moved_from_repos_relpath,
+ const char *moved_to_repos_relpath,
+ svn_revnum_t revision,
+ svn_revnum_t copyfrom_rev,
+ svn_wc_repos_move_info_t *prev,
+ svn_wc_repos_move_info_t *next,
+ apr_pool_t *result_pool)
+{
+ svn_wc_repos_move_info_t *move = apr_palloc(result_pool, sizeof(*move));
+
+ move->moved_from_repos_relpath = moved_from_repos_relpath;
+ move->moved_to_repos_relpath = moved_to_repos_relpath;
+ move->revision = revision;
+ move->copyfrom_rev = copyfrom_rev;
+ move->prev = prev;
+ move->next = next;
+
+ return move;
+}