You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/05/07 16:03:24 UTC
svn commit: r1678213 - in /subversion/branches/move-tracking-2/subversion:
include/private/svn_branch.h libsvn_delta/branch.c libsvn_delta/compat3e.c
libsvn_ra/ra_loader.c
Author: julianfoad
Date: Thu May 7 14:03:24 2015
New Revision: 1678213
URL: http://svn.apache.org/r1678213
Log:
On the 'move-tracking-2' branch: Track the base revision number for a
branching transaction. We do not yet make use of this.
* subversion/include/private/svn_branch.h,
subversion/libsvn_delta/branch.c
(svn_branch_revision_root_t,
svn_branch_revision_root_create): Add a base revision number field.
(svn_branch_revision_root_parse): Initialize the base revision number.
* subversion/libsvn_delta/compat3e.c
(drive_changes_branch): Use the stored base revision number instead of
assuming it is the head revision.
* subversion/libsvn_ra/ra_loader.c
(svn_branch_get_mutable_state): Set both the revision and the base revision
numbers appropriately for a transaction. (Previously even the existing
revision number field was not being changed to indicate a transaction.)
Modified:
subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h
subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c
subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h?rev=1678213&r1=1678212&r2=1678213&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_branch.h Thu May 7 14:03:24 2015
@@ -132,6 +132,10 @@ typedef struct svn_branch_revision_root_
/* If committed, the revision number; else SVN_INVALID_REVNUM. */
svn_revnum_t rev;
+ /* If committed, the previous revision number, else the revision number
+ on which this transaction is based. */
+ svn_revnum_t base_rev;
+
/* The range of element ids assigned. */
int first_eid, next_eid;
@@ -147,6 +151,7 @@ typedef struct svn_branch_revision_root_
svn_branch_revision_root_t *
svn_branch_revision_root_create(svn_branch_repos_t *repos,
svn_revnum_t rev,
+ svn_revnum_t base_rev,
struct svn_branch_state_t *root_branch,
apr_pool_t *result_pool);
Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c?rev=1678213&r1=1678212&r2=1678213&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Thu May 7 14:03:24 2015
@@ -69,6 +69,7 @@ svn_branch_repos_create(apr_pool_t *resu
svn_branch_revision_root_t *
svn_branch_revision_root_create(svn_branch_repos_t *repos,
svn_revnum_t rev,
+ svn_revnum_t base_rev,
struct svn_branch_state_t *root_branch,
apr_pool_t *result_pool)
{
@@ -77,6 +78,7 @@ svn_branch_revision_root_create(svn_bran
rev_root->repos = repos;
rev_root->rev = rev;
+ rev_root->base_rev = base_rev;
rev_root->root_branch = root_branch;
rev_root->branches = svn_array_make(result_pool);
return rev_root;
@@ -1066,7 +1068,8 @@ svn_branch_revision_root_parse(svn_branc
&num_branches);
SVN_ERR_ASSERT(n == 4);
- rev_root = svn_branch_revision_root_create(repos, rev, NULL /*root_branch*/,
+ rev_root = svn_branch_revision_root_create(repos, rev, rev - 1,
+ NULL /*root_branch*/,
result_pool);
rev_root->first_eid = first_eid;
rev_root->next_eid = next_eid;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c?rev=1678213&r1=1678212&r2=1678213&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Thu May 7 14:03:24 2015
@@ -1499,7 +1499,7 @@ drive_changes_branch(ev3_from_delta_bato
svn_pathrev_t current = { -1, "" };
/* ### For now, assume based on youngest known rev. */
- current.rev = eb->edited_rev_root->repos->rev_roots->nelts - 1;
+ current.rev = eb->edited_rev_root->base_rev;
SVN_ERR(drive_changes_r("", ¤t,
paths_final, eb, scratch_pool));
}
Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c?rev=1678213&r1=1678212&r2=1678213&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c Thu May 7 14:03:24 2015
@@ -757,7 +757,7 @@ svn_branch_repos_fetch_info(svn_branch_r
return SVN_NO_ERROR;
}
-/* Return a mutable state for the youngest revision in REPOS.
+/* Return a mutable state based on revision BASE_REVISION in REPOS.
*/
static svn_error_t *
svn_branch_get_mutable_state(svn_branch_revision_root_t **rev_root_p,
@@ -774,6 +774,8 @@ svn_branch_get_mutable_state(svn_branch_
repos, ra_session, branch_info_dir,
base_revision,
result_pool, scratch_pool));
+ (*rev_root_p)->base_rev = (*rev_root_p)->rev;
+ (*rev_root_p)->rev = SVN_INVALID_REVNUM;
return SVN_NO_ERROR;
}