subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1675073 - in /subversion/branches/move-tracking-2/subversion: libsvn_delta/branch.c tests/cmdline/svnmover_tests.py
Date Tue, 21 Apr 2015 09:43:28 GMT
Author: julianfoad
Date: Tue Apr 21 09:43:28 2015
New Revision: 1675073

URL: http://svn.apache.org/r1675073
Log:
On the 'move-tracking-2' branch: Change the branch id notation to 'B2.12'
instead of '^.3.12'.

For the root branch, change to 'B0' instead of '^'.

Suggested by: danielsh

* subversion/libsvn_delta/branch.c
  (svn_branch_get_default_r0_metadata,
   parse_branch_line,
   svn_branch_instance_serialize): Update the metadata format.
  (svn_branch_instance_get_id): Update the id generation.

* subversion/tests/cmdline/svnmover_tests.py
  (expected_ls_output,
   reported_branch_del_line,
   reported_branch_add_line,
   reported_br_diff,
   reported_br_del,
   reported_br_add,
   reported_br_move): Update the expected output regex.

Modified:
    subversion/branches/move-tracking-2/subversion/libsvn_delta/branch.c
    subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmover_tests.py

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=1675073&r1=1675072&r2=1675073&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 21 09:43:28
2015
@@ -813,7 +813,7 @@ svn_branch_get_default_r0_metadata(apr_p
   static const char *default_repos_info
     = "r0:\n"
       "family: eids 0 1 b-instances 1\n"
-      "b^ root-eid 0 at .\n"
+      "B0 root-eid 0 at .\n"
       "e0: normal -1 .\n";
 
   return svn_string_create(default_repos_info, result_pool);
@@ -836,7 +836,7 @@ parse_branch_line(char *bid_p,
   SVN_ERR(svn_stream_readline(stream, &line, "\n", &eof, scratch_pool));
   SVN_ERR_ASSERT(!eof);
 
-  n = sscanf(line->data, "b%s root-eid %d at%n",
+  n = sscanf(line->data, "%s root-eid %d at%n",
              bid_p, root_eid_p, &offset);
   SVN_ERR_ASSERT(n >= 2);  /* C std is unclear on whether '%n' counts */
   SVN_ERR_ASSERT(line->data[offset] == ' ');
@@ -1079,7 +1079,7 @@ svn_branch_instance_serialize(svn_stream
   int eid;
 
   SVN_ERR(svn_stream_printf(stream, scratch_pool,
-                            "b%s root-eid %d at %s\n",
+                            "%s root-eid %d at %s\n",
                             svn_branch_instance_get_id(branch, scratch_pool),
                             branch->root_eid,
                             branch_root_rrpath[0] ? branch_root_rrpath : "."));
@@ -1236,15 +1236,20 @@ const char *
 svn_branch_instance_get_id(svn_branch_instance_t *branch,
                            apr_pool_t *result_pool)
 {
-  const char *id = "";
+  const char *id = NULL;
+
+  if (! branch->outer_branch)
+    return "B0";
 
   while (branch->outer_branch)
     {
-      id = apr_psprintf(result_pool, ".%d%s",
-                        branch->outer_eid, id);
+      if (id)
+        id = apr_psprintf(result_pool, "%d.%s", branch->outer_eid, id);
+      else
+        id = apr_psprintf(result_pool, "%d", branch->outer_eid);
       branch = branch->outer_branch;
     }
-  id = apr_psprintf(result_pool, "^%s", id);
+  id = apr_psprintf(result_pool, "B%s", id);
   return id;
 }
 

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=1675073&r1=1675072&r2=1675073&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
21 09:43:28 2015
@@ -209,7 +209,7 @@ def expected_ls_output(paths, subbranch_
   expected_out = svntest.verify.UnorderedRegexListOutput(
     [r'    e\d+ ' + re.escape(p) + '\n'
      for p in paths] +
-    [r'    e\d+ ' + re.escape(p) + r' \(branch \^\.\d+\)' + '\n'
+    [r'    e\d+ ' + re.escape(p) + r' \(branch B[0-9.]+\)' + '\n'
      for p in subbranch_paths])
   return expected_out
 
@@ -519,10 +519,10 @@ def reported_element_add_line(rpath, bra
   return 'A   ' + re.escape(rpath) + branch_text
 
 def reported_branch_del_line(subbranch_fullpath):
-  return r'--- deleted branch \^.* at /%s' % (re.escape(subbranch_fullpath),)
+  return r'--- deleted branch B[0-9.]+ at /%s' % (re.escape(subbranch_fullpath),)
 
 def reported_branch_add_line(subbranch_fullpath):
-  return r'--- added branch \^.* at /%s' % (re.escape(subbranch_fullpath),)
+  return r'--- added branch B[0-9.]+ at /%s' % (re.escape(subbranch_fullpath),)
 
 def reported_br_params(path1, path2):
   """Return (SUBBRANCH_RPATH, SUBBRANCH_FULLPATH).
@@ -545,7 +545,7 @@ def reported_br_diff(path1, path2):
      PATH1 is the 'left' and PATH2 the 'right' side path. Both are full paths
      from the repo root.
   """
-  return [r'--- diff branch \^.* at /%s : \^.* at /%s' % (
+  return [r'--- diff branch B[0-9.]+ at /%s : B[0-9.]+ at /%s' % (
            re.escape(path1), re.escape(path2))]
 
 def reported_del(path):
@@ -561,7 +561,7 @@ def reported_br_del(path1, path2=None):
      Params are (SUBBRANCH_RPATH) or (OUTER_BRANCH_FULLPATH, SUBBRANCH_RPATH).
   """
   subbranch_rpath, subbranch_fullpath = reported_br_params(path1, path2)
-  return [reported_element_del_line(subbranch_rpath, r' \(branch \^\..*\)'),
+  return [reported_element_del_line(subbranch_rpath, r' \(branch B[0-9.]+\)'),
           reported_branch_del_line(subbranch_fullpath)]
 
 def reported_br_nested_del(path1, path2=None):
@@ -587,7 +587,7 @@ def reported_br_add(path1, path2=None):
      Params are (SUBBRANCH_RPATH) or (OUTER_BRANCH_FULLPATH, SUBBRANCH_RPATH).
   """
   subbranch_rpath, subbranch_fullpath = reported_br_params(path1, path2)
-  return [reported_element_add_line(subbranch_rpath, r' \(branch \^\..*\)'),
+  return [reported_element_add_line(subbranch_rpath, r' \(branch B[0-9.]+\)'),
           reported_branch_add_line(subbranch_fullpath)]
 
 def reported_br_nested_add(path1, path2=None):
@@ -618,7 +618,7 @@ def reported_move(path1, path2, branch_t
 def reported_br_move(path1, path2):
   """Return expected lines for a move of a (sub)branch.
   """
-  return reported_move(path1, path2, r' \(branch \^\..*\)')
+  return reported_move(path1, path2, r' \(branch B[0-9.]+\)')
 
 
 ######################################################################



Mime
View raw message