Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.c?rev=1661492&r1=1661491&r2=1661492&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.c Sun 
Feb 22 16:52:05 2015
@@ -33,7 +33,7 @@
 #include "../../libsvn_wc/wc-queries.h"
 #define SVN_WC__I_AM_WC_DB
 #include "../../libsvn_wc/wc_db_private.h"
-
+#include "../../libsvn_wc/token-map.h"
 svn_error_t *
 svn_test__create_client_ctx(svn_client_ctx_t **ctx,
                             svn_test__sandbox_t *sbox,
@@ -122,6 +122,9 @@ WC_QUERIES_SQL_DECLARE_STATEMENTS(statem
 svn_error_t *
 svn_test__create_fake_wc(const char *wc_abspath,
                          const char *extra_statements,
+                         const svn_test__nodes_data_t nodes[],
+                         const svn_test__actual_data_t actuals[],
+
                          apr_pool_t *scratch_pool)
 {
   const char *dotsvn_abspath = svn_dirent_join(wc_abspath, ".svn",
@@ -129,6 +132,8 @@ svn_test__create_fake_wc(const char *wc_
   svn_sqlite__db_t *sdb;
   const char **my_statements;
   int i;
+  svn_sqlite__stmt_t *stmt;
+  const apr_int64_t wc_id = 1;
 
   /* Allocate MY_STATEMENTS in RESULT_POOL because the SDB will continue to
    * refer to it over its lifetime. */
@@ -153,6 +158,110 @@ svn_test__create_fake_wc(const char *wc_
 
   SVN_ERR(svn_sqlite__close(sdb));
 
+  if (!nodes && !actuals)
+    return SVN_NO_ERROR;
+
+  /* Re-open with normal set of statements */
+  SVN_ERR(svn_wc__db_util_open_db(&sdb, wc_abspath, "wc.db",
+                                  svn_sqlite__mode_readwrite,
+                                  FALSE /* exclusive */, 0 /* timeout */,
+                                  statements,
+                                  scratch_pool, scratch_pool));
+
+  if (nodes)
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+                                        STMT_INSERT_NODE));
+
+      for (i = 0; nodes[i].local_relpath; i++)
+        {
+          SVN_ERR(svn_sqlite__bindf(stmt, "isdsnnns",
+                                wc_id,
+                                nodes[i].local_relpath,
+                                nodes[i].op_depth,
+                                nodes[i].local_relpath[0]
+                                  ? svn_relpath_dirname(nodes[i].local_relpath,
+                                                        scratch_pool)
+                                  : NULL,
+                                nodes[i].presence));
+
+          if (nodes[i].repos_relpath)
+            {
+                SVN_ERR(svn_sqlite__bind_int64(stmt, 5, nodes[i].repos_id));
+                SVN_ERR(svn_sqlite__bind_text(stmt, 6, 
nodes[i].repos_relpath));
+                SVN_ERR(svn_sqlite__bind_revnum(stmt, 7, nodes[i].revision));
+            }
+
+          if (nodes[i].depth)
+            SVN_ERR(svn_sqlite__bind_text(stmt, 9, nodes[i].depth));
+
+          if (nodes[i].kind != 0)
+            SVN_ERR(svn_sqlite__bind_token(stmt, 10, kind_map, nodes[i].kind));
+
+          if (nodes[i].last_author || nodes[i].last_date)
+            {
+              SVN_ERR(svn_sqlite__bind_revnum(stmt, 11, 
nodes[i].last_revision));
+              SVN_ERR(svn_sqlite__bind_int64(stmt, 12, nodes[i].last_date));
+              SVN_ERR(svn_sqlite__bind_text(stmt, 13, nodes[i].last_author));
+            }
+
+          if (nodes[i].checksum)
+            SVN_ERR(svn_sqlite__bind_text(stmt, 14, nodes[i].checksum));
+
+          if (nodes[i].properties)
+            SVN_ERR(svn_sqlite__bind_text(stmt, 15, nodes[i].properties));
+
+          if (nodes[i].recorded_size || nodes[i].recorded_time)
+            {
+              SVN_ERR(svn_sqlite__bind_int64(stmt, 16, 
nodes[i].recorded_size));
+              SVN_ERR(svn_sqlite__bind_int64(stmt, 17, 
nodes[i].recorded_time));
+            }
+
+          /* 18 is DAV cache */
+
+          if (nodes[i].symlink_target)
+            SVN_ERR(svn_sqlite__bind_text(stmt, 19, nodes[i].symlink_target));
+
+          if (nodes[i].file_external)
+            SVN_ERR(svn_sqlite__bind_int(stmt, 20, 1));
+
+          if (nodes[i].moved_to)
+            SVN_ERR(svn_sqlite__bind_text(stmt, 21, nodes[i].moved_to));
+
+          if (nodes[i].moved_here)
+            SVN_ERR(svn_sqlite__bind_int(stmt, 22, 1));
+
+          if (nodes[i].inherited_props)
+            SVN_ERR(svn_sqlite__bind_text(stmt, 23, nodes[i].inherited_props));
+
+          SVN_ERR(svn_sqlite__step_done(stmt));
+        }
+    }
+
+  if (actuals)
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+                                        STMT_INSERT_ACTUAL_NODE));
+
+      for (i = 0; actuals[i].local_relpath; i++)
+        {
+          SVN_ERR(svn_sqlite__bindf(stmt, "isssss",
+                                wc_id,
+                                actuals[i].local_relpath,
+                                actuals[i].local_relpath[0]
+                                  ? 
svn_relpath_dirname(actuals[i].local_relpath,
+                                                        scratch_pool)
+                                  : NULL,
+                                actuals[i].properties,
+                                actuals[i].changelist,
+                                actuals[i].conflict_data));
+
+          SVN_ERR(svn_sqlite__step_done(stmt));
+        }
+    }
+
+  SVN_ERR(svn_sqlite__close(sdb));
+
   return SVN_NO_ERROR;
 }
 
