Author: julianfoad
Date: Tue Apr 14 17:33:19 2015
New Revision: 1673476
URL: http://svn.apache.org/r1673476
Log:
On the 'move-tracking-2' branch: Stop using different branch families. All
branches are now members of the same family.
* subversion/include/private/svn_branch.h
(svn_branch_repos_t,
svn_branch_family_t,
svn_branch_family_create
svn_branch_revision_root_parse,
svn_branch_revision_root_serialize): Remove FID and family-nesting
facilities.
(svn_branch_family_add_new_subfamily): Delete.
(svn_branch_sibling_t,
svn_branch_instance_t,
svn_branch_subtree_t,
svn_branch_copy_subtree_r,
svn_branch_branch_into): Adjust comments.
* subversion/libsvn_delta/branch.c
Adjust everything.
* subversion/libsvn_delta/compat3e.c
(same_family_and_element): Adjust.
* subversion/libsvn_delta/editor3e.c
(BRANCHES_IN_SAME_FAMILY): Delete.
(svn_branch_subtree_differences): Adjust.
* subversion/libsvn_ra/ra_loader.c
(default_repos_info): Adjust.
(svn_branch_revision_fetch_info,
svn_branch_repos_fetch_info,
svn_branch_get_mutable_state,
store_repos_info): Remove FID and family-nesting facilities.
* subversion/svnmover/svnmover.c
Adjust everything.
* subversion/tests/cmdline/svnmover_tests.py
(reported_br_diff,
reported_br_del,
reported_br_add): Remove 'family' parameter.
Adjust tests and commentary accordingly.
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_delta/editor3e.c
subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py
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=1673476&r1=1673475&r2=1673476&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
Tue Apr 14 17:33:19 2015
@@ -46,7 +46,7 @@ extern "C" {
/* ### */
#define SVN_ERR_BRANCHING 123456
-/** Element Identifier within a branch family.
+/** Element Identifier.
*
* This does not contain an implied revision number or branch identifier.
*/
@@ -62,15 +62,11 @@ typedef struct svn_branch_instance_t svn
*/
typedef struct svn_branch_repos_t
{
- /* The range of family ids assigned within this repos (starts at 0). */
- int next_fid;
-
/* Array of (svn_branch_revision_info_t *), indexed by revision number. */
apr_array_header_t *rev_roots;
- /* Hash of (int *fid -> svn_branch_family_t *), of all the branch family
- objects. */
- apr_hash_t *families;
+ /* The branch family object. */
+ struct svn_branch_family_t *family;
/* The pool in which this object lives. */
apr_pool_t *pool;
@@ -134,13 +130,6 @@ typedef struct svn_branch_family_t
/* The repository in which this family exists. */
svn_branch_repos_t *repos;
- /* The outer family of which this is a sub-family. NULL if this is the
- root family. */
- /*struct svn_branch_family_t *outer_family;*/
-
- /* The FID of this family within its repository. */
- int fid;
-
/* --- Contents of this object --- */
/* The branch siblings in this family. */
@@ -152,9 +141,6 @@ typedef struct svn_branch_family_t
/* The range of element ids assigned within this family. */
int first_eid, next_eid;
- /* The immediate sub-family of this family, or NULL if none. */
- struct svn_branch_family_t *subfamily;
-
/* The pool in which this object lives. */
apr_pool_t *pool;
} svn_branch_family_t;
@@ -162,7 +148,6 @@ typedef struct svn_branch_family_t
/* Create a new branch family object */
svn_branch_family_t *
svn_branch_family_create(svn_branch_repos_t *repos,
- int fid,
int first_bsid,
int next_bsid,
int first_eid,
@@ -184,11 +169,6 @@ svn_branch_family_get_branch_instances(
int
svn_branch_family_add_new_element(svn_branch_family_t *family);
-/* Create a new, empty family in OUTER_FAMILY.
- */
-svn_branch_family_t *
-svn_branch_family_add_new_subfamily(svn_branch_family_t *outer_family);
-
/* Add a new branch sibling definition to FAMILY, with root element id
* ROOT_EID.
*/
@@ -196,38 +176,32 @@ svn_branch_sibling_t *
svn_branch_family_add_new_branch_sibling(svn_branch_family_t *family,
int root_eid);
-/* A branch.
+/* A branch sibling definition.
*
- * A branch sibling object describes the characteristics of a branch
- * in a given family with a given BSID. This sibling is common to each
- * branch that has this same family and BSID: there can be one such instance
- * within each branch of its outer families.
+ * A branch sibling definition describes characteristics that may be
+ * shared by more than one branch.
*
- * Often, all branches in a family have the same root element. For example,
+ * Often, branches have the same root element. For example,
* branching /trunk to /branches/br1 results in:
*
- * family 1, branch 1, root-EID 100
+ * branch 1: BSID=1 (root-EID=100)
* EID 100 => /trunk
* ...
- * family 1, branch 2, root-EID 100
+ * branch 2: BSID=1 (root-EID=100)
* EID 100 => /branches/br1
* ...
*
* However, the root element of one branch may correspond to a non-root
- * element of another branch; such a branch could be called a "subtree
- * branch". Using the same example, branching from the trunk subtree
+ * element of another branch.
+ *
+ * Continuing the same example, branching from the trunk subtree
* /trunk/D (which is not itself a branch root) results in:
*
- * family 1, branch 3: root-EID = 104
+ * branch 3: BSID=2 (root-EID=104)
* EID 100 => (nil)
* ...
* EID 104 => /branches/branch-of-trunk-subtree-D
* ...
- *
- * If family 1 were nested inside an outer family, then there could be
- * multiple branch-instances for each branch-sibling. In the above
- * example, all instances of (family 1, branch 1) will have root-EID 100,
- * and all instances of (family 1, branch 3) will have root-EID 104.
*/
struct svn_branch_sibling_t
{
@@ -236,15 +210,15 @@ struct svn_branch_sibling_t
/* The family of which this branch is a member. */
svn_branch_family_t *family;
- /* The BSID of this branch within its family. */
+ /* The BSID of this branch. */
int bsid;
- /* The EID, within the outer family, of the branch root element. */
- /*int outer_family_eid_of_branch_root;*/
+ /* The EID, within the outer branch, of the branch root element. */
+ /*int outer_eid_of_branch_root;*/
/* --- Contents of this object --- */
- /* The EID within its family of its pathwise root element. */
+ /* The EID of its pathwise root element. */
int root_eid;
};
@@ -257,8 +231,7 @@ svn_branch_sibling_create(svn_branch_fam
/* A branch instance.
*
- * A branch instance object describes one branch in this family. (There is
- * one instance of this branch within each branch of its outer families.)
+ * A branch instance object describes one version of one branch.
*/
struct svn_branch_instance_t
{
@@ -270,12 +243,12 @@ struct svn_branch_instance_t
/* The revision to which this branch-revision-instance belongs */
svn_branch_revision_root_t *rev_root;
- /* The branch instance within the outer family that contains the
+ /* The outer branch instance that contains the subbranch
root element of this branch. Null if this is the root branch. */
struct svn_branch_instance_t *outer_branch;
- /* The element in OUTER_BRANCH of the root of this branch, or -1
- * if this is the root branch. */
+ /* The subbranch-root element in OUTER_BRANCH of the root of this branch.
+ * -1 if this is the root branch. */
int outer_eid;
/* --- Contents of this object --- */
@@ -420,8 +393,9 @@ svn_branch_el_rev_content_equal(const sv
* E_MAP may also contain entries that are not part of the subtree. Thus,
* to select a sub-subtree, it is only necessary to change ROOT_EID.
*
- * The EIDs used in here are in effect stand-alone, in their own name-space,
- * although they may actually be copied from the originating branch family.
+ * The EIDs used in here may be considered either as global EIDs (known to
+ * the repo), or as local stand-alone EIDs (in their own local name-space),
+ * according to the context.
*/
typedef struct svn_branch_subtree_t
{
@@ -583,8 +557,7 @@ svn_branch_map_add_subtree(svn_branch_in
* If FROM_EL_REV is the root of a subbranch and/or contains nested
* subbranches, also copy them ...
* ### What shall we do with a subbranch? Make plain copies of its raw
- * elements; make a subbranch by branching the source subbranch in
- * cases where possible; make a subbranch in a new family?
+ * elements; make a subbranch by branching the source subbranch?
*
* TO_PARENT_EID must be a directory element in TO_BRANCH, and TO_NAME a
* non-existing path in it.
@@ -676,7 +649,6 @@ svn_branch_find_nested_branch_element_by
*/
svn_error_t *
svn_branch_revision_root_parse(svn_branch_revision_root_t **rev_root_p,
- int *next_fid_p,
svn_branch_repos_t *repos,
svn_stream_t *stream,
apr_pool_t *result_pool,
@@ -687,7 +659,6 @@ svn_branch_revision_root_parse(svn_branc
svn_error_t *
svn_branch_revision_root_serialize(svn_stream_t *stream,
svn_branch_revision_root_t *rev_root,
- int next_fid,
apr_pool_t *scratch_pool);
/* Branch the subtree of FROM_BRANCH found at FROM_EID, to create
@@ -707,7 +678,6 @@ svn_branch_branch(svn_branch_instance_t
/* Branch the subtree of FROM_BRANCH found at FROM_EID, to appear
* in the existing branch TO_BRANCH at TO_PARENT_EID:NEW_NAME.
*
- * FROM_BRANCH must be in the same family as TO_BRANCH.
* No element of FROM_BRANCH:FROM_EID may already exist in TO_BRANCH.
* (### Or, perhaps, elements that already exist should be altered?)
*/
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=1673476&r1=1673475&r2=1673476&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c Tue
Apr 14 17:33:19 2015
@@ -46,10 +46,6 @@
#define BRANCH_FAMILY_HAS_ELEMENT(branch, eid) \
FAMILY_HAS_ELEMENT((branch)->sibling_defn->family, (eid))
-#define BRANCHES_IN_SAME_FAMILY(branch1, branch2) \
- ((branch1)->sibling_defn->family->fid \
- == (branch2)->sibling_defn->family->fid)
-
#define IS_BRANCH_ROOT_EID(branch, eid) \
((eid) == (branch)->sibling_defn->root_eid)
@@ -71,33 +67,10 @@ svn_branch_repos_create(apr_pool_t *resu
svn_branch_repos_t *repos = apr_pcalloc(result_pool, sizeof(*repos));
repos->rev_roots = svn_array_make(result_pool);
- repos->families = apr_hash_make(result_pool);
repos->pool = result_pool;
return repos;
}
-/* Find the existing family with id FID in REPOS.
- *
- * Return NULL if not found.
- *
- * Note: An FID is unique among all families.
- */
-static svn_branch_family_t *
-repos_get_family_by_id(svn_branch_repos_t *repos,
- int fid)
-{
- return svn_int_hash_get(repos->families, fid);
-}
-
-/* Register FAMILY in REPOS.
- */
-static void
-repos_register_family(svn_branch_repos_t *repos,
- svn_branch_family_t *family)
-{
- svn_int_hash_set(repos->families, family->fid, family);
-}
-
svn_branch_revision_root_t *
svn_branch_revision_root_create(svn_branch_repos_t *repos,
svn_revnum_t rev,
@@ -125,7 +98,6 @@ assert_branch_family_invariants(const sv
svn_branch_family_t *
svn_branch_family_create(svn_branch_repos_t *repos,
- int fid,
int first_bsid,
int next_bsid,
int first_eid,
@@ -134,10 +106,8 @@ svn_branch_family_create(svn_branch_repo
{
svn_branch_family_t *f = apr_pcalloc(result_pool, sizeof(*f));
- f->fid = fid;
f->repos = repos;
f->branch_siblings = svn_array_make(result_pool);
- f->subfamily = NULL;
f->first_bsid = first_bsid;
f->next_bsid = next_bsid;
f->first_eid = first_eid;
@@ -156,39 +126,6 @@ svn_branch_family_add_new_element(svn_br
return eid;
}
-#ifdef SVN_DEBUG
-/* If defined, branch-sibling-ids and element-ids start from 10x and 100x
- * the family-id for easier debugging; else they always start from zero. */
-#define PRETTY_IDS
-#endif
-
-svn_branch_family_t *
-svn_branch_family_add_new_subfamily(svn_branch_family_t *outer_family)
-{
- svn_branch_repos_t *repos = outer_family->repos;
- int fid = repos->next_fid++;
-#ifdef PRETTY_IDS
- int first_bsid = fid * 10;
- int first_eid = fid * 100;
-#else
- int first_bsid = 0;
- int first_eid = 0;
-#endif
- svn_branch_family_t *family
- = svn_branch_family_create(repos, fid,
- first_bsid, first_bsid,
- first_eid, first_eid,
- outer_family->pool);
-
- /* Register the family */
- repos_register_family(repos, family);
- outer_family->subfamily = family;
-
- assert_branch_family_invariants(outer_family);
- assert_branch_family_invariants(family);
- return family;
-}
-
/* Create a new branch sibling in FAMILY, with branch sibling id BSID and
* root element ROOT_EID, and register it as a member of the family.
*/
@@ -314,13 +251,11 @@ assert_branch_instance_invariants(const
if (branch->outer_branch)
{
assert(branch->outer_eid != -1);
- assert(FAMILY_HAS_ELEMENT(branch->outer_branch->sibling_defn->family,
branch->outer_eid));
- /* TODO: outer branch's family is parent of this branch's family */
+ assert(BRANCH_FAMILY_HAS_ELEMENT(branch, branch->outer_eid));
}
else
{
assert(branch->outer_eid == -1);
- assert(branch->sibling_defn->family->fid == 0);
}
assert(branch->e_map);
}
@@ -513,7 +448,7 @@ svn_branch_map_update(svn_branch_instanc
= svn_branch_el_rev_content_create(new_parent_eid, new_name, new_content,
map_pool);
- /* EID must be a valid element id of the branch family */
+ /* EID must be a valid element id */
SVN_ERR_ASSERT_NO_RETURN(BRANCH_FAMILY_HAS_ELEMENT(branch, eid));
/* NEW_CONTENT must be specified, either in full or by reference */
SVN_ERR_ASSERT_NO_RETURN(new_content);
@@ -536,7 +471,7 @@ svn_branch_map_update_as_subbranch_root(
= svn_branch_el_rev_content_create(new_parent_eid, new_name, NULL
/*content*/,
map_pool);
- /* EID must be a valid element id of the branch family */
+ /* EID must be a valid element id */
SVN_ERR_ASSERT_NO_RETURN(BRANCH_FAMILY_HAS_ELEMENT(branch, eid));
branch_map_node_validate(branch, eid, node);
@@ -797,8 +732,6 @@ svn_branch_instantiate_subtree(svn_branc
apr_hash_index_t *hi;
svn_branch_el_rev_content_t *new_root_content;
- /*SVN_ERR_ASSERT(SAME_FAMILY(to_branch...family, new_subtree...family));*/
-
/* Instantiate the root element of NEW_SUBTREE */
new_root_content = svn_int_hash_get(new_subtree.e_map, new_subtree.root_eid);
if (new_root_content->content)
@@ -833,7 +766,6 @@ svn_branch_get_subbranches(const svn_bra
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- svn_branch_family_t *family = branch->sibling_defn->family;
const char *top_rrpath = svn_branch_get_rrpath_by_eid(branch, eid,
scratch_pool);
svn_array_t *subbranches = svn_array_make(result_pool);
@@ -841,12 +773,12 @@ svn_branch_get_subbranches(const svn_bra
for (SVN_ARRAY_ITER(bi, branch->rev_root->branch_instances, scratch_pool))
{
- svn_branch_family_t *sub_branch_family = bi->val->sibling_defn->family;
+ svn_branch_instance_t *subbranch = bi->val;
const char *sub_branch_root_rrpath
- = svn_branch_get_root_rrpath(bi->val, bi->iterpool);
+ = svn_branch_get_root_rrpath(subbranch, bi->iterpool);
/* Is it an immediate child at or below EID? */
- if (sub_branch_family == family->subfamily
+ if (subbranch->outer_branch == branch
&& svn_relpath_skip_ancestor(top_rrpath, sub_branch_root_rrpath))
SVN_ARRAY_PUSH(subbranches) = bi->val;
}
@@ -965,7 +897,7 @@ svn_branch_instance_parse(svn_branch_ins
svn_stringbuf_t *line;
svn_boolean_t eof;
int n;
- int fid, bsid, root_eid;
+ int bsid, root_eid;
svn_branch_sibling_t *branch_sibling;
svn_branch_instance_t *branch_instance;
char branch_root_path[100];
@@ -976,11 +908,10 @@ svn_branch_instance_parse(svn_branch_ins
SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
SVN_ERR_ASSERT(! eof);
- n = sscanf(line->data, "f%db%d: root-eid %d at %s\n",
- &fid, &bsid, &root_eid, branch_root_path);
- SVN_ERR_ASSERT(n == 4);
+ n = sscanf(line->data, "b%d: root-eid %d at %s\n",
+ &bsid, &root_eid, branch_root_path);
+ SVN_ERR_ASSERT(n == 3);
- SVN_ERR_ASSERT(fid == family->fid);
branch_root_rrpath
= strcmp(branch_root_path, ".") == 0 ? "" : branch_root_path;
branch_sibling = family_find_or_create_branch_sibling(family, bsid,
root_eid);
@@ -1003,15 +934,15 @@ svn_branch_instance_parse(svn_branch_ins
/* Read in the structure, leaving the content of each element as null */
for (eid = family->first_eid; eid < family->next_eid; eid++)
{
- int this_fid, this_bsid, this_eid, this_parent_eid;
+ int this_bsid, this_eid, this_parent_eid;
char this_name[20];
SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
SVN_ERR_ASSERT(! eof);
- n = sscanf(line->data, "f%db%de%d: %d %20s\n",
- &this_fid, &this_bsid, &this_eid,
+ n = sscanf(line->data, "b%de%d: %d %20s\n",
+ &this_bsid, &this_eid,
&this_parent_eid, this_name);
- SVN_ERR_ASSERT(n == 5);
+ SVN_ERR_ASSERT(n == 4);
if (strcmp(this_name, "(null)") != 0)
{
const char *name = strcmp(this_name, ".") == 0 ? "" : this_name;
@@ -1060,7 +991,6 @@ svn_branch_instance_parse(svn_branch_ins
*/
static svn_error_t *
svn_branch_family_parse(svn_branch_family_t **new_family,
- int *parent_fid,
int *num_branch_instances,
svn_branch_repos_t *repos,
svn_stream_t *stream,
@@ -1069,19 +999,18 @@ svn_branch_family_parse(svn_branch_famil
svn_stringbuf_t *line;
svn_boolean_t eof;
int n;
- int fid, first_bsid, next_bsid, first_eid, next_eid;
+ int first_bsid, next_bsid, first_eid, next_eid;
svn_branch_family_t *family;
SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
SVN_ERR_ASSERT(!eof);
- n = sscanf(line->data, "f%d: bsids %d %d eids %d %d "
- "parent-fid %d b-instances %d\n",
- &fid,
+ n = sscanf(line->data, "family: bsids %d %d eids %d %d "
+ "b-instances %d\n",
&first_bsid, &next_bsid, &first_eid, &next_eid,
- parent_fid, num_branch_instances);
- SVN_ERR_ASSERT(n == 7);
+ num_branch_instances);
+ SVN_ERR_ASSERT(n == 5);
- family = repos_get_family_by_id(repos, fid);
+ family = repos->family;
if (family)
{
SVN_ERR_ASSERT(first_bsid == family->first_bsid);
@@ -1093,21 +1022,13 @@ svn_branch_family_parse(svn_branch_famil
}
else
{
- family = svn_branch_family_create(repos, fid,
+ family = svn_branch_family_create(repos,
first_bsid, next_bsid,
first_eid, next_eid,
repos->pool);
- /* Register this family in the repos and in its parent family (if any) */
- repos_register_family(repos, family);
- if (*parent_fid >= 0)
- {
- svn_branch_family_t *parent_family
- = repos_get_family_by_id(repos, *parent_fid);
-
- SVN_ERR_ASSERT(parent_family);
- parent_family->subfamily = family;
- }
+ /* Register this family in the repos */
+ repos->family = family;
}
*new_family = family;
@@ -1116,7 +1037,6 @@ svn_branch_family_parse(svn_branch_famil
svn_error_t *
svn_branch_revision_root_parse(svn_branch_revision_root_t **rev_root_p,
- int *next_fid_p,
svn_branch_repos_t *repos,
svn_stream_t *stream,
apr_pool_t *result_pool,
@@ -1124,29 +1044,27 @@ svn_branch_revision_root_parse(svn_branc
{
svn_branch_revision_root_t *rev_root;
svn_revnum_t rev;
- int root_fid;
svn_stringbuf_t *line;
svn_boolean_t eof;
- int n, i;
+ int n;
SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
SVN_ERR_ASSERT(! eof);
- n = sscanf(line->data, "r%ld: fids %*d %d root-fid %d",
- &rev, /* 0, */ next_fid_p, &root_fid);
- SVN_ERR_ASSERT(n == 3);
+ n = sscanf(line->data, "r%ld:",
+ &rev);
+ SVN_ERR_ASSERT(n == 1);
rev_root = svn_branch_revision_root_create(repos, rev, NULL /*root_branch*/,
result_pool);
- /* parse the families */
- for (i = 0; i < *next_fid_p; i++)
+ /* parse the family */
{
svn_branch_family_t *family;
- int parent_fid, num_branch_instances;
+ int num_branch_instances;
int j;
SVN_ERR(svn_branch_family_parse(&family,
- &parent_fid, &num_branch_instances,
+ &num_branch_instances,
repos, stream,
scratch_pool));
@@ -1157,10 +1075,12 @@ svn_branch_revision_root_parse(svn_branc
SVN_ERR(svn_branch_instance_parse(&branch, family, rev_root, stream,
family->pool, scratch_pool));
- SVN_ARRAY_PUSH(branch->rev_root->branch_instances) = branch;
- if (family->fid == root_fid)
+ SVN_ARRAY_PUSH(rev_root->branch_instances) = branch;
+
+ /* Note the revision-root branch */
+ if (! branch->outer_branch)
{
- branch->rev_root->root_branch = branch;
+ rev_root->root_branch = branch;
}
}
}
@@ -1182,8 +1102,8 @@ svn_branch_instance_serialize(svn_stream
int eid;
SVN_ERR(svn_stream_printf(stream, scratch_pool,
- "f%db%d: root-eid %d at %s\n",
- family->fid, branch->sibling_defn->bsid,
+ "b%d: root-eid %d at %s\n",
+ branch->sibling_defn->bsid,
branch->sibling_defn->root_eid,
branch_root_rrpath[0] ? branch_root_rrpath : "."));
@@ -1212,21 +1132,19 @@ svn_branch_instance_serialize(svn_stream
path = "(null)";
}
SVN_ERR(svn_stream_printf(stream, scratch_pool,
- "f%db%de%d: %d %s\n",
- family->fid, branch->sibling_defn->bsid, eid,
+ "b%de%d: %d %s\n",
+ branch->sibling_defn->bsid, eid,
parent_eid, name));
}
return SVN_NO_ERROR;
}
-/* Write to STREAM a parseable representation of FAMILY whose parent
- * family id is PARENT_FID. Recursively write all sub-families.
+/* Write to STREAM a parseable representation of FAMILY.
*/
static svn_error_t *
svn_branch_family_serialize(svn_stream_t *stream,
svn_branch_revision_root_t *rev_root,
svn_branch_family_t *family,
- int parent_fid,
apr_pool_t *scratch_pool)
{
svn_array_t *branch_instances = svn_array_make(scratch_pool);
@@ -1237,39 +1155,29 @@ svn_branch_family_serialize(svn_stream_t
SVN_ARRAY_PUSH(branch_instances) = bi->val;
SVN_ERR(svn_stream_printf(stream, scratch_pool,
- "f%d: bsids %d %d eids %d %d "
- "parent-fid %d b-instances %d\n",
- family->fid,
+ "family: bsids %d %d eids %d %d "
+ "b-instances %d\n",
family->first_bsid, family->next_bsid,
family->first_eid, family->next_eid,
- parent_fid,
branch_instances->nelts));
for (SVN_ARRAY_ITER(bi, branch_instances, scratch_pool))
SVN_ERR(svn_branch_instance_serialize(stream, bi->val, bi->iterpool));
-
- if (family->subfamily)
- SVN_ERR(svn_branch_family_serialize(stream, rev_root,
- family->subfamily, family->fid,
- scratch_pool));
return SVN_NO_ERROR;
}
svn_error_t *
svn_branch_revision_root_serialize(svn_stream_t *stream,
svn_branch_revision_root_t *rev_root,
- int next_fid,
apr_pool_t *scratch_pool)
{
SVN_ERR(svn_stream_printf(stream, scratch_pool,
- "r%ld: fids %d %d root-fid %d\n",
- rev_root->rev,
- 0, next_fid,
- rev_root->root_branch->sibling_defn->family->fid));
+ "r%ld:\n",
+ rev_root->rev));
SVN_ERR(svn_branch_family_serialize(
stream, rev_root, rev_root->root_branch->sibling_defn->family,
- -1 /*parent_fid*/, scratch_pool));
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -1396,21 +1304,6 @@ svn_branch_branch_subtree_r(svn_branch_i
from_branch->sibling_defn->bsid, from_eid);
}
- /* FROM_BRANCH must be an immediate child branch of TO_OUTER_BRANCH. */
- if (! BRANCH_IS_CHILD_OF_BRANCH(from_branch, to_outer_branch, scratch_pool))
- {
- return svn_error_createf(
- SVN_ERR_BRANCHING, NULL,
- _("The source branch %s is within outer branch %s; the target "
- "branch must be within the same outer branch, but the "
- "specified target is within outer branch %s"),
- svn_branch_instance_get_id(from_branch, scratch_pool),
- from_branch->outer_branch
- ? svn_branch_instance_get_id(from_branch->outer_branch,
scratch_pool)
- : "(none)",
- svn_branch_instance_get_id(to_outer_branch, scratch_pool));
- }
-
/* assign new eid to root node (outer branch) */
to_outer_eid
= svn_branch_family_add_new_element(to_outer_branch->sibling_defn->family);
@@ -1445,12 +1338,6 @@ svn_branch_branch_subtree_r2(svn_branch_
= svn_branch_map_get_subtree(from_branch, from_eid, scratch_pool);
svn_branch_instance_t *new_branch;
- /* When creating a new branch-sibling in same outer branch, TO_OUTER_BRANCH
- is the parent of FROM_BRANCH. When instantiating the same branch-sibling
- into a different outer-branch, TO_OUTER_BRANCH is in the same family as
- the parent of FROM_BRANCH. We require only the latter. */
- SVN_ERR_ASSERT(BRANCHES_IN_SAME_FAMILY(from_branch->outer_branch,
to_outer_branch));
-
/* create new inner branch instance */
new_branch = svn_branch_add_new_branch_instance(to_outer_branch,
to_outer_eid,
new_branch_def,
scratch_pool);
@@ -1522,17 +1409,6 @@ svn_branch_branch_into(svn_branch_instan
from_branch->sibling_defn->bsid, from_eid);
}
- /* FROM_BRANCH must be in the same family as TO_BRANCH. */
- if (! BRANCHES_IN_SAME_FAMILY(from_branch, to_branch))
- {
- return svn_error_createf(
- SVN_ERR_BRANCHING, NULL,
- _("The source branch %s and target branch %s must be within "
- "the same family"),
- svn_branch_instance_get_id(from_branch, scratch_pool),
- svn_branch_instance_get_id(to_branch, scratch_pool));
- }
-
/* Populate the new branch mapping */
SVN_ERR(svn_branch_instantiate_subtree(to_branch, to_parent_eid, new_name,
from_subtree, scratch_pool));
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=1673476&r1=1673475&r2=1673476&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Tue
Apr 14 17:33:19 2015
@@ -1159,16 +1159,12 @@ get_immediate_children_names(apr_hash_t
return children;
}
-/* Return true iff EL_REV1 and EL_REV2 identify the same branch-family
- * and element.
+/* Return true iff EL_REV1 and EL_REV2 identify the same element.
*/
static svn_boolean_t
same_family_and_element(const svn_branch_el_rev_id_t *el_rev1,
const svn_branch_el_rev_id_t *el_rev2)
{
- if (el_rev1->branch->sibling_defn->family->fid
- != el_rev2->branch->sibling_defn->family->fid)
- return FALSE;
if (el_rev1->eid != el_rev2->eid)
return FALSE;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c
URL:
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c?rev=1673476&r1=1673475&r2=1673476&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/editor3e.c Tue
Apr 14 17:33:19 2015
@@ -642,10 +642,6 @@ svn_editor3__get_debug_editor(svn_editor
#define BRANCH_FAMILY_HAS_ELEMENT(branch, eid) \
FAMILY_HAS_ELEMENT((branch)->sibling_defn->family, (eid))
-#define BRANCHES_IN_SAME_FAMILY(branch1, branch2) \
- ((branch1)->sibling_defn->family->fid \
- == (branch2)->sibling_defn->family->fid)
-
/* Return the relative path to element EID within SUBTREE.
*
* Assumes the mapping is "complete" (has complete paths to SUBTREE and to
EID).
@@ -690,7 +686,6 @@ svn_branch_subtree_differences(apr_hash_
/*SVN_DBG(("branch_element_differences(b%d r%ld, b%d r%ld, e%d)",
left->branch->sibling->bsid, left->rev,
right->branch->sibling->bsid, right->rev, right->eid));*/
- SVN_ERR_ASSERT(BRANCHES_IN_SAME_FAMILY(left->branch, right->branch));
SVN_ERR_ASSERT(BRANCH_FAMILY_HAS_ELEMENT(left->branch, left->eid));
SVN_ERR_ASSERT(BRANCH_FAMILY_HAS_ELEMENT(left->branch, right->eid));
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=1673476&r1=1673475&r2=1673476&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 Tue
Apr 14 17:33:19 2015
@@ -601,10 +601,10 @@ svn_error_t *svn_ra_rev_prop(svn_ra_sess
/* The default branching metadata for a new repository. */
static const char *default_repos_info
- = "r0: fids 0 1 root-fid 0\n"
- "f0: bsids 0 1 eids 0 1 parent-fid -1 b-instances 1\n"
- "f0b0: root-eid 0 at .\n"
- "f0b0e0: -1 .\n";
+ = "r0:\n"
+ "family: bsids 0 1 eids 0 1 b-instances 1\n"
+ "b0: root-eid 0 at .\n"
+ "b0e0: -1 .\n";
/* Read the branching info string VALUE belonging to revision REVISION.
*/
@@ -685,7 +685,6 @@ write_rev_prop(svn_ra_session_t *ra_sess
*/
static svn_error_t *
svn_branch_revision_fetch_info(svn_branch_revision_root_t **rev_root_p,
- int *next_fid_p,
svn_branch_repos_t *repos,
svn_ra_session_t *ra_session,
const char *branch_info_dir,
@@ -713,7 +712,7 @@ svn_branch_revision_fetch_info(svn_branc
SVN_ERR_ASSERT(value);
stream = svn_stream_from_string(value, scratch_pool);
- SVN_ERR(svn_branch_revision_root_parse(&rev_root, next_fid_p, repos, stream,
+ SVN_ERR(svn_branch_revision_root_parse(&rev_root, repos, stream,
result_pool, scratch_pool));
/* Self-test: writing out the info should produce exactly the same string. */
@@ -721,7 +720,7 @@ svn_branch_revision_fetch_info(svn_branc
svn_stringbuf_t *buf = svn_stringbuf_create_empty(scratch_pool);
stream = svn_stream_from_stringbuf(buf, scratch_pool);
- SVN_ERR(svn_branch_revision_root_serialize(stream, rev_root, *next_fid_p,
+ SVN_ERR(svn_branch_revision_root_serialize(stream, rev_root,
scratch_pool));
SVN_ERR(svn_stream_close(stream));
@@ -750,18 +749,15 @@ svn_branch_repos_fetch_info(svn_branch_r
SVN_ERR(svn_ra_get_latest_revnum(ra_session, &base_revision, scratch_pool));
- repos->next_fid = 0;
for (r = 0; r <= base_revision; r++)
{
svn_branch_revision_root_t *rev_root;
- int next_fid;
- SVN_ERR(svn_branch_revision_fetch_info(&rev_root, &next_fid,
+ SVN_ERR(svn_branch_revision_fetch_info(&rev_root,
repos, ra_session,
branch_info_dir,
r,
result_pool, scratch_pool));
APR_ARRAY_PUSH(repos->rev_roots, void *) = rev_root;
- repos->next_fid = MAX(repos->next_fid, next_fid);
}
*repos_p = repos;
@@ -779,11 +775,9 @@ svn_branch_get_mutable_state(svn_branch_
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- int next_fid;
-
SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(base_revision));
- SVN_ERR(svn_branch_revision_fetch_info(rev_root_p, &next_fid,
+ SVN_ERR(svn_branch_revision_fetch_info(rev_root_p,
repos, ra_session, branch_info_dir,
base_revision,
result_pool, scratch_pool));
@@ -799,12 +793,10 @@ store_repos_info(svn_branch_revision_roo
const char *branch_info_dir,
apr_pool_t *scratch_pool)
{
- svn_branch_repos_t *repos = rev_root->repos;
svn_stringbuf_t *buf = svn_stringbuf_create_empty(scratch_pool);
svn_stream_t *stream = svn_stream_from_stringbuf(buf, scratch_pool);
- SVN_ERR(svn_branch_revision_root_serialize(stream, rev_root, repos->next_fid,
- scratch_pool));
+ SVN_ERR(svn_branch_revision_root_serialize(stream, rev_root, scratch_pool));
SVN_ERR(svn_stream_close(stream));
/*SVN_DBG(("store_repos_info: %s", buf->data));*/
Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL:
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1673476&r1=1673475&r2=1673476&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
(original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Tue Apr
14 17:33:19 2015
@@ -73,10 +73,6 @@ static svn_boolean_t quiet = FALSE;
(strcmp(svn_branch_instance_get_id(branch1, scratch_pool), \
svn_branch_instance_get_id(branch2, scratch_pool)) == 0)
-#define BRANCHES_IN_SAME_FAMILY(branch1, branch2) \
- ((branch1)->sibling_defn->family->fid \
- == (branch2)->sibling_defn->family->fid)
-
/* */
__attribute__((format(printf, 1, 2)))
static void
@@ -262,8 +258,7 @@ static const action_defn_t action_defn[]
"appear at DST in the existing branch that contains DST" NL
"(like merging the creation of the subtree at SRC to DST)"},
{ACTION_MKBRANCH, "mkbranch", 1, "ROOT",
- "make a directory that's the root of a new branch" NL
- "in a new branching family"},
+ "make a directory that's the root of a new subbranch"},
{ACTION_DIFF, "diff", 2, "LEFT RIGHT",
"diff LEFT to RIGHT"},
{ACTION_DIFF_E, "diff-e", 2, "LEFT RIGHT",
@@ -395,13 +390,10 @@ list_branch_elements(svn_branch_instance
}
/* List all branch instances in FAMILY.
- *
- * If RECURSIVE is true, include branches in nested families.
*/
static svn_error_t *
family_list_branch_instances(svn_branch_revision_root_t *rev_root,
svn_branch_family_t *family,
- svn_boolean_t recursive,
svn_boolean_t verbose,
apr_pool_t *scratch_pool)
{
@@ -409,15 +401,13 @@ family_list_branch_instances(svn_branch_
if (verbose)
{
- printf("family %d (BSIDs %d:%d, EIDs %d:%d)\n",
- family->fid,
+ printf("branches (BSIDs %d:%d, EIDs %d:%d)\n",
family->first_bsid, family->next_bsid,
family->first_eid, family->next_eid);
}
else
{
- printf("branches in family %d:\n",
- family->fid);
+ printf("branches:\n");
}
for (SVN_ARRAY_ITER(bi, svn_branch_family_get_branch_instances(
@@ -441,16 +431,6 @@ family_list_branch_instances(svn_branch_
}
}
- if (recursive)
- {
- if (family->subfamily)
- {
- SVN_ERR(family_list_branch_instances(rev_root, family->subfamily,
- recursive,
- verbose, scratch_pool));
- }
- }
-
return SVN_NO_ERROR;
}
@@ -656,21 +636,17 @@ branch_merge_subtree_r(svn_editor3_t *ed
int first_eid, next_eid, eid;
const merge_conflict_policy_t policy = { TRUE, TRUE, TRUE, TRUE, TRUE };
- SVN_ERR_ASSERT(src->branch->sibling_defn->family->fid
- == tgt->branch->sibling_defn->family->fid);
- SVN_ERR_ASSERT(src->branch->sibling_defn->family->fid
- == yca->branch->sibling_defn->family->fid);
SVN_ERR_ASSERT(src->eid == tgt->eid);
SVN_ERR_ASSERT(src->eid == yca->eid);
- SVN_DBG(("merge src: r%2ld f%d b%2d e%3d",
- src->rev, src->branch->sibling_defn->family->fid,
+ SVN_DBG(("merge src: r%2ld b%2d e%3d",
+ src->rev,
src->branch->sibling_defn->bsid, src->eid));
- SVN_DBG(("merge tgt: r%2ld f%d b%2d e%3d",
- tgt->rev, tgt->branch->sibling_defn->family->fid,
+ SVN_DBG(("merge tgt: r%2ld b%2d e%3d",
+ tgt->rev,
tgt->branch->sibling_defn->bsid, tgt->eid));
- SVN_DBG(("merge yca: r%2ld f%d b%2d e%3d",
- yca->rev, yca->branch->sibling_defn->family->fid,
+ SVN_DBG(("merge yca: r%2ld b%2d e%3d",
+ yca->rev,
yca->branch->sibling_defn->bsid, yca->eid));
/*
@@ -805,10 +781,7 @@ branch_merge_subtree_r(svn_editor3_t *ed
*
* If conflicts arise, just fail.
*
- * SRC->BRANCH, TGT->BRANCH and YCA->BRANCH must be in the same family.
- *
- * SRC, TGT and YCA must be existing and corresponding (same EID) elements
- * of the branch family.
+ * SRC, TGT and YCA must be existing and corresponding (same EID) elements.
*
* None of SRC, TGT and YCA is a subbranch root element.
*
@@ -822,15 +795,6 @@ svn_branch_merge(svn_editor3_t *editor,
svn_branch_el_rev_id_t *yca,
apr_pool_t *scratch_pool)
{
- if (src->branch->sibling_defn->family->fid !=
tgt->branch->sibling_defn->family->fid
- || src->branch->sibling_defn->family->fid !=
yca->branch->sibling_defn->family->fid)
- return svn_error_createf(SVN_ERR_BRANCHING, NULL,
- _("Merge branches must all be in same family "
- "(from: f%d, to: f%d, yca: f%d)"),
- src->branch->sibling_defn->family->fid,
- tgt->branch->sibling_defn->family->fid,
- yca->branch->sibling_defn->family->fid);
-
/*SVN_ERR(verify_exists_in_branch(from, scratch_pool));*/
/*SVN_ERR(verify_exists_in_branch(to, scratch_pool));*/
/*SVN_ERR(verify_exists_in_branch(yca, scratch_pool));*/
@@ -861,16 +825,6 @@ svn_branch_diff_e(svn_editor3_t *editor,
int first_eid, next_eid, eid;
svn_boolean_t printed_header = FALSE;
- if (left->branch->sibling_defn->family->fid
- != right->branch->sibling_defn->family->fid)
- {
- return svn_error_createf(SVN_ERR_BRANCHING, NULL,
- _("Left and right side of an element-based diff
"
- "must be in the same branch family "
- "(left: f%d, right: f%d)"),
- left->branch->sibling_defn->family->fid,
- right->branch->sibling_defn->family->fid);
- }
SVN_ERR_ASSERT(left->eid >= 0 && right->eid >= 0);
SVN_ERR(svn_branch_subtree_differences(&diff_yca_tgt,
@@ -968,16 +922,6 @@ svn_branch_diff(svn_editor3_t *editor,
svn_array_t *diff_changes = svn_array_make(scratch_pool);
SVN_ITER_T(diff_item_t) *ai;
- if (left->branch->sibling_defn->family->fid
- != right->branch->sibling_defn->family->fid)
- {
- return svn_error_createf(SVN_ERR_BRANCHING, NULL,
- _("Left and right side of an element-based diff
"
- "must be in the same branch family "
- "(left: f%d, right: f%d)"),
- left->branch->sibling_defn->family->fid,
- right->branch->sibling_defn->family->fid);
- }
SVN_ERR_ASSERT(left->eid >= 0 && right->eid >= 0);
SVN_ERR(svn_branch_subtree_differences(&diff_yca_tgt,
@@ -1120,31 +1064,27 @@ svn_branch_diff_r(svn_editor3_t *editor,
if (!left)
{
header = apr_psprintf(scratch_pool,
- "--- added branch %s, family %d, at /%s\n",
+ "--- added branch %s at /%s\n",
svn_branch_instance_get_id(right->branch, scratch_pool),
- right->branch->sibling_defn->family->fid,
svn_branch_get_root_rrpath(right->branch, scratch_pool));
printf("%s%s", prefix, header);
}
else if (!right)
{
header = apr_psprintf(scratch_pool,
- "--- deleted branch %s, family %d, at /%s\n",
+ "--- deleted branch %s at /%s\n",
svn_branch_instance_get_id(left->branch, scratch_pool),
- left->branch->sibling_defn->family->fid,
svn_branch_get_root_rrpath(left->branch, scratch_pool));
printf("%s%s", prefix, header);
}
else
{
- assert(BRANCHES_IN_SAME_FAMILY(left->branch, right->branch));
header = apr_psprintf(scratch_pool,
- "--- diff branch %s at /%s : %s at /%s, family %d\n",
+ "--- diff branch %s at /%s : %s at /%s\n",
svn_branch_instance_get_id(left->branch, scratch_pool),
svn_branch_get_root_rrpath(left->branch, scratch_pool),
svn_branch_instance_get_id(right->branch, scratch_pool),
- svn_branch_get_root_rrpath(right->branch, scratch_pool),
- right->branch->sibling_defn->family->fid);
+ svn_branch_get_root_rrpath(right->branch, scratch_pool));
SVN_ERR(diff_func(editor, left, right, prefix, header, scratch_pool));
}
@@ -1206,10 +1146,8 @@ move_by_branch_and_delete(svn_editor3_t
svn_branch_subtree_t subtree
= svn_branch_map_get_subtree(el_rev->branch, el_rev->eid, scratch_pool);
- SVN_ERR_ASSERT(BRANCHES_IN_SAME_FAMILY(el_rev->branch, to_branch));
-
- /* This is supposed to be used for moving to a *different* branch in the
- same family. In fact, this method would also work for moving within one
+ /* This is supposed to be used for moving to a *different* branch.
+ In fact, this method would also work for moving within one
branch, but we don't currently want to use it for that purpose. */
SVN_ERR_ASSERT(! BRANCH_IS_SAME_BRANCH(el_rev->branch, to_branch,
scratch_pool));
@@ -1234,7 +1172,7 @@ move_by_branch_and_delete(svn_editor3_t
return SVN_NO_ERROR;
}
-/* Move by copy-and-delete into a different branch family.
+/* Move by copy-and-delete.
*
* The target branch is different from the source branch.
*
@@ -1252,8 +1190,6 @@ move_by_copy_and_delete(svn_editor3_t *e
const char *to_name,
apr_pool_t *scratch_pool)
{
- SVN_ERR_ASSERT(! BRANCHES_IN_SAME_FAMILY(el_rev->branch, to_branch));
-
SVN_ERR(svn_editor3_copy_tree(editor, el_rev,
to_branch,
to_parent_eid, to_name));
@@ -1266,16 +1202,12 @@ move_by_copy_and_delete(svn_editor3_t *e
*
* if target is in same branch:
* move the element
- * else if target is in another branch of same family:
+ * else [target is in another branch]:
* delete from source branch
* instantiate in target branch
- * else:
+ * [else:
* copy into target branch
- * delete from source branch
- *
- * ### Another available option is a variant of the second case:
- * if (parent branch of source branch) and (parent element of target) are in
- * the same family, then make a subtree-branch of the source subtree.
+ * delete from source branch]
*/
static svn_error_t *
do_move(svn_editor3_t *editor,
@@ -1296,8 +1228,8 @@ do_move(svn_editor3_t *editor,
return SVN_NO_ERROR;
}
- /* Instantiate same elements in another branch of same family, if possible */
- if (BRANCHES_IN_SAME_FAMILY(el_rev->branch, to_parent_el_rev->branch))
+ /* Instantiate same elements in another branch */
+ if (1 /*###*/)
{
/* Here the elements moved from the source branch will overwrite any
corresponding elements that already exist in the target branch.
@@ -1343,8 +1275,7 @@ svn_branch_revision_root_find_branch_by_
branch = svn_branch_get_subbranch_at_eid(branch, eid, scratch_pool);
pos += bytes;
}
- SVN_DBG(("branch found: f%db%de%d at '/%s'",
- branch->sibling_defn->family->fid,
+ SVN_DBG(("branch found: b%de%d at '/%s'",
branch->sibling_defn->bsid,
branch->sibling_defn->root_eid,
svn_branch_get_root_rrpath(branch, scratch_pool)));
@@ -1419,15 +1350,10 @@ mk_branch(svn_branch_instance_t **new_br
svn_element_content_t *content,
apr_pool_t *iterpool)
{
- svn_branch_family_t *outer_family
- = outer_branch->sibling_defn->family;
- svn_branch_family_t *new_family
- = outer_family->subfamily ? outer_family->subfamily :
- svn_branch_family_add_new_subfamily(outer_family);
- int new_root_eid = svn_branch_family_add_new_element(new_family);
+ svn_branch_family_t *family = outer_branch->sibling_defn->family;
+ int new_root_eid = svn_branch_family_add_new_element(family);
svn_branch_sibling_t *new_branch_def
- = svn_branch_family_add_new_branch_sibling(new_family,
- new_root_eid);
+ = svn_branch_family_add_new_branch_sibling(family, new_root_eid);
int new_outer_eid;
svn_branch_instance_t *new_branch;
@@ -1643,7 +1569,7 @@ execute(const apr_array_header_t *action
SVN_ERR(family_list_branch_instances(
el_rev[0]->branch->rev_root,
el_rev[0]->branch->sibling_defn->family,
- FALSE, FALSE, iterpool));
+ FALSE, iterpool));
}
break;
case ACTION_LIST_BRANCHES_R:
@@ -1655,7 +1581,7 @@ execute(const apr_array_header_t *action
SVN_ERR(family_list_branch_instances(
el_rev[0]->branch->rev_root,
el_rev[0]->branch->sibling_defn->family,
- TRUE, TRUE, iterpool));
+ TRUE, iterpool));
}
break;
case ACTION_LS:
Modified:
subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py?rev=1673476&r1=1673475&r2=1673476&view=diff
==============================================================================
---
subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py
(original)
+++
subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py
Tue Apr 14 17:33:19 2015
@@ -507,23 +507,23 @@ def merges(sbox):
'-U', repo_url,
'merge', 'trunk@5', 'branches/br1', 'trunk@2')
-def reported_br_diff(family, path1, path2):
- return [r'--- diff branch \^.* at /%s : \^.* at /%s, family %d' % (
- re.escape(path1), re.escape(path2), family)]
+def reported_br_diff(path1, path2):
+ return [r'--- diff branch \^.* at /%s : \^.* at /%s' % (
+ re.escape(path1), re.escape(path2))]
def reported_del(path):
return ['D ' + re.escape(path)]
-def reported_br_del(family, path):
+def reported_br_del(path):
return ['D ' + re.escape(path) + r' \(branch \^\..*\)',
- r'--- deleted branch \^.*, family %d, at /%s' % (family,
re.escape(path))]
+ r'--- deleted branch \^.* at /%s' % (re.escape(path),)]
def reported_add(path):
return ['A ' + re.escape(path)]
-def reported_br_add(family, path):
+def reported_br_add(path):
return ['A ' + re.escape(path) + r' \(branch \^\..*\)',
- r'--- added branch \^.*, family %d, at /%s' % (family,
re.escape(path))]
+ r'--- added branch \^.* at /%s' % (re.escape(path),)]
def reported_move(path1, path2, branch_text=''):
dir1, name1 = os.path.split(path1)
@@ -569,7 +569,7 @@ def merge_edits_with_move(sbox):
# on trunk: make edits under 'foo' (r4)
test_svnmover2(sbox, 'trunk',
- reported_br_diff(1, 'trunk', 'trunk') +
+ reported_br_diff('trunk', 'trunk') +
reported_del('lib/foo/x') +
reported_move('lib/foo/y', 'lib/foo/y2') +
reported_add('lib/foo/z'),
@@ -579,19 +579,19 @@ def merge_edits_with_move(sbox):
# on branch: move/rename 'foo' (r5)
test_svnmover2(sbox, 'branches/br1',
- reported_br_diff(1, 'branches/br1', 'branches/br1') +
+ reported_br_diff('branches/br1', 'branches/br1') +
reported_move('lib/foo', 'bar'),
'mv lib/foo bar')
# merge the move to trunk (r6)
test_svnmover2(sbox, '',
- reported_br_diff(1, 'trunk', 'trunk') +
+ reported_br_diff('trunk', 'trunk') +
reported_move('lib/foo', 'bar'),
'merge branches/br1@5 trunk trunk@2')
# merge the edits in trunk (excluding the merge r6) to branch (r7)
test_svnmover2(sbox, '',
- reported_br_diff(1, 'branches/br1', 'branches/br1') +
+ reported_br_diff('branches/br1', 'branches/br1') +
reported_del('bar/x') +
reported_move('bar/y', 'bar/y2') +
reported_add('bar/z'),
@@ -632,7 +632,7 @@ def simple_moves_within_a_branch(sbox):
'mv lib/README.txt README'
)
-# Exercise moves from one branch to another in the same family. 'svnmover'
+# Exercise moves from one branch to another. 'svnmover'
# executes these by branch-and-delete. In this test, the elements being moved
# do not already exist in the target branch.
def move_to_related_branch(sbox):
@@ -668,7 +668,7 @@ def move_to_related_branch(sbox):
'mv trunk/lib branches/br1/subdir/lib2',
)
-# Exercise moves from one branch to another in the same family. 'svnmover'
+# Exercise moves from one branch to another. 'svnmover'
# executes these by branch-and-delete. In this test, there are existing
# instances of the same elements in the target branch, which should be
# overwritten.
@@ -737,7 +737,7 @@ def move_branch_within_same_parent_branc
# move trunk
test_svnmover2(sbox, '',
- reported_br_diff(0, '', '') +
+ reported_br_diff('', '') +
reported_add('D') +
reported_add('D/E') +
reported_br_move('trunk', 'D/E/trunk2'),
@@ -747,11 +747,11 @@ def move_branch_within_same_parent_branc
# move trunk and also modify it
test_svnmover2(sbox, '',
- reported_br_diff(0, '', '') +
+ reported_br_diff('', '') +
reported_del('D') +
reported_del('D/E') +
reported_br_move('D/E/trunk2', 'trunk') +
- reported_br_diff(1, 'D/E/trunk2', 'trunk') +
+ reported_br_diff('D/E/trunk2', 'trunk') +
reported_add('new'),
'mv D/E/trunk2 trunk',
'rm D',
@@ -759,7 +759,7 @@ def move_branch_within_same_parent_branc
# move a subbranch of trunk
test_svnmover2(sbox, 'trunk',
- reported_br_diff(1, 'trunk', 'trunk') +
+ reported_br_diff('trunk', 'trunk') +
reported_br_move('sub', 'sub2'),
'mv sub sub2'
)
@@ -782,12 +782,6 @@ def move_branch_within_same_parent_branc
#
# (UPPER CASE denotes a branch root.)
#
-# All branches are necessarily in the same family in the first arrangement.
-# The rearranged form could have a separate family for each project if the
-# projects historically never shared any elements, but we keep them all in
-# the same family and this way can guarantee to accommodate them even if
-# they do share history.
-#
# This rearrangement is achieved entirely by branching from subtrees of the
# existing branches.
#
@@ -825,7 +819,7 @@ def restructure_repo_ttb_projects_to_pro
# merge the branch to trunk (r7)
test_svnmover2(sbox, '',
- reported_br_diff(1, 'trunk', 'trunk') +
+ reported_br_diff('trunk', 'trunk') +
reported_move('proj1/lib/foo', 'proj1/bar') +
reported_add('proj2') +
reported_add('proj2/bar') +
@@ -834,7 +828,7 @@ def restructure_repo_ttb_projects_to_pro
# merge the edits in trunk (excluding the merge r6) to branch (r7)
test_svnmover2(sbox, '',
- reported_br_diff(1, 'branches/br1', 'branches/br1') +
+ reported_br_diff('branches/br1', 'branches/br1') +
reported_del('proj1/bar/x') +
reported_move('proj1/bar/y', 'proj1/bar/y2') +
reported_add('proj1/bar/z'),
@@ -849,11 +843,11 @@ def restructure_repo_ttb_projects_to_pro
)
# Rearrange: {t,t,b}/{proj} => {proj}/{t,t,b}
test_svnmover2(sbox, '',
- reported_br_diff(0, '', '') +
- reported_br_add(1, 'proj1/trunk') +
- reported_br_add(1, 'proj2/trunk') +
- reported_br_add(1, 'proj1/branches/br1') +
- reported_br_add(1, 'proj2/branches/br1'),
+ reported_br_diff('', '') +
+ reported_br_add('proj1/trunk') +
+ reported_br_add('proj2/trunk') +
+ reported_br_add('proj1/branches/br1') +
+ reported_br_add('proj2/branches/br1'),
'branch trunk/proj1 proj1/trunk',
'branch trunk/proj2 proj2/trunk',
'branch branches/br1/proj1 proj1/branches/br1',
@@ -861,10 +855,10 @@ def restructure_repo_ttb_projects_to_pro
)
# Delete the remaining root dir of the old trunk and branches
test_svnmover2(sbox, '',
- reported_br_diff(0, '', '') +
+ reported_br_diff('', '') +
reported_del('branches') +
- reported_br_del(1, 'branches/br1') +
- reported_br_del(1, 'trunk'),
+ reported_br_del('branches/br1') +
+ reported_br_del('trunk'),
'rm trunk',
'rm branches',
)
@@ -889,16 +883,10 @@ def restructure_repo_ttb_projects_to_pro
#
# (UPPER CASE denotes a branch root.)
#
-# If all branches are in the same family in the first arrangement, then this
+# This
# rearrangement is achieved entirely by branching the existing branches into
# subtrees of the new big branches.
#
-# (If there were a separate branch family for each project in the first
-# arrangement, then there is no simple branching/moving way to do this. The
-# elements of each old branch would have to be copied into the new branch
-# family, and so would be linked to their old history by the weaker "copied
-# from" relationship.)
-#
def restructure_repo_projects_ttb_to_ttb_projects(sbox):
"restructure repo: projects/ttb to ttb/projects"
sbox_build_svnmover(sbox, content=initial_content_projects_ttb)
@@ -926,7 +914,7 @@ def restructure_repo_projects_ttb_to_ttb
# merge trunk to branch
test_svnmover2(sbox, proj,
- reported_br_diff(1, proj + '/branches/br1', proj +
'/branches/br1') +
+ reported_br_diff(proj + '/branches/br1', proj +
'/branches/br1') +
reported_del('bar/x') +
reported_move('bar/y', 'bar/y2') +
reported_add('bar/z'),
@@ -950,9 +938,9 @@ def restructure_repo_projects_ttb_to_ttb
# of the 'mv' command, where it performs moving by 'branch-and-delete'.
for proj in ['proj1', 'proj2']:
test_svnmover2(sbox, '',
- reported_br_diff(0, '', '') +
- reported_br_del(1, proj + '/trunk') +
- reported_br_diff(1, 'trunk', 'trunk') +
+ reported_br_diff('', '') +
+ reported_br_del(proj + '/trunk') +
+ reported_br_diff('trunk', 'trunk') +
reported_add(proj) +
reported_add(proj + '/README') +
reported_add(proj + '/lib') +
@@ -964,9 +952,9 @@ def restructure_repo_projects_ttb_to_ttb
'rm', proj + '/trunk',
)
test_svnmover2(sbox, '',
- reported_br_diff(0, '', '') +
- reported_br_del(1, proj + '/branches/br1') +
- reported_br_diff(1, 'branches/br1', 'branches/br1') +
+ reported_br_diff('', '') +
+ reported_br_del(proj + '/branches/br1') +
+ reported_br_diff('branches/br1', 'branches/br1') +
reported_add(proj) +
reported_add(proj + '/README') +
reported_add(proj + '/bar') +