@@ -280,8 +389,14 @@ sbox_wc_copy_url(svn_test__sandbox_t *b,
 
   APR_ARRAY_PUSH(sources, svn_client_copy_source_t *) = src;
 
-  SVN_ERR(svn_client_copy6(sources, sbox_wc_path(b, to_path),
-                           FALSE, FALSE, FALSE, NULL, NULL, NULL,
+  SVN_ERR(svn_client_copy7(sources, sbox_wc_path(b, to_path),
+                           FALSE /* copy_as_child */,
+                           FALSE /* make_parents */,
+                           FALSE /* ignore_externals */,
+                           FALSE /* metadata_only */,
+                           FALSE, NULL /* pin_external */,
+                           NULL /* revprops */,
+                           NULL, NULL, /* commit_callback */
                            ctx, scratch_pool));
 
   ctx->wc_ctx = NULL;

Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.h?rev=1661492&r1=1661491&r2=1661492&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.h 
(original)
+++ subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/utils.h Sun 
Feb 22 16:52:05 2015
@@ -179,6 +179,39 @@ sbox_wc_propset(svn_test__sandbox_t *b,
 svn_error_t *
 sbox_add_and_commit_greek_tree(svn_test__sandbox_t *b);
 
+/* Initial data to store in NODES */
+typedef struct svn_test__nodes_data_t
+{
+  int op_depth;
+  const char *local_relpath;
+  const char *presence;
+  int repos_id;
+  const char *repos_relpath;
+  svn_revnum_t revision;
+  svn_boolean_t moved_here;
+  const char *moved_to;
+  svn_node_kind_t kind;
+  const char *properties;
+  const char *depth;
+  const char *checksum;
+  const char *symlink_target;
+  svn_revnum_t last_revision;
+  apr_time_t last_date;
+  const char *last_author;
+  svn_boolean_t file_external;
+  const char *inherited_props;
+  svn_filesize_t recorded_size;
+  apr_time_t recorded_time;
+} svn_test__nodes_data_t;
+
+/* Initial data to store in ACTUAL */
+typedef struct svn_test__actual_data_t
+{
+  const char *local_relpath;
+  const char *properties;
+  const char *changelist;
+  const char *conflict_data;
+} svn_test__actual_data_t;
 
 /* Create a WC directory at WC_ABSPATH containing a fake WC DB, generated by
  * executing the SQL statements EXTRA_STATEMENTS in addition to the standard
@@ -186,6 +219,8 @@ sbox_add_and_commit_greek_tree(svn_test_
 svn_error_t *
 svn_test__create_fake_wc(const char *wc_abspath,
                          const char *extra_statements,
+                         const svn_test__nodes_data_t nodes[],
+                         const svn_test__actual_data_t actuals[],
                          apr_pool_t *scratch_pool);
 
 

Modified: 
subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-queries-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1661492&r1=1661491&r2=1661492&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-queries-test.c
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-queries-test.c
 Sun Feb 22 16:52:05 2015
@@ -97,6 +97,7 @@ static const int slow_statements[] =
 
   /* Full temporary table read */
   STMT_INSERT_ACTUAL_EMPTIES,
+  STMT_INSERT_ACTUAL_EMPTIES_FILES,
   STMT_SELECT_REVERT_LIST_RECURSIVE,
   STMT_SELECT_DELETE_LIST,
   STMT_SELECT_UPDATE_MOVE_LIST,
@@ -302,14 +303,21 @@ parse_explanation_item(struct explanatio
       item->search = TRUE; /* Search or scan */
       token = apr_strtok(NULL, " ", &last);
 
-      if (!MATCH_TOKEN(token, "TABLE"))
+      if (MATCH_TOKEN(token, "TABLE"))
+        {
+          item->table = apr_strtok(NULL, " ", &last);
+        }
+      else if (MATCH_TOKEN(token, "SUBQUERY"))
+        {
+          item->table = apr_psprintf(result_pool, "SUBQUERY-%s",
+                                     apr_strtok(NULL, " ", &last));
+        }
+      else
         {
           printf("DBG: Expected 'TABLE', got '%s' in '%s'\n", token, text);
           return SVN_NO_ERROR; /* Nothing to parse */
         }
 
-      item->table = apr_strtok(NULL, " ", &last);
-
       token = apr_strtok(NULL, " ", &last);
 
       /* Skip alias */
@@ -976,6 +984,59 @@ test_schema_statistics(apr_pool_t *scrat
   return SVN_NO_ERROR;
 }
 
+/* An SQLite application defined function that allows SQL queries to
+   use "relpath_depth(local_relpath)".  */
+static void relpath_depth_sqlite(sqlite3_context* context,
+                                 int argc,
+                                 sqlite3_value* values[])
+{
+  SVN_ERR_MALFUNCTION_NO_RETURN(); /* STUB! */
+}
+
+/* Parse all verify/check queries */
+static svn_error_t *
+test_verify_parsable(apr_pool_t *scratch_pool)
+{
+  sqlite3 *sdb;
+  int i;
+
+  SVN_ERR(create_memory_db(&sdb, scratch_pool));
+
+  SQLITE_ERR(sqlite3_create_function(sdb, "relpath_depth", 1, SQLITE_ANY, NULL,
+                                     relpath_depth_sqlite, NULL, NULL));
+
+  for (i=STMT_VERIFICATION_TRIGGERS; wc_queries[i]; i++)
+    {
+      sqlite3_stmt *stmt;
+      const char *text = wc_queries[i];
+
+      /* Some of our statement texts contain multiple queries. We prepare
+         them all. */
+      while (*text != '\0')
+        {
+          const char *tail;
+          int r = sqlite3_prepare_v2(sdb, text, -1, &stmt, &tail);
+
+          if (r != SQLITE_OK)
+            return svn_error_createf(SVN_ERR_SQLITE_ERROR, NULL,
+                                     "Preparing %s failed: %s\n%s",
+                                     wc_query_info[i][0],
+                                     sqlite3_errmsg(sdb),
+                                     text);
+
+          SQLITE_ERR(sqlite3_finalize(stmt));
+
+          /* Continue after the current statement */
+          text = tail;
+        }
+    }
+
+  SQLITE_ERR(sqlite3_close(sdb)); /* Close the DB if ok; otherwise leaked */
+
+  return SVN_NO_ERROR;
+}
+
+
 static int max_threads = 1;
 
 static struct svn_test_descriptor_t test_funcs[] =
@@ -991,6 +1052,8 @@ static struct svn_test_descriptor_t test
                    "test query duplicates"),
     SVN_TEST_PASS2(test_schema_statistics,
                    "test schema statistics"),
+    SVN_TEST_PASS2(test_verify_parsable,
+                   "verify queries are parsable"),
     SVN_TEST_NULL
   };
 

Modified: 
subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-test-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-test-queries.sql?rev=1661492&r1=1661491&r2=1661492&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-test-queries.sql
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/wc-test-queries.sql
 Sun Feb 22 16:52:05 2015
@@ -45,7 +45,11 @@ DELETE FROM nodes;
 -- STMT_INSERT_NODE
 INSERT INTO nodes (local_relpath, op_depth, presence, repos_path,
                    revision, parent_relpath, wc_id, repos_id, kind, depth)
-           VALUES (?1, ?2, ?3, ?4, ?5, ?6, 1, 1, 'dir', 'infinity')
+           VALUES (?1, ?2, ?3, ?4, ?5, ?6, 1,
+                   CASE WHEN ?3 != 'base-deleted' THEN 1 END,
+                   'dir',
+                   CASE WHEN ?3 in ('normal', 'incomplete')
+                        THEN 'infinity' END)
 
 -- STMT_DELETE_ACTUAL
 DELETE FROM actual_node;
@@ -54,8 +58,18 @@ DELETE FROM actual_node;
 INSERT INTO actual_node (local_relpath, parent_relpath, changelist, wc_id)
                 VALUES (?1, ?2, ?3, 1)
 
+-- STMT_ENSURE_EMPTY_PRISTINE
+INSERT OR IGNORE INTO pristine (checksum, md5_checksum, size, refcount)
+  VALUES ('$sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709',
+          '$md5 $d41d8cd98f00b204e9800998ecf8427e',
+          0, 0)
+
 -- STMT_NODES_SET_FILE
-UPDATE nodes SET kind = 'file' WHERE wc_id = 1 and local_relpath = ?1
+UPDATE nodes
+   SET kind = 'file',
+       checksum = '$sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709',
+       depth = NULL
+WHERE wc_id = 1 and local_relpath = ?1
 
 -- STMT_SELECT_ALL_ACTUAL
 SELECT local_relpath FROM actual_node WHERE wc_id = 1

Propchange: subversion/branches/move-tracking-2/tools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb 22 16:52:05 2015
@@ -82,4 +82,4 @@
 /subversion/branches/verify-at-commit/tools:1462039-1462408
 /subversion/branches/verify-keep-going/tools:1439280-1546110
 /subversion/branches/wc-collate-path/tools:1402685-1480384
-/subversion/trunk/tools:1606692-1660163
+/subversion/trunk/tools:1606692-1661488

Modified: subversion/branches/move-tracking-2/tools/client-side/bash_completion
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/tools/client-side/bash_completion?rev=1661492&r1=1661491&r2=1661492&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/tools/client-side/bash_completion 
(original)
+++ subversion/branches/move-tracking-2/tools/client-side/bash_completion Sun 
Feb 22 16:52:05 2015
@@ -167,7 +167,7 @@ _svn()
        cmds="$cmds info list ls lock log merge mergeinfo mkdir move mv rename"
        cmds="$cmds patch propdel pdel propedit pedit propget pget proplist"
        cmds="$cmds plist propset pset relocate resolve resolved revert status"
-       cmds="$cmds switch unlock update upgrade youngest"
+       cmds="$cmds switch unlock update upgrade"
 
        # help options have a strange command status...
        local helpOpts='--help -h'
@@ -781,7 +781,9 @@ _svn()
 
        # otherwise build possible options for the command
        pOpts="--username --password --no-auth-cache --non-interactive \
-              --trust-server-cert --force-interactive"
+              --trust-server-cert --trust-unknown-ca --trust-cn-mismatch \
+              --trust-expired --trust-not-yet-valid --trust-other-failure \
+              --force-interactive"
        mOpts="-m --message -F --file --encoding --force-log --with-revprop"
        rOpts="-r --revision"
        qOpts="-q --quiet"
@@ -869,7 +871,7 @@ _svn()
                         --incremental --xml $qOpts -l --limit -c --change \
                          $gOpts --with-all-revprops --with-revprop --depth \
                         --diff --diff-cmd -x --extensions --internal-diff \
-                        --with-no-revprops --search --search-and --auto-moves"
+                        --with-no-revprops --search --search-and"
                ;;
        merge)
                cmdOpts="$rOpts $nOpts $qOpts --force --dry-run --diff3-cmd \
@@ -953,9 +955,6 @@ _svn()
        upgrade)
                cmdOpts="$qOpts $pOpts"
                ;;
-       youngest)
-               cmdOpts="$pOpts --no-newline"
-               ;;
        *)
                ;;
        esac

Modified: subversion/branches/move-tracking-2/tools/dist/backport.pl
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/tools/dist/backport.pl?rev=1661492&r1=1661491&r2=1661492&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/tools/dist/backport.pl (original)
+++ subversion/branches/move-tracking-2/tools/dist/backport.pl Sun Feb 22 
16:52:05 2015
@@ -3,6 +3,8 @@ use warnings;
 use strict;
 use feature qw/switch say/;
 
+#no warnings 'experimental::smartmatch';
+
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -97,6 +99,7 @@ unless (defined $AVAILID) {
 my $STATUS = './STATUS';
 my $STATEFILE = './.backports1';
 my $BRANCHES = '^/subversion/branches';
+my $TRUNK = '^/subversion/trunk';
 $ENV{LC_ALL} = "C";  # since we parse 'svn info' output and use isprint()
 
 # Globals.
@@ -178,12 +181,30 @@ to open a shell, and manually run 'svn c
 in the environment before running the script, in which case answering 'y'
 to the first prompt will not only run the merge but also commit it.
 
-There is also a batch mode (normally used only by cron jobs and buildbot tasks,
-rather than interactively): when \$YES and \$MAY_COMMIT are defined to '1' in
-the environment, this script will iterate the "Approved:" section, and merge
-and commit each entry therein.  If only \$YES is defined, the script will
-merge every nomination (including unapproved and vetoed ones), and complain
-to stderr if it notices any conflicts.
+There are two batch modes.  The first mode is used by the nightly svn-role
+mergebot.  It is enabled by setting \$YES and \$MAY_COMMIT to '1' in the
+environment.  In this mode, the script will iterate the "Approved changes:"
+section and merge and commit each entry therein.  To prevent an entry from
+being auto-merged, veto it or move it to a new section named "Approved, but
+merge manually:".
+
+The second batch mode is used by the hourly conflicts detector bot.  It is
+triggered by having \$YES defined in the environment to '1' and \$MAY_COMMIT
+undefined.  In this mode, the script will locally merge every nomination
+(including unapproved and vetoed ones), and complain to stderr if the merge
+failed due to a conflict.  This mode never commits anything.
+
+The hourly conflicts detector bot turns red if any entry produced a merge
+conflict.  When entry A depends on entry B for a clean merge, put a "Depends:"
+header on entry A to instruct the bot not to turn red due to A.  (The header
+is not parsed; only its presence or absence matters.)
+
+Both batch modes also perform a basic sanity-check on entries that declare
+backport branches (via the "Branch:" header): if a backport branch is used, but
+at least one of the revisions enumerated in the entry title had not been merged
+from $TRUNK to the branch root, the hourly bot will turn red and 
+nightly bot will skip the entry and email its admins.  (The nightly bot does
+not email the list on failure, since it doesn't use buildbot.)
 
 The 'svn' binary defined by the environment variable \$SVN, or otherwise the
 'svn' found in \$PATH, will be used to manage the working copy.
@@ -286,7 +307,7 @@ sub shell_escape {
 
 sub shell_safe_path_or_url($) {
   local $_ = shift;
-  return m{^[A-Za-z0-9._:+/-]+$} and !/^-|^[+]/;
+  return (m{^[A-Za-z0-9._:+/-]+$} and !/^-|^[+]/);
 }
 
 # Shell-safety-validating wrapper for File::Temp::tempfile
@@ -810,6 +831,37 @@ sub exit_stage_left {
   exit scalar keys %ERRORS;
 }
 
+# Given an ENTRY, check whether all ENTRY->{revisions} have been merged
+# into ENTRY->{branch}, if it has one.  If revisions are missing, record
+# a warning in $ERRORS.  Return TRUE If the entry passed the validation
+# and FALSE otherwise.
+sub validate_branch_contains_named_revisions {
+  my %entry = @_;
+  return 1 unless defined $entry{branch};
+  my %present;
+
+  return "Why are you running so old versions?" # true in boolean context
+    if $SVNvsn < 1_005_000;     # doesn't have the 'mergeinfo' subcommand
+
+  my $shell_escaped_branch = shell_escape($entry{branch});
+  %present = do {
+    my @present = `$SVN mergeinfo --show-revs=merged -- $TRUNK 
$BRANCHES/$shell_escaped_branch`;
+    chomp @present;
+    @present = map /(\d+)/g, @present;
+    map +($_ => 1), @present;
+  };
+
+  my @absent = grep { not exists $present{$_} } @{$entry{revisions}};
+
+  if (@absent) {
+    $ERRORS{$entry{id}} //= [\%entry,
+      sprintf("Revisions '%s' nominated but not included in branch",
+              (join ", ", map { "r$_" } @absent)),
+    ];
+  }
+  return @absent ? 0 : 1;
+}
+
 sub handle_entry {
   my $in_approved = shift;
   my $approved = shift;
@@ -829,9 +881,15 @@ sub handle_entry {
     unless (@vetoes) {
       if ($MAY_COMMIT and $in_approved) {
         # svn-role mode
-        merge %entry;
+        merge %entry if validate_branch_contains_named_revisions %entry;
       } elsif (!$MAY_COMMIT) {
         # Scan-for-conflicts mode
+
+        # First, sanity-check the entry.  We ignore the result; even if it
+        # failed, we do want to check for conflicts, in the remainder of this
+        # block.
+        validate_branch_contains_named_revisions %entry;
+
         merge %entry;
 
         my $output = `$SVN status`;
@@ -892,6 +950,7 @@ sub handle_entry {
     given (prompt 'Run a merge? [y,l,v,±1,±0,q,e,a, ,N] ',
                    verbose => 1, extra => qr/[+-]/) {
       when (/^y/i) {
+        #validate_branch_contains_named_revisions %entry;
         merge %entry;
         while (1) {
           given (prompt "Shall I open a subshell? [ydN] ", verbose => 1) {

Modified: subversion/branches/move-tracking-2/tools/dist/backport_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/tools/dist/backport_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/tools/dist/backport_tests.py (original)
+++ subversion/branches/move-tracking-2/tools/dist/backport_tests.py Sun Feb 22 
16:52:05 2015
@@ -210,12 +210,12 @@ def verify_backport(sbox, expected_dump_
   # mirror repository in preparation for the comparison dump.
   svntest.actions.enable_revprop_changes(sbox.repo_dir)
   for revnum in range(0, 1+int(sbox.youngest())):
-    svntest.actions.run_and_verify_svnadmin(None, [], [],
+    svntest.actions.run_and_verify_svnadmin([], [],
       "delrevprop", "-r", revnum, sbox.repo_dir, "svn:date")
 
   # Create a dump file from the mirror repository.
   dest_dump = open(expected_dump_file).readlines()
-  svntest.actions.run_and_verify_svnadmin(None, None, [],
+  svntest.actions.run_and_verify_svnadmin(None, [],
                                           'setuuid', '--', sbox.repo_dir, uuid)
   src_dump = svntest.actions.run_and_verify_dump(sbox.repo_dir)
 
@@ -265,7 +265,7 @@ def backport_two_approveds(sbox):
 
   # Now back up and do three entries.
   # r9: revert r7, r8
-  svntest.actions.run_and_verify_svnlook(None, ["8\n"], [],
+  svntest.actions.run_and_verify_svnlook(["8\n"], [],
                                          'youngest', sbox.repo_dir)
   sbox.simple_update()
   svntest.main.run_svn(None, 'merge', '-r8:6',
@@ -342,6 +342,8 @@ def backport_branches(sbox):
   # Run it.
   run_backport(sbox)
 
+  # This also serves as the 'success mode' part of backport_branch_contains().
+
 
 #----------------------------------------------------------------------
 @BackportTest('76cee987-25c9-4d6c-ad40-000000000005')
@@ -399,6 +401,60 @@ def backport_conflicts_detection(sbox):
 
 
 #----------------------------------------------------------------------
+@BackportTest(None) # would be 000000000007
+def backport_branch_contains(sbox):
+  "branch must contain the revisions"
+
+  # r6: conflicting change on branch
+  sbox.simple_append('branch/iota', 'Conflicts with first change')
+  sbox.simple_commit(message="Conflicting change on iota")
+
+  # r7: backport branch
+  sbox.simple_update()
+  sbox.simple_copy('branch', 'subversion/branches/r4')
+  sbox.simple_commit(message='Create a backport branch')
+
+  # r8: merge into backport branch
+  sbox.simple_update()
+  svntest.main.run_svn(None, 'merge', '--record-only', '-c4',
+                       '^/subversion/trunk', 
sbox.ospath('subversion/branches/r4'))
+  sbox.simple_mkdir('subversion/branches/r4/A_resolved')
+  sbox.simple_append('subversion/branches/r4/iota', "resolved\n", truncate=1)
+  sbox.simple_commit(message='Conflict resolution via mkdir')
+
+  # r9: nominate r4,r5 with branch that contains not all of them
+  approved_entries = [
+    make_entry([4,5], branch="r4")
+  ]
+  sbox.simple_append(STATUS, serialize_STATUS(approved_entries))
+  sbox.simple_commit(message='Nominate r4')
+
+  # Run it.
+  exit_code, output, errput = run_backport(sbox, error_expected=True)
+
+  # Verify the error message.
+  expected_errput = svntest.verify.RegexOutput(
+    ".*Revisions 'r5' nominated but not included in branch",
+    match_all=False,
+  )
+  svntest.verify.verify_outputs(None, output, errput,
+                                [], expected_errput)
+  svntest.verify.verify_exit_code(None, exit_code, 1)
+
+  # Verify no commit occurred.
+  svntest.actions.run_and_verify_svnlook(["9\n"], [],
+                                         'youngest', sbox.repo_dir)
+
+  # Verify the working copy has been reverted.
+  svntest.actions.run_and_verify_svn([], [], 'status', '-q',
+                                     sbox.repo_dir)
+
+  # The sibling test backport_branches() verifies the success mode.
+
+
+
+
+#----------------------------------------------------------------------
 
 ########################################################################
 # Run the tests
@@ -411,6 +467,7 @@ test_list = [ None,
               backport_branches,
               backport_multirevisions,
               backport_conflicts_detection,
+              backport_branch_contains,
               # When adding a new test, include the test number in the last
               # 6 bytes of the UUID.
              ]


Reply via email to