subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v...@apache.org
Subject svn commit: r1426654 [4/7] - in /subversion/branches/javahl-ra: ./ build/ build/ac-macros/ subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/cxxhl/src/ subversion/bindings/cxxhl/tests/ subversion/include/ subversion/include/private/ subve...
Date Fri, 28 Dec 2012 23:03:53 GMT
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_pristine.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_pristine.c Fri Dec 28 23:03:51 2012
@@ -288,20 +288,6 @@ svn_wc__db_pristine_get_tempdir(const ch
 }
 
 
-/* Data for pristine_install_txn(). */
-typedef struct pristine_install_baton_t
-{
-  /* The path to the source file that is to be moved into place. */
-  const char *tempfile_abspath;
-  /* The target path for the file (within the pristine store). */
-  const char *pristine_abspath;
-  /* The pristine text's SHA-1 checksum. */
-  const svn_checksum_t *sha1_checksum;
-  /* The pristine text's MD-5 checksum. */
-  const svn_checksum_t *md5_checksum;
-} pristine_install_baton_t;
-
-
 /* Install the pristine text described by BATON into the pristine store of
  * SDB.  If it is already stored then just delete the new file
  * BATON->tempfile_abspath.
@@ -312,11 +298,17 @@ typedef struct pristine_install_baton_t
  * Implements 'notes/wc-ng/pristine-store' section A-3(a).
  * Implements svn_sqlite__transaction_callback_t. */
 static svn_error_t *
-pristine_install_txn(void *baton,
-                     svn_sqlite__db_t *sdb,
+pristine_install_txn(svn_sqlite__db_t *sdb,
+                     /* The path to the source file that is to be moved into place. */
+                     const char *tempfile_abspath,
+                     /* The target path for the file (within the pristine store). */
+                     const char *pristine_abspath,
+                     /* The pristine text's SHA-1 checksum. */
+                     const svn_checksum_t *sha1_checksum,
+                     /* The pristine text's MD-5 checksum. */
+                     const svn_checksum_t *md5_checksum,
                      apr_pool_t *scratch_pool)
 {
-  pristine_install_baton_t *b = baton;
   apr_finfo_t finfo;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
@@ -325,7 +317,7 @@ pristine_install_txn(void *baton,
   /* If this pristine text is already present in the store, just keep it:
    * delete the new one and return. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, b->sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
   if (have_row)
@@ -335,30 +327,30 @@ pristine_install_txn(void *baton,
        * ### We could check much more. */
       {
         apr_finfo_t finfo1, finfo2;
-        SVN_ERR(svn_io_stat(&finfo1, b->tempfile_abspath, APR_FINFO_SIZE,
+        SVN_ERR(svn_io_stat(&finfo1, tempfile_abspath, APR_FINFO_SIZE,
                             scratch_pool));
-        SVN_ERR(svn_io_stat(&finfo2, b->pristine_abspath, APR_FINFO_SIZE,
+        SVN_ERR(svn_io_stat(&finfo2, pristine_abspath, APR_FINFO_SIZE,
                             scratch_pool));
         if (finfo1.size != finfo2.size)
           {
             return svn_error_createf(
               SVN_ERR_WC_CORRUPT_TEXT_BASE, NULL,
               _("New pristine text '%s' has different size: %ld versus %ld"),
-              svn_checksum_to_cstring_display(b->sha1_checksum, scratch_pool),
+              svn_checksum_to_cstring_display(sha1_checksum, scratch_pool),
               (long int)finfo1.size, (long int)finfo2.size);
           }
       }
 #endif
 
       /* Remove the temp file: it's already there */
-      SVN_ERR(svn_io_remove_file2(b->tempfile_abspath,
+      SVN_ERR(svn_io_remove_file2(tempfile_abspath,
                                   FALSE /* ignore_enoent */, scratch_pool));
       return SVN_NO_ERROR;
     }
 
   /* Move the file to its target location.  (If it is already there, it is
    * an orphan file and it doesn't matter if we overwrite it.) */
-  err = svn_io_file_rename(b->tempfile_abspath, b->pristine_abspath,
+  err = svn_io_file_rename(tempfile_abspath, pristine_abspath,
                            scratch_pool);
 
   /* Maybe the directory doesn't exist yet? */
@@ -366,7 +358,7 @@ pristine_install_txn(void *baton,
     {
       svn_error_t *err2;
 
-      err2 = svn_io_dir_make(svn_dirent_dirname(b->pristine_abspath,
+      err2 = svn_io_dir_make(svn_dirent_dirname(pristine_abspath,
                                                 scratch_pool),
                              APR_OS_DEFAULT, scratch_pool);
 
@@ -377,19 +369,19 @@ pristine_install_txn(void *baton,
         /* We could create a directory: retry install */
         svn_error_clear(err);
 
-      SVN_ERR(svn_io_file_rename(b->tempfile_abspath, b->pristine_abspath,
+      SVN_ERR(svn_io_file_rename(tempfile_abspath, pristine_abspath,
                            scratch_pool));
     }
   else
     SVN_ERR(err);
 
-  SVN_ERR(svn_io_stat(&finfo, b->pristine_abspath, APR_FINFO_SIZE,
+  SVN_ERR(svn_io_stat(&finfo, pristine_abspath, APR_FINFO_SIZE,
                       scratch_pool));
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     STMT_INSERT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, b->sha1_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 2, b->md5_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 2, md5_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__bind_int64(stmt, 3, finfo.size));
   SVN_ERR(svn_sqlite__insert(NULL, stmt));
 
@@ -407,7 +399,7 @@ svn_wc__db_pristine_install(svn_wc__db_t
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
   const char *wri_abspath;
-  struct pristine_install_baton_t b;
+  const char *pristine_abspath;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(tempfile_abspath));
   SVN_ERR_ASSERT(sha1_checksum != NULL);
@@ -429,19 +421,18 @@ svn_wc__db_pristine_install(svn_wc__db_t
                               wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  b.tempfile_abspath = tempfile_abspath;
-  b.sha1_checksum = sha1_checksum;
-  b.md5_checksum = md5_checksum;
-
-  SVN_ERR(get_pristine_fname(&b.pristine_abspath, wcroot->abspath,
+  SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
                              sha1_checksum,
                              scratch_pool, scratch_pool));
 
   /* Ensure the SQL txn has at least a 'RESERVED' lock before we start looking
    * at the disk, to ensure no concurrent pristine install/delete txn. */
-  SVN_ERR(svn_sqlite__with_immediate_transaction(wcroot->sdb,
-                                                 pristine_install_txn, &b,
-                                                 scratch_pool));
+  SVN_SQLITE__WITH_IMMEDIATE_TXN(
+    pristine_install_txn(wcroot->sdb,
+                         tempfile_abspath, pristine_abspath,
+                         sha1_checksum, md5_checksum,
+                         scratch_pool),
+    wcroot->sdb);
 
   return SVN_NO_ERROR;
 }
@@ -531,8 +522,15 @@ struct pristine_transfer_baton
   svn_cancel_func_t cancel_func;
   void * cancel_baton;
 
-  /* pristine install baton, filled from pristine_transfer() */
-  struct pristine_install_baton_t ib;
+  /* The following fields are filled in by pristine_transfer(). */
+  /* The path to the source file that is to be moved into place. */
+  const char *tempfile_abspath;
+  /* The target path for the file (within the pristine store). */
+  const char *pristine_abspath;
+  /* The pristine text's SHA-1 checksum. */
+  const svn_checksum_t *sha1_checksum;
+  /* The pristine text's MD-5 checksum. */
+  const svn_checksum_t *md5_checksum;
 };
 
 /* Transaction implementation of svn_wc__db_pristine_transfer().
@@ -555,8 +553,12 @@ pristine_transfer(void *baton, svn_wc__d
                                   pristine_transfer, tb, scratch_pool));
 
       /* And do the final install, while we still have the dst lock */
-      if (tb->ib.tempfile_abspath)
-        SVN_ERR(pristine_install_txn(&(tb->ib), tb->dst_wcroot->sdb,
+      if (tb->tempfile_abspath)
+        SVN_ERR(pristine_install_txn(tb->dst_wcroot->sdb,
+                                     tb->tempfile_abspath,
+                                     tb->pristine_abspath,
+                                     tb->sha1_checksum,
+                                     tb->md5_checksum,
                                      scratch_pool));
       return SVN_NO_ERROR;
     }
@@ -564,7 +566,7 @@ pristine_transfer(void *baton, svn_wc__d
   /* We have a lock on tb->dst_wcroot and tb->src_wcroot */
 
   /* Get the right checksum if it wasn't passed */
-  if (!tb->ib.sha1_checksum)
+  if (!tb->sha1_checksum)
     {
       SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
                                         STMT_SELECT_NODE_INFO));
@@ -575,19 +577,19 @@ pristine_transfer(void *baton, svn_wc__d
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
       if (have_row)
-        SVN_ERR(svn_sqlite__column_checksum(&(tb->ib.sha1_checksum), stmt, 6,
+        SVN_ERR(svn_sqlite__column_checksum(&(tb->sha1_checksum), stmt, 6,
                                             scratch_pool));
 
       SVN_ERR(svn_sqlite__reset(stmt));
 
-      if (!tb->ib.sha1_checksum)
+      if (!tb->sha1_checksum)
         return SVN_NO_ERROR; /* Nothing to transfer */
     }
 
   /* Check if we have the pristine in the destination wcroot */
   SVN_ERR(svn_sqlite__get_statement(&stmt, tb->dst_wcroot->sdb,
                                     STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->ib.sha1_checksum,
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->sha1_checksum,
                                     scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
@@ -599,7 +601,7 @@ pristine_transfer(void *baton, svn_wc__d
   /* Verify if the pristine actually exists and get the MD5 in one query */
   SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
                                     STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->ib.sha1_checksum,
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->sha1_checksum,
                                     scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
@@ -609,9 +611,9 @@ pristine_transfer(void *baton, svn_wc__d
                                _("The pristine text with checksum '%s' was "
                                  "not found"),
                                svn_checksum_to_cstring_display(
-                                        tb->ib.sha1_checksum, scratch_pool));
+                                        tb->sha1_checksum, scratch_pool));
     }
-  SVN_ERR(svn_sqlite__column_checksum(&(tb->ib.md5_checksum), stmt, 0,
+  SVN_ERR(svn_sqlite__column_checksum(&(tb->md5_checksum), stmt, 0,
                                       scratch_pool));
   SVN_ERR(svn_sqlite__reset(stmt));
 
@@ -631,7 +633,7 @@ pristine_transfer(void *baton, svn_wc__d
                                    scratch_pool, scratch_pool));
 
     SVN_ERR(get_pristine_fname(&src_abspath, tb->src_wcroot->abspath,
-                               tb->ib.sha1_checksum,
+                               tb->sha1_checksum,
                                scratch_pool, scratch_pool));
 
     SVN_ERR(svn_stream_open_readonly(&src_stream, src_abspath,
@@ -645,11 +647,11 @@ pristine_transfer(void *baton, svn_wc__d
     /* And now set the right information to install once we leave the
        src transaction */
 
-    SVN_ERR(get_pristine_fname(&(tb->ib.pristine_abspath),
+    SVN_ERR(get_pristine_fname(&(tb->pristine_abspath),
                                tb->dst_wcroot->abspath,
-                               tb->ib.sha1_checksum,
+                               tb->sha1_checksum,
                                scratch_pool, scratch_pool));
-    tb->ib.tempfile_abspath = tmp_abspath;
+    tb->tempfile_abspath = tmp_abspath;
   }
   return SVN_NO_ERROR;
 }
@@ -730,17 +732,8 @@ remove_file(const char *file_abspath,
   return SVN_NO_ERROR;
 }
 
-/* Data for pristine_remove_if_unreferenced_txn(). */
-typedef struct pristine_remove_baton_t
-{
-  svn_wc__db_wcroot_t *wcroot;
-  /* The pristine text's SHA-1 checksum. */
-  const svn_checksum_t *sha1_checksum;
-  /* The path to the pristine file (within the pristine store). */
-  const char *pristine_abspath;
-} pristine_remove_baton_t;
-
-/* If the pristine text referenced by BATON in SDB has a reference count of
+/* If the pristine text referenced by SHA1_CHECKSUM in WCROOT/SDB, whose path
+ * within the pristine store is PRISTINE_ABSPATH, has a reference count of
  * zero, delete it (both the database row and the disk file).
  *
  * This function expects to be executed inside a SQLite txn that has already
@@ -748,18 +741,19 @@ typedef struct pristine_remove_baton_t
  *
  * Implements svn_sqlite__transaction_callback_t. */
 static svn_error_t *
-pristine_remove_if_unreferenced_txn(void *baton,
-                                    svn_sqlite__db_t *sdb,
+pristine_remove_if_unreferenced_txn(svn_sqlite__db_t *sdb,
+                                    svn_wc__db_wcroot_t *wcroot,
+                                    const svn_checksum_t *sha1_checksum,
+                                    const char *pristine_abspath,
                                     apr_pool_t *scratch_pool)
 {
-  pristine_remove_baton_t *b = baton;
   svn_sqlite__stmt_t *stmt;
   int affected_rows;
 
   /* Remove the DB row, if refcount is 0. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                     STMT_DELETE_PRISTINE_IF_UNREFERENCED));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, b->sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
 
   /* If we removed the DB row, then remove the file. */
@@ -774,7 +768,7 @@ pristine_remove_if_unreferenced_txn(void
       svn_boolean_t ignore_enoent = TRUE;
 #endif
 
-      SVN_ERR(remove_file(b->pristine_abspath, b->wcroot, ignore_enoent,
+      SVN_ERR(remove_file(pristine_abspath, wcroot, ignore_enoent,
                           scratch_pool));
     }
 
@@ -791,17 +785,17 @@ pristine_remove_if_unreferenced(svn_wc__
                                 const svn_checksum_t *sha1_checksum,
                                 apr_pool_t *scratch_pool)
 {
-  pristine_remove_baton_t b;
+  const char *pristine_abspath;
 
-  b.wcroot = wcroot;
-  b.sha1_checksum = sha1_checksum;
-  SVN_ERR(get_pristine_fname(&b.pristine_abspath, wcroot->abspath,
+  SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
                              sha1_checksum, scratch_pool, scratch_pool));
 
   /* Ensure the SQL txn has at least a 'RESERVED' lock before we start looking
    * at the disk, to ensure no concurrent pristine install/delete txn. */
-  SVN_ERR(svn_sqlite__with_immediate_transaction(
-    wcroot->sdb, pristine_remove_if_unreferenced_txn, &b, scratch_pool));
+  SVN_SQLITE__WITH_IMMEDIATE_TXN(
+    pristine_remove_if_unreferenced_txn(
+      wcroot->sdb, wcroot, sha1_checksum, pristine_abspath, scratch_pool),
+    wcroot->sdb);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_update_move.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_update_move.c Fri Dec 28 23:03:51 2012
@@ -23,13 +23,50 @@
 
 /* This editor is used during resolution of tree conflicts.
  *
- * An operation such as update can produce incoming changes for a
- * locally moved-away subtree, causing a tree-conflict to be flagged.
+ * When an update (or switch) produces incoming changes for a locally
+ * moved-away subtree, it updates the base nodes of the moved-away tree
+ * and flags a tree-conflict on the moved-away root node.
  * This editor transfers these changes from the moved-away part of the
  * working copy to the corresponding moved-here part of the working copy.
  *
  * Both the driver and receiver components of the editor are implemented
  * in this file.
+ *
+ * The driver sees two NODES trees: the move source tree and the move
+ * destination tree.  When the move is initially made these trees are
+ * equivalent, the destination is a copy of the source.  The source is
+ * a single-op-depth, single-revision, deleted layer [1] and the
+ * destination has an equivalent single-op-depth, single-revision
+ * layer. The destination may have additional higher op-depths
+ * representing adds, deletes, moves within the move destination. [2]
+ *
+ * After the intial move an update, or this editor for trees that have
+ * been moved more than once, has modified the NODES in the move
+ * source, and introduced a tree-conflict since the source and
+ * destination trees are no longer equivalent.  The source is a
+ * different revision and may have text, property and tree changes
+ * compared to the destination.  The driver will compare the two NODES
+ * trees and drive an editor to change the destination tree so that it
+ * once again matches the source tree.  Changes made to the
+ * destination NODES tree to achieve this match will be merged into
+ * the working files/directories.
+ *
+ * The whole drive occurs as one single wc.db transaction.  At the end
+ * of the transaction the destination NODES table should have a layer
+ * that is equivalent to the source NODES layer, there should be
+ * workqueue items to make any required changes to working
+ * files/directories in the move destination, and there should be
+ * tree-conflicts in the move destination where it was not possible to
+ * update the working files/directories.
+ *
+ * [1] The move source tree is single-revision because we currently do
+ *     not allow a mixed-rev move, and therefore it is single op-depth
+ *     regardless whether it is a base layer or a nested move.
+ *
+ * [2] The source tree also may have additional higher op-depths,
+ *     representing a replacement, but this editor only reads from the
+ *     single-op-depth layer of it, and makes no changes of any kind
+ *     within the source tree.
  */
 
 #define SVN_WC__I_AM_WC_DB
@@ -75,6 +112,119 @@ struct tc_editor_baton {
   apr_pool_t *result_pool;
 };
 
+/* If LOCAL_RELPATH is shadowed then raise a tree-conflict on the root
+   of the obstruction if such a tree-conflict does not already exist. */
+static svn_error_t *
+check_tree_conflict(svn_boolean_t *is_conflicted,
+                    struct tc_editor_baton *b,
+                    const char *local_relpath,
+                    svn_node_kind_t kind,
+                    apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt;
+  svn_boolean_t have_row;
+  int dst_op_depth = relpath_depth(b->move_root_dst_relpath);
+  int op_depth;
+  const char *conflict_root_relpath = local_relpath;
+  const char *moved_to_relpath;
+  svn_skel_t *conflict;
+  svn_wc_conflict_version_t *version;
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
+                                    STMT_SELECT_LOWEST_WORKING_NODE));
+  SVN_ERR(svn_sqlite__bindf(stmt, "isd", b->wcroot->wc_id, local_relpath,
+                            dst_op_depth));
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+  if (have_row)
+    op_depth = svn_sqlite__column_int(stmt, 0);
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  if (!have_row)
+    {
+      *is_conflicted = FALSE;
+      return SVN_NO_ERROR;
+    }
+
+  *is_conflicted = TRUE;
+
+  while (relpath_depth(conflict_root_relpath) > op_depth)
+    conflict_root_relpath = svn_relpath_dirname(conflict_root_relpath,
+                                                scratch_pool);
+
+  SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, b->wcroot,
+                                            conflict_root_relpath,
+                                            scratch_pool, scratch_pool));
+
+  if (conflict)
+    /* ### TODO: check this is the right sort of tree-conflict? */
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__db_scan_deletion_internal(NULL, &moved_to_relpath,
+                                            NULL, NULL,
+                                            b->wcroot, conflict_root_relpath,
+                                            scratch_pool, scratch_pool));
+
+  conflict = svn_wc__conflict_skel_create(scratch_pool);
+  SVN_ERR(svn_wc__conflict_skel_add_tree_conflict(
+                     conflict, NULL,
+                     svn_dirent_join(b->wcroot->abspath, conflict_root_relpath,
+                                     scratch_pool),
+                     (moved_to_relpath
+                      ? svn_wc_conflict_reason_moved_away
+                      : svn_wc_conflict_reason_deleted),
+                     svn_wc_conflict_action_edit,
+                     scratch_pool,
+                     scratch_pool));
+
+  version = svn_wc_conflict_version_create2(b->old_version->repos_url,
+                                            b->old_version->repos_uuid,
+                                            local_relpath,
+                                            b->old_version->peg_rev,
+                                            kind,
+                                            scratch_pool);
+
+  SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict, version,
+                                              scratch_pool, scratch_pool));
+  SVN_ERR(svn_wc__db_mark_conflict_internal(b->wcroot, conflict_root_relpath,
+                                            conflict, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+/* Mark a unversioned-add tree-conflict on RELPATH. */
+static svn_error_t *
+mark_unversioned_add_conflict(struct tc_editor_baton *b,
+                              const char *relpath,
+                              svn_node_kind_t kind,
+                              apr_pool_t *scratch_pool)
+{
+  svn_skel_t *conflict = svn_wc__conflict_skel_create(scratch_pool);
+  svn_wc_conflict_version_t *version;
+
+  SVN_ERR(svn_wc__conflict_skel_add_tree_conflict(
+                     conflict, NULL,
+                     svn_dirent_join(b->wcroot->abspath, relpath,
+                                     scratch_pool),
+                     svn_wc_conflict_reason_unversioned,
+                     svn_wc_conflict_action_add,
+                     scratch_pool,
+                     scratch_pool));
+
+  version = svn_wc_conflict_version_create2(b->old_version->repos_url,
+                                            b->old_version->repos_uuid,
+                                            relpath,
+                                            b->old_version->peg_rev,
+                                            kind,
+                                            scratch_pool);
+
+  SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict, version,
+                                              scratch_pool, scratch_pool));
+  SVN_ERR(svn_wc__db_mark_conflict_internal(b->wcroot, relpath,
+                                            conflict, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 static svn_error_t *
 tc_editor_add_directory(void *baton,
                         const char *relpath,
@@ -85,11 +235,44 @@ tc_editor_add_directory(void *baton,
 {
   struct tc_editor_baton *b = baton;
   int op_depth = relpath_depth(b->move_root_dst_relpath);
+  svn_boolean_t is_conflicted;
+  const char *abspath;
+  svn_node_kind_t kind;
+  svn_skel_t *work_item;
 
+  /* Update NODES, only the bits not covered by the later call to
+     replace_moved_layer. */
   SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_kind_dir,
                                           op_depth, scratch_pool));
 
-  /* ### TODO check for, and flag, tree conflict */
+  /* Check for NODES tree-conflict. */
+  SVN_ERR(check_tree_conflict(&is_conflicted, b, relpath, svn_node_dir,
+                              scratch_pool));
+  if (is_conflicted)
+    return SVN_NO_ERROR;
+
+  /* Check for unversioned tree-conflict */
+  abspath = svn_dirent_join(b->wcroot->abspath, relpath, scratch_pool);
+  SVN_ERR(svn_io_check_path(abspath, &kind, scratch_pool));
+
+  switch (kind)
+    {
+    case svn_node_file:
+    default:
+      SVN_ERR(mark_unversioned_add_conflict(b, relpath, svn_node_dir,
+                                            scratch_pool));
+      break;
+
+    case svn_node_none:
+      SVN_ERR(svn_wc__wq_build_dir_install(&work_item, b->db, abspath,
+                                           scratch_pool, b->result_pool));
+
+      SVN_ERR(svn_wc__db_wq_add(b->db, b->wcroot->abspath, work_item,
+                                scratch_pool));
+      /* Fall through */
+    case svn_node_dir:
+      break;
+    }
 
   return SVN_NO_ERROR;
 }
@@ -105,11 +288,45 @@ tc_editor_add_file(void *baton,
 {
   struct tc_editor_baton *b = baton;
   int op_depth = relpath_depth(b->move_root_dst_relpath);
+  svn_boolean_t is_conflicted;
+  const char *abspath;
+  svn_node_kind_t kind;
+  svn_skel_t *work_item;
 
+  /* Update NODES, only the bits not covered by the later call to
+     replace_moved_layer. */
   SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_kind_file,
                                           op_depth, scratch_pool));
 
-  /* ### TODO check for, and flag, tree conflict */
+  /* Check for NODES tree-conflict. */
+  SVN_ERR(check_tree_conflict(&is_conflicted, b, relpath, svn_node_file,
+                              scratch_pool));
+  if (is_conflicted)
+    return SVN_NO_ERROR;
+
+  /* Check for unversioned tree-conflict */
+  abspath = svn_dirent_join(b->wcroot->abspath, relpath, scratch_pool);
+  SVN_ERR(svn_io_check_path(abspath, &kind, scratch_pool));
+
+  if (kind != svn_node_none)
+    {
+      SVN_ERR(mark_unversioned_add_conflict(b, relpath, svn_node_file,
+                                            scratch_pool));
+      return SVN_NO_ERROR;
+    }
+
+  /* Update working file. */
+  SVN_ERR(svn_wc__wq_build_file_install(&work_item, b->db,
+                                        svn_dirent_join(b->wcroot->abspath,
+                                                        relpath,
+                                                        scratch_pool),
+                                        NULL,
+                                        FALSE /* FIXME: use_commit_times? */,
+                                        TRUE  /* record_file_info */,
+                                        scratch_pool, b->result_pool));
+
+  SVN_ERR(svn_wc__db_wq_add(b->db, b->wcroot->abspath, work_item,
+                            scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -220,69 +437,6 @@ update_working_props(svn_wc_notify_state
 }
 
 
-/* If LOCAL_ABSPATH is shadowed then raise a tree-conflict on the root
-   of the obstruction if such a tree-conflict does not already exist. */
-static svn_error_t *
-check_tree_conflict(svn_boolean_t *is_conflicted,
-                    struct tc_editor_baton *b,
-                    const char *local_relpath,
-                    apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-  int dst_op_depth = relpath_depth(b->move_root_dst_relpath);
-  int op_depth;
-  const char *conflict_root_relpath = local_relpath;
-  svn_skel_t *conflict;
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
-                                    STMT_SELECT_LOWEST_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isd", b->wcroot->wc_id, local_relpath,
-                            dst_op_depth));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  if (have_row)
-    op_depth = svn_sqlite__column_int(stmt, 0);
-  SVN_ERR(svn_sqlite__reset(stmt));
-
-  if (!have_row)
-    {
-      *is_conflicted = FALSE;
-      return SVN_NO_ERROR;
-    }
-
-  *is_conflicted = TRUE;
-
-  while (relpath_depth(conflict_root_relpath) > op_depth)
-    conflict_root_relpath = svn_relpath_dirname(conflict_root_relpath,
-                                                scratch_pool);
-
-  SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, b->wcroot,
-                                            conflict_root_relpath,
-                                            scratch_pool, scratch_pool));
-
-  if (conflict)
-    /* ### TODO: check this is the right sort of tree-conflict? */
-    return SVN_NO_ERROR;
-
-  conflict = svn_wc__conflict_skel_create(scratch_pool);
-  SVN_ERR(svn_wc__conflict_skel_add_tree_conflict(
-                     conflict, NULL,
-                     svn_dirent_join(b->wcroot->abspath, conflict_root_relpath,
-                                     scratch_pool),
-                     svn_wc_conflict_reason_moved_away,
-                     svn_wc_conflict_action_edit,
-                     scratch_pool,
-                     scratch_pool));
-
-  SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict, b->old_version,
-                                              scratch_pool, scratch_pool));
-  SVN_ERR(svn_wc__db_mark_conflict_internal(b->wcroot, conflict_root_relpath,
-                                            conflict, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-
 static svn_error_t *
 tc_editor_alter_directory(void *baton,
                           const char *dst_relpath,
@@ -301,7 +455,8 @@ tc_editor_alter_directory(void *baton,
 
   SVN_ERR_ASSERT(expected_move_dst_revision == b->old_version->peg_rev);
 
-  SVN_ERR(check_tree_conflict(&is_conflicted, b, dst_relpath, scratch_pool));
+  SVN_ERR(check_tree_conflict(&is_conflicted, b, dst_relpath, svn_node_dir,
+                              scratch_pool));
   if (is_conflicted)
     return SVN_NO_ERROR;
 
@@ -521,7 +676,8 @@ tc_editor_alter_file(void *baton,
   working_node_version_t old_version, new_version;
   svn_boolean_t is_conflicted;
 
-  SVN_ERR(check_tree_conflict(&is_conflicted, b, dst_relpath, scratch_pool));
+  SVN_ERR(check_tree_conflict(&is_conflicted, b, dst_relpath, svn_node_file,
+                              scratch_pool));
   if (is_conflicted)
     return SVN_NO_ERROR;
 
@@ -880,6 +1036,7 @@ update_moved_away_file(svn_editor_t *tc_
 static svn_error_t *
 update_moved_away_dir(svn_editor_t *tc_editor,
                       svn_boolean_t add,
+                      apr_hash_t *children_hash,
                       const char *src_relpath,
                       const char *dst_relpath,
                       int src_op_depth,
@@ -889,35 +1046,25 @@ update_moved_away_dir(svn_editor_t *tc_e
                       svn_wc__db_wcroot_t *wcroot,
                       apr_pool_t *scratch_pool)
 {
-  apr_hash_t *children_hash;
   apr_array_header_t *new_children;
   apr_hash_t *new_props;
   const char *src_abspath = svn_dirent_join(wcroot->abspath,
                                             src_relpath,
                                             scratch_pool);
 
-  if (add)
-    {
-      /* ### TODO children and props */
-      SVN_ERR(svn_editor_add_directory(tc_editor, dst_relpath,
-                                       apr_array_make(scratch_pool, 0,
-                                                      sizeof (const char *)),
-                                       apr_hash_make(scratch_pool),
-                                       move_root_dst_revision));
-      return SVN_NO_ERROR;
-    }
-
-  SVN_ERR(svn_wc__db_get_children_op_depth(&children_hash, wcroot,
-                                           src_relpath, src_op_depth,
-                                           scratch_pool, scratch_pool));
   SVN_ERR(svn_hash_keys(&new_children, children_hash, scratch_pool));
 
   SVN_ERR(svn_wc__db_read_pristine_props(&new_props, db, src_abspath,
                                          scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_editor_alter_directory(tc_editor, dst_relpath,
-                                     move_root_dst_revision,
-                                     new_children, new_props));
+  if (add)
+    SVN_ERR(svn_editor_add_directory(tc_editor, dst_relpath,
+                                     new_children, new_props,
+                                     move_root_dst_revision));
+  else
+    SVN_ERR(svn_editor_alter_directory(tc_editor, dst_relpath,
+                                       move_root_dst_revision,
+                                       new_children, new_props));
 
   return SVN_NO_ERROR;
 }
@@ -940,14 +1087,16 @@ update_moved_away_subtree(svn_editor_t *
   apr_pool_t *iterpool;
   apr_hash_index_t *hi;
 
-  SVN_ERR(update_moved_away_dir(tc_editor, add, src_relpath, dst_relpath,
+  SVN_ERR(svn_wc__db_get_children_op_depth(&src_children, wcroot,
+                                           src_relpath, src_op_depth,
+                                           scratch_pool, scratch_pool));
+
+  SVN_ERR(update_moved_away_dir(tc_editor, add, src_children,
+                                src_relpath, dst_relpath,
                                 src_op_depth, move_root_dst_relpath,
                                 move_root_dst_revision,
                                 db, wcroot, scratch_pool));
 
-  SVN_ERR(svn_wc__db_get_children_op_depth(&src_children, wcroot,
-                                           src_relpath, src_op_depth,
-                                           scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__db_get_children_op_depth(&dst_children, wcroot,
                                            dst_relpath,
                                            relpath_depth(move_root_dst_relpath),

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.c Fri Dec 28 23:03:51 2012
@@ -50,6 +50,7 @@
 #define OP_SYNC_FILE_FLAGS "sync-file-flags"
 #define OP_PREJ_INSTALL "prej-install"
 #define OP_DIRECTORY_REMOVE "dir-remove"
+#define OP_DIRECTORY_INSTALL "dir-install"
 
 #define OP_POSTUPGRADE "postupgrade"
 
@@ -1016,6 +1017,51 @@ svn_wc__wq_build_file_copy_translated(sv
   return SVN_NO_ERROR;
 }
 
+/* ------------------------------------------------------------------------ */
+
+/* OP_DIRECTORY_INSTALL  */
+
+static svn_error_t *
+run_dir_install(svn_wc__db_t *db,
+                    const svn_skel_t *work_item,
+                    const char *wri_abspath,
+                    svn_cancel_func_t cancel_func,
+                    void *cancel_baton,
+                    apr_pool_t *scratch_pool)
+{
+  const svn_skel_t *arg1 = work_item->children->next;
+  const char *local_relpath;
+  const char *local_abspath;
+
+  local_relpath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+  SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
+                                  local_relpath, scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_wc__ensure_directory(local_abspath, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__wq_build_dir_install(svn_skel_t **work_item,
+                             svn_wc__db_t *db,
+                             const char *local_abspath,
+                             apr_pool_t *scratch_pool,
+                             apr_pool_t *result_pool)
+{
+  const char *local_relpath;
+
+  *work_item = svn_skel__make_empty_list(result_pool);
+
+  SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
+                                local_abspath, result_pool, scratch_pool));
+  svn_skel__prepend_str(local_relpath, *work_item, result_pool);
+
+  svn_skel__prepend_str(OP_DIRECTORY_INSTALL, *work_item, result_pool);
+
+  return SVN_NO_ERROR;
+}
+
 
 /* ------------------------------------------------------------------------ */
 
@@ -1370,6 +1416,7 @@ static const struct work_item_dispatch d
   { OP_SYNC_FILE_FLAGS, run_sync_file_flags },
   { OP_PREJ_INSTALL, run_prej_install },
   { OP_DIRECTORY_REMOVE, run_dir_remove },
+  { OP_DIRECTORY_INSTALL, run_dir_install },
 
   /* Upgrade steps */
   { OP_POSTUPGRADE, run_postupgrade },

Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.h?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.h Fri Dec 28 23:03:51 2012
@@ -215,6 +215,14 @@ svn_wc__wq_build_file_commit(svn_skel_t 
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool);
 
+/* Set *WORK_ITEM to a new work item that will install the working
+   copy directory at LOCAL_ABSPATH. */
+svn_error_t *
+svn_wc__wq_build_dir_install(svn_skel_t **work_item,
+                             svn_wc__db_t *db,
+                             const char *local_abspath,
+                             apr_pool_t *scratch_pool,
+                             apr_pool_t *result_pool);
 
 svn_error_t *
 svn_wc__wq_build_postupgrade(svn_skel_t **work_item,

Modified: subversion/branches/javahl-ra/subversion/mod_authz_svn/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/mod_authz_svn/INSTALL?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/mod_authz_svn/INSTALL (original)
+++ subversion/branches/javahl-ra/subversion/mod_authz_svn/INSTALL Fri Dec 28 23:03:51 2012
@@ -100,6 +100,50 @@ II.   Configuration
          NOTE: AuthzSVNReposRelativeAccessFile filename causes the authz file
          to be read from <repo path>/conf/<filename>
 
+      E. Example 5: Authz file stored in a Subversion repository
+
+         This configuration allows storing of the authz file in a repository.
+
+         <Location /svn>
+           DAV svn
+           SVNParentPath /path/to/reposparent
+
+           AuthType Basic
+           AuthName "Subversion repository"
+           AuthUserFile /path/to/htpasswd/file
+
+           AuthzSVNAccessFile file:///path/to/repos/authz
+
+           Require valid-user
+         </Location>
+
+         NOTE: http:// and svn:// URLs are not supported, only local file://
+         absolute URLs may be used.  The URL does not have to point to the
+         same repository as the repository being accessed.  If you wish to 
+         restrict access to this authz file and it is in the same repository
+         you should include a rule for it.
+
+      F. Example 5: Authz file stored inside the repository being accessed.
+
+         This configuration allows providing a relative path within the
+         repository being accessed.
+
+         <Location /svn>
+           DAV svn
+           SVNParentPath /path/to/reposparent
+
+           AuthType Basic
+           AuthName "Subversion repository"
+           AuthUserFile /path/to/htpasswd/file
+
+           AuthzSVNAccessFile ^/authz
+
+           Require valid-user
+         </Location>
+
+         NOTE: You should include rules in your authz file to restirct access
+         to the authz file as desired.  
+
    2. Specifying permissions
 
       The file format of the access file looks like this:

Modified: subversion/branches/javahl-ra/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/mod_authz_svn/mod_authz_svn.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/javahl-ra/subversion/mod_authz_svn/mod_authz_svn.c Fri Dec 28 23:03:51 2012
@@ -96,7 +96,10 @@ AuthzSVNAccessFile_cmd(cmd_parms *cmd, v
     return "AuthzSVNAccessFile and AuthzSVNReposRelativeAccessFile "
            "directives are mutually exclusive.";
 
-  conf->access_file = ap_server_root_relative(cmd->pool, arg1);
+  if (svn_path_is_repos_relative_url(arg1) || svn_path_is_url(arg1))
+    conf->access_file = arg1;
+  else
+    conf->access_file = ap_server_root_relative(cmd->pool, arg1);
 
   return NULL;
 }
@@ -130,13 +133,17 @@ static const command_rec authz_svn_cmds[
                 NULL,
                 OR_AUTHCFG,
                 "Path to text file containing permissions of repository "
-                "paths."),
+                "paths.  Path may be an repository relative URL (^/) or "
+                "absolute file:// URL to a text file in a Subversion "
+                "repository."),
   AP_INIT_TAKE1("AuthzSVNReposRelativeAccessFile",
                 AuthzSVNReposRelativeAccessFile_cmd,
                 NULL,
                 OR_AUTHCFG,
                 "Path (relative to repository 'conf' directory) to text "
-                "file containing permissions of repository paths. "),
+                "file containing permissions of repository paths. Path may "
+                "be an repository relative URL (^/) or absolute file:// URL "
+                "to a text file in a Subversion repository."),
   AP_INIT_FLAG("AuthzSVNAnonymous", ap_set_flag_slot,
                (void *)APR_OFFSETOF(authz_svn_config_rec, anonymous),
                OR_AUTHCFG,
@@ -161,6 +168,102 @@ static const command_rec authz_svn_cmds[
   { NULL }
 };
 
+
+/* The macros LOG_ARGS_SIGNATURE and LOG_ARGS_CASCADE are expanded as formal
+ * and actual parameters to log_access_verdict with respect to HTTPD version.
+ */
+#if AP_MODULE_MAGIC_AT_LEAST(20100606,0)
+#define LOG_ARGS_SIGNATURE const char *file, int line, int module_index
+#define LOG_ARGS_CASCADE file, line, module_index
+#else
+#define LOG_ARGS_SIGNATURE const char *file, int line
+#define LOG_ARGS_CASCADE file, line
+#endif
+
+/* Log a message indicating the access control decision made about a
+ * request.  The macro LOG_ARGS_SIGNATURE expands to FILE, LINE and
+ * MODULE_INDEX in HTTPD 2.3 as APLOG_MARK macro has been changed for
+ * per-module loglevel configuration.  It expands to FILE and LINE
+ * in older server versions.  ALLOWED is boolean.
+ * REPOS_PATH and DEST_REPOS_PATH are information
+ * about the request.  DEST_REPOS_PATH may be NULL. */
+static void
+log_access_verdict(LOG_ARGS_SIGNATURE,
+                   const request_rec *r, int allowed,
+                   const char *repos_path, const char *dest_repos_path)
+{
+  int level = allowed ? APLOG_INFO : APLOG_ERR;
+  const char *verdict = allowed ? "granted" : "denied";
+
+  if (r->user)
+    {
+      if (dest_repos_path)
+        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
+                      "Access %s: '%s' %s %s %s", verdict, r->user,
+                      r->method, repos_path, dest_repos_path);
+      else
+        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
+                      "Access %s: '%s' %s %s", verdict, r->user,
+                      r->method, repos_path);
+    }
+  else
+    {
+      if (dest_repos_path)
+        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
+                      "Access %s: - %s %s %s", verdict,
+                      r->method, repos_path, dest_repos_path);
+      else
+        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
+                      "Access %s: - %s %s", verdict,
+                      r->method, repos_path);
+    }
+}
+
+/* Log a message indiciating the ERR encountered during the request R.
+ * LOG_ARGS_SIGNATURE expands as in log_access_verdict() above.
+ * PREFIX is inserted at the start of the message.  The rest of the
+ * message is generated by combining the message for each error in the
+ * chain of ERR, excluding for trace errors.  ERR will be cleared
+ * when finished. */
+static void
+log_svn_error(LOG_ARGS_SIGNATURE,
+              request_rec *r, const char *prefix,
+              svn_error_t *err, apr_pool_t *scratch_pool)
+{
+  svn_error_t *err_pos = svn_error_purge_tracing(err);
+  svn_stringbuf_t *buff = svn_stringbuf_create(prefix, scratch_pool);
+
+  /* Build the error chain into a space separated stringbuf. */
+  while (err_pos)
+    {
+      svn_stringbuf_appendbyte(buff, ' ');
+      if (err_pos->message)
+        {
+          svn_stringbuf_appendcstr(buff, err_pos->message);
+        }
+      else
+        {
+          char strerr[256];
+          
+          svn_stringbuf_appendcstr(buff, svn_strerror(err->apr_err, strerr,
+                                                       sizeof(strerr)));
+        }
+
+      err_pos = err_pos->child;
+    }
+
+  ap_log_rerror(LOG_ARGS_CASCADE, APLOG_ERR,
+                /* If it is an error code that APR can make sense of, then
+                   show it, otherwise, pass zero to avoid putting "APR does
+                   not understand this error code" in the error log. */
+                ((err->apr_err >= APR_OS_START_USERERR &&
+                  err->apr_err < APR_OS_START_CANONERR) ?
+                 0 : err->apr_err),
+                r, "%s", buff->data);
+
+  svn_error_clear(err);
+}
+
 /*
  * Get the, possibly cached, svn_authz_t for this request.
  */
@@ -175,18 +278,24 @@ get_access_conf(request_rec *r, authz_sv
   svn_authz_t *access_conf = NULL;
   svn_error_t *svn_err;
   dav_error *dav_err;
-  char errbuf[256];
+
+  dav_err = dav_svn_get_repos_path(r, conf->base_path, &repos_path);
+  if (dav_err)
+    {
+      ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "%s", dav_err->desc);
+      return NULL;
+    }
 
   if (conf->repo_relative_access_file)
     {
-      dav_err = dav_svn_get_repos_path(r, conf->base_path, &repos_path);
-      if (dav_err) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "%s", dav_err->desc);
-        return NULL;
-      }
-      access_file = svn_dirent_join_many(scratch_pool, repos_path, "conf",
-                                         conf->repo_relative_access_file,
-                                         NULL);
+      access_file = conf->repo_relative_access_file;
+      if (!svn_path_is_repos_relative_url(access_file) &&
+          !svn_path_is_url(access_file))
+        {
+          access_file = svn_dirent_join_many(scratch_pool, repos_path, "conf",
+                                             conf->repo_relative_access_file,
+                                             NULL);
+        }
     }
   else
     {
@@ -202,21 +311,13 @@ get_access_conf(request_rec *r, authz_sv
   access_conf = user_data;
   if (access_conf == NULL)
     {
-      svn_err = svn_repos_authz_read(&access_conf, access_file,
-                                     TRUE, r->connection->pool);
+      svn_err = svn_repos_authz_read2(&access_conf, access_file,
+                                      TRUE, repos_path, r->connection->pool);
       if (svn_err)
         {
-          ap_log_rerror(APLOG_MARK, APLOG_ERR,
-                        /* If it is an error code that APR can make sense
-                           of, then show it, otherwise, pass zero to avoid
-                           putting "APR does not understand this error code"
-                           in the error log. */
-                        ((svn_err->apr_err >= APR_OS_START_USERERR &&
-                          svn_err->apr_err < APR_OS_START_CANONERR) ?
-                         0 : svn_err->apr_err),
-                        r, "Failed to load the AuthzSVNAccessFile: %s",
-                        svn_err_best_message(svn_err, errbuf, sizeof(errbuf)));
-          svn_error_clear(svn_err);
+          log_svn_error(APLOG_MARK, r,
+                        "Failed to load the AuthzSVNAccessFile:",
+                        svn_err, scratch_pool);
           access_conf = NULL;
         }
       else
@@ -285,7 +386,6 @@ req_check_access(request_rec *r,
   svn_boolean_t authz_access_granted = FALSE;
   svn_authz_t *access_conf = NULL;
   svn_error_t *svn_err;
-  char errbuf[256];
   const char *username_to_authorize = get_username_to_authorize(r, conf,
                                                                 r->pool);
 
@@ -458,19 +558,9 @@ req_check_access(request_rec *r,
                                              r->pool);
       if (svn_err)
         {
-          ap_log_rerror(APLOG_MARK, APLOG_ERR,
-                        /* If it is an error code that APR can make
-                           sense of, then show it, otherwise, pass
-                           zero to avoid putting "APR does not
-                           understand this error code" in the error
-                           log. */
-                        ((svn_err->apr_err >= APR_OS_START_USERERR &&
-                          svn_err->apr_err < APR_OS_START_CANONERR) ?
-                          0 : svn_err->apr_err),
-                         r, "Failed to perform access control: %s",
-                         svn_err_best_message(svn_err, errbuf,
-                                              sizeof(errbuf)));
-          svn_error_clear(svn_err);
+          log_svn_error(APLOG_MARK, r,
+                        "Failed to perform access control:",
+                        svn_err, r->pool);
 
           return DECLINED;
         }
@@ -505,17 +595,9 @@ req_check_access(request_rec *r,
                                              r->pool);
       if (svn_err)
         {
-          ap_log_rerror(APLOG_MARK, APLOG_ERR,
-                        /* If it is an error code that APR can make sense
-                           of, then show it, otherwise, pass zero to avoid
-                           putting "APR does not understand this error code"
-                           in the error log. */
-                        ((svn_err->apr_err >= APR_OS_START_USERERR &&
-                          svn_err->apr_err < APR_OS_START_CANONERR) ?
-                         0 : svn_err->apr_err),
-                        r, "Failed to perform access control: %s",
-                        svn_err_best_message(svn_err, errbuf, sizeof(errbuf)));
-          svn_error_clear(svn_err);
+          log_svn_error(APLOG_MARK, r,
+                        "Failed to perform access control:",
+                        svn_err, r->pool);
 
           return DECLINED;
         }
@@ -530,56 +612,6 @@ req_check_access(request_rec *r,
   return OK;
 }
 
-/* The macros LOG_ARGS_SIGNATURE and LOG_ARGS_CASCADE are expanded as formal
- * and actual parameters to log_access_verdict with respect to HTTPD version.
- */
-#if AP_MODULE_MAGIC_AT_LEAST(20100606,0)
-#define LOG_ARGS_SIGNATURE const char *file, int line, int module_index
-#define LOG_ARGS_CASCADE file, line, module_index
-#else
-#define LOG_ARGS_SIGNATURE const char *file, int line
-#define LOG_ARGS_CASCADE file, line
-#endif
-
-/* Log a message indicating the access control decision made about a
- * request.  The macro LOG_ARGS_SIGNATURE expands to FILE, LINE and
- * MODULE_INDEX in HTTPD 2.3 as APLOG_MARK macro has been changed for
- * per-module loglevel configuration.  It expands to FILE and LINE
- * in older server versions.  ALLOWED is boolean.
- * REPOS_PATH and DEST_REPOS_PATH are information
- * about the request.  DEST_REPOS_PATH may be NULL. */
-static void
-log_access_verdict(LOG_ARGS_SIGNATURE,
-                   const request_rec *r, int allowed,
-                   const char *repos_path, const char *dest_repos_path)
-{
-  int level = allowed ? APLOG_INFO : APLOG_ERR;
-  const char *verdict = allowed ? "granted" : "denied";
-
-  if (r->user)
-    {
-      if (dest_repos_path)
-        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
-                      "Access %s: '%s' %s %s %s", verdict, r->user,
-                      r->method, repos_path, dest_repos_path);
-      else
-        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
-                      "Access %s: '%s' %s %s", verdict, r->user,
-                      r->method, repos_path);
-    }
-  else
-    {
-      if (dest_repos_path)
-        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
-                      "Access %s: - %s %s %s", verdict,
-                      r->method, repos_path, dest_repos_path);
-      else
-        ap_log_rerror(LOG_ARGS_CASCADE, level, 0, r,
-                      "Access %s: - %s %s", verdict,
-                      r->method, repos_path);
-    }
-}
-
 /*
  * Implementation of subreq_bypass with scratch_pool parameter.
  */
@@ -593,7 +625,6 @@ subreq_bypass2(request_rec *r,
   svn_authz_t *access_conf = NULL;
   authz_svn_config_rec *conf = NULL;
   svn_boolean_t authz_access_granted = FALSE;
-  char errbuf[256];
   const char *username_to_authorize;
 
   conf = ap_get_module_config(r->per_dir_config,
@@ -626,18 +657,9 @@ subreq_bypass2(request_rec *r,
                                              scratch_pool);
       if (svn_err)
         {
-          ap_log_rerror(APLOG_MARK, APLOG_ERR,
-                        /* If it is an error code that APR can make
-                           sense of, then show it, otherwise, pass
-                           zero to avoid putting "APR does not
-                           understand this error code" in the error
-                           log. */
-                        ((svn_err->apr_err >= APR_OS_START_USERERR &&
-                          svn_err->apr_err < APR_OS_START_CANONERR) ?
-                         0 : svn_err->apr_err),
-                        r, "Failed to perform access control: %s",
-                        svn_err_best_message(svn_err, errbuf, sizeof(errbuf)));
-          svn_error_clear(svn_err);
+          log_svn_error(APLOG_MARK, r,
+                        "Failed to perform access control:",
+                        svn_err, scratch_pool);
           return HTTP_FORBIDDEN;
         }
       if (!authz_access_granted)

Modified: subversion/branches/javahl-ra/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/mod_dav_svn/mod_dav_svn.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/javahl-ra/subversion/mod_dav_svn/mod_dav_svn.c Fri Dec 28 23:03:51 2012
@@ -674,7 +674,7 @@ dav_svn_get_repos_path(request_rec *r,
 
   /* Construct the full path from the parent path base directory
      and the repository name. */
-  *repos_path = svn_urlpath__join(fs_parent_path, repos_name, r->pool);
+  *repos_path = svn_dirent_join(fs_parent_path, repos_name, r->pool);
   return NULL;
 }
 

Modified: subversion/branches/javahl-ra/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/cl.h?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/cl.h (original)
+++ subversion/branches/javahl-ra/subversion/svn/cl.h Fri Dec 28 23:03:51 2012
@@ -288,13 +288,13 @@ svn_opt_subcommand_t
   svn_cl__upgrade;
 
 
-/* See definition in main.c for documentation. */
+/* See definition in svn.c for documentation. */
 extern const svn_opt_subcommand_desc2_t svn_cl__cmd_table[];
 
-/* See definition in main.c for documentation. */
+/* See definition in svn.c for documentation. */
 extern const int svn_cl__global_options[];
 
-/* See definition in main.c for documentation. */
+/* See definition in svn.c for documentation. */
 extern const apr_getopt_option_t svn_cl__options[];
 
 
@@ -493,60 +493,6 @@ svn_cl__revprop_prepare(const svn_opt_re
                         svn_client_ctx_t *ctx,
                         apr_pool_t *pool);
 
-/* Search for a text editor command in standard environment variables,
-   and invoke it to edit CONTENTS (using a temporary file created in
-   directory BASE_DIR).  Return the new contents in *EDITED_CONTENTS,
-   or set *EDITED_CONTENTS to NULL if no edit was performed.
-
-   If EDITOR_CMD is not NULL, it is the name of the external editor
-   command to use, overriding anything else that might determine the
-   editor.
-
-   If TMPFILE_LEFT is NULL, the temporary file will be destroyed.
-   Else, the file will be left on disk, and its path returned in
-   *TMPFILE_LEFT.
-
-   CONFIG is a hash of svn_config_t * items keyed on a configuration
-   category (SVN_CONFIG_CATEGORY_CONFIG et al), and may be NULL.
-
-   If AS_TEXT is TRUE, recode CONTENTS and convert to native eol-style before
-   editing and back again afterwards.  In this case, ENCODING determines the
-   encoding used during editing.  If non-NULL, use the named encoding, else
-   use the system encoding.  If AS_TEXT is FALSE, don't do any translation.
-   In that case, ENCODING is ignored.
-
-   Use POOL for all allocations.  Use PREFIX as the prefix for the
-   temporary file used by the editor.
-
-   If return error, *EDITED_CONTENTS is not touched. */
-svn_error_t *
-svn_cl__edit_string_externally(svn_string_t **edited_contents,
-                               const char **tmpfile_left,
-                               const char *editor_cmd,
-                               const char *base_dir,
-                               const svn_string_t *contents,
-                               const char *prefix,
-                               apr_hash_t *config,
-                               svn_boolean_t as_text,
-                               const char *encoding,
-                               apr_pool_t *pool);
-
-
-/* Search for a text editor command in standard environment variables,
-   and invoke it to edit PATH.  Use POOL for all allocations.
-
-   If EDITOR_CMD is not NULL, it is the name of the external editor
-   command to use, overriding anything else that might determine the
-   editor.
-
-   CONFIG is a hash of svn_config_t * items keyed on a configuration
-   category (SVN_CONFIG_CATEGORY_CONFIG et al), and may be NULL.  */
-svn_error_t *
-svn_cl__edit_file_externally(const char *path,
-                             const char *editor_cmd,
-                             apr_hash_t *config,
-                             apr_pool_t *pool);
-
 /* Search for a merge tool command in environment variables,
    and use it to perform the merge of the four given files.
    WC_PATH is the path of the file that is in conflict, relative

Modified: subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/conflict-callbacks.c Fri Dec 28 23:03:51 2012
@@ -38,6 +38,8 @@
 #include "cl.h"
 #include "tree-conflicts.h"
 
+#include "private/svn_cmdline_private.h"
+
 #include "svn_private_config.h"
 
 
@@ -203,8 +205,8 @@ open_editor(svn_boolean_t *performed_edi
 
   if (desc->merged_file)
     {
-      err = svn_cl__edit_file_externally(desc->merged_file, b->editor_cmd,
-                                         b->config, pool);
+      err = svn_cmdline__edit_file_externally(desc->merged_file, b->editor_cmd,
+                                              b->config, pool);
       if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
         {
           svn_error_t *root_err = svn_error_root_cause(err);
@@ -804,9 +806,9 @@ svn_cl__conflict_func_interactive(svn_wc
               return SVN_NO_ERROR;
             }
 
-          err = svn_cl__edit_file_externally(desc->merged_file,
-                                             b->editor_cmd, b->config,
-                                             scratch_pool);
+          err = svn_cmdline__edit_file_externally(desc->merged_file,
+                                                  b->editor_cmd, b->config,
+                                                  scratch_pool);
           if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
             {
               SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n",

Modified: subversion/branches/javahl-ra/subversion/svn/copy-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/copy-cmd.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/copy-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/copy-cmd.c Fri Dec 28 23:03:51 2012
@@ -68,7 +68,42 @@ svn_cl__copy(apr_getopt_t *os,
       svn_opt_revision_t *peg_revision = apr_palloc(pool,
                                                     sizeof(*peg_revision));
 
-      SVN_ERR(svn_opt_parse_path(peg_revision, &src, target, pool));
+      err = svn_opt_parse_path(peg_revision, &src, target, pool);
+
+      if (err)
+        {
+          /* Issue #3606: 'svn cp .@HEAD target' gives
+             svn: '@HEAD' is just a peg revision. Maybe try '@HEAD@' instead? 
+
+             This is caused by a first round of canonicalization in
+             svn_cl__args_to_target_array_print_reserved(). Undo that in an
+             attempt to fix this issue without revving many apis.
+           */
+          if (*target == '@' && err->apr_err == SVN_ERR_BAD_FILENAME)
+            {
+              svn_error_t *err2;
+
+              err2 = svn_opt_parse_path(peg_revision, &src,
+                                        apr_pstrcat(pool, ".", target,
+                                                    (const char *)NULL), pool);
+
+              if (err2)
+                {
+                  /* Fix attempt failed; return original error */
+                  svn_error_clear(err2);
+                }
+              else
+                {
+                  /* Error resolved. Use path */
+                  svn_error_clear(err);
+                  err = NULL;
+                }
+            }
+
+          if (err)
+              return svn_error_trace(err);
+        }
+
       source->path = src;
       source->revision = &(opt_state->start_revision);
       source->peg_revision = peg_revision;

Modified: subversion/branches/javahl-ra/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/file-merge.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/file-merge.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/file-merge.c Fri Dec 28 23:03:51 2012
@@ -37,6 +37,7 @@
 
 #include "svn_private_config.h"
 #include "private/svn_utf_private.h"
+#include "private/svn_cmdline_private.h"
 #include "private/svn_dep_compat.h"
 
 #if APR_HAVE_SYS_IOCTL_H
@@ -491,8 +492,8 @@ edit_chunk(apr_array_header_t **merged_c
     }
   SVN_ERR(svn_io_file_flush_to_disk(temp_file, scratch_pool));
 
-  err = svn_cl__edit_file_externally(temp_file_name, editor_cmd,
-                                     config, scratch_pool);
+  err = svn_cmdline__edit_file_externally(temp_file_name, editor_cmd,
+                                          config, scratch_pool);
   if (err && (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR))
     {
       svn_error_t *root_err = svn_error_root_cause(err);

Modified: subversion/branches/javahl-ra/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/help-cmd.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/help-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/help-cmd.c Fri Dec 28 23:03:51 2012
@@ -28,6 +28,7 @@
 /*** Includes. ***/
 
 #include "svn_string.h"
+#include "svn_config.h"
 #include "svn_error.h"
 #include "svn_version.h"
 #include "cl.h"
@@ -43,7 +44,8 @@ svn_cl__help(apr_getopt_t *os,
              void *baton,
              apr_pool_t *pool)
 {
-  svn_cl__opt_state_t *opt_state;
+  svn_cl__opt_state_t *opt_state = NULL;
+  svn_stringbuf_t *version_footer = NULL;
 
   /* xgettext: the %s is for SVN_VER_NUMBER. */
   char help_header_template[] =
@@ -69,14 +71,72 @@ svn_cl__help(apr_getopt_t *os,
   const char *ra_desc_start
     = _("The following repository access (RA) modules are available:\n\n");
 
-  svn_stringbuf_t *version_footer;
-
   if (baton)
-    opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
-  else
-    opt_state = NULL;
+    {
+      svn_cl__cmd_baton_t *const cmd_baton = baton;
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
+      /* Windows never actually stores plaintext passwords, it
+         encrypts the contents using CryptoAPI. ...
+
+         ... If CryptoAPI is available ... but it should be on all
+         versions of Windows that are even remotely interesting two
+         days before the scheduled end of the world, when this comment
+         is being written. */
+#  ifndef WIN32
+      svn_boolean_t store_auth_creds =
+        SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS;
+      svn_boolean_t store_passwords =
+        SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS;
+      svn_boolean_t store_plaintext_passwords = FALSE;
+      svn_config_t *cfg;
+
+      if (cmd_baton->ctx->config)
+        {
+          cfg = apr_hash_get(cmd_baton->ctx->config,
+                             SVN_CONFIG_CATEGORY_CONFIG,
+                             APR_HASH_KEY_STRING);
+          if (cfg)
+            {
+              SVN_ERR(svn_config_get_bool(cfg, &store_auth_creds,
+                                          SVN_CONFIG_SECTION_AUTH,
+                                          SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
+                                          store_auth_creds));
+              SVN_ERR(svn_config_get_bool(cfg, &store_passwords,
+                                          SVN_CONFIG_SECTION_AUTH,
+                                          SVN_CONFIG_OPTION_STORE_PASSWORDS,
+                                          store_passwords));
+            }
+          cfg = apr_hash_get(cmd_baton->ctx->config,
+                             SVN_CONFIG_CATEGORY_SERVERS,
+                             APR_HASH_KEY_STRING);
+          if (cfg)
+            {
+              const char *value;
+              SVN_ERR(svn_config_get_yes_no_ask
+                      (cfg, &value,
+                       SVN_CONFIG_SECTION_GLOBAL,
+                       SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
+                       SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS));
+              if (0 == svn_cstring_casecmp(value, SVN_CONFIG_TRUE))
+                store_plaintext_passwords = TRUE;
+            }
+        }
+
+      if (store_plaintext_passwords && store_auth_creds && store_passwords)
+        {
+          version_footer = svn_stringbuf_create(
+              _("WARNING: Plaintext password storage is enabled!\n\n"),
+              pool);
+          svn_stringbuf_appendcstr(version_footer, ra_desc_start);
+        }
+#  endif /* !WIN32 */
+#endif /* !SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE */
+
+      opt_state = cmd_baton->opt_state;
+    }
 
-  version_footer = svn_stringbuf_create(ra_desc_start, pool);
+  if (!version_footer)
+    version_footer = svn_stringbuf_create(ra_desc_start, pool);
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
 
   return svn_opt_print_help4(os,

Modified: subversion/branches/javahl-ra/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/propedit-cmd.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/propedit-cmd.c Fri Dec 28 23:03:51 2012
@@ -39,6 +39,7 @@
 #include "svn_props.h"
 #include "cl.h"
 
+#include "private/svn_cmdline_private.h"
 #include "svn_private_config.h"
 
 
@@ -137,8 +138,8 @@ svn_cl__propedit(apr_getopt_t *os,
       /* Run the editor on a temporary file which contains the
          original property value... */
       SVN_ERR(svn_io_temp_dir(&temp_dir, pool));
-      SVN_ERR(svn_cl__edit_string_externally
-              (&propval, NULL,
+      SVN_ERR(svn_cmdline__edit_string_externally(
+               &propval, NULL,
                opt_state->editor_cmd, temp_dir,
                propval, "svn-prop",
                ctx->config,
@@ -272,16 +273,16 @@ svn_cl__propedit(apr_getopt_t *os,
 
           /* Run the editor on a temporary file which contains the
              original property value... */
-          SVN_ERR(svn_cl__edit_string_externally(&edited_propval, NULL,
-                                                 opt_state->editor_cmd,
-                                                 base_dir,
-                                                 propval,
-                                                 "svn-prop",
-                                                 ctx->config,
-                                                 svn_prop_needs_translation
-                                                 (pname_utf8),
-                                                 opt_state->encoding,
-                                                 subpool));
+          SVN_ERR(svn_cmdline__edit_string_externally(&edited_propval, NULL,
+                                                      opt_state->editor_cmd,
+                                                      base_dir,
+                                                      propval,
+                                                      "svn-prop",
+                                                      ctx->config,
+                                                      svn_prop_needs_translation
+                                                      (pname_utf8),
+                                                      opt_state->encoding,
+                                                      subpool));
 
           target_local = svn_path_is_url(target) ? target
             : svn_dirent_local_style(target, subpool);

Modified: subversion/branches/javahl-ra/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svn/svn.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svn/svn.c (original)
+++ subversion/branches/javahl-ra/subversion/svn/svn.c Fri Dec 28 23:03:51 2012
@@ -1,5 +1,5 @@
 /*
- * main.c:  Subversion command line client.
+ * svn.c:  Subversion command line client main file.
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one
@@ -101,6 +101,7 @@ typedef enum svn_cl__longopt_t {
   opt_no_ignore,
   opt_no_unlock,
   opt_non_interactive,
+  opt_force_interactive,
   opt_old_cmd,
   opt_record_only,
   opt_relocate,
@@ -229,7 +230,13 @@ const apr_getopt_option_t svn_cl__option
                        "                             "
                        "with '--non-interactive')") },
   {"non-interactive", opt_non_interactive, 0,
-                    N_("do no interactive prompting")},
+                    N_("do no interactive prompting (default is to prompt\n"
+                       "                             "
+                       "only if standard input is a terminal device)")},
+  {"force-interactive", opt_force_interactive, 0,
+                    N_("do interactive prompting even if standard input\n"
+                       "                             "
+                       "is not a terminal device")},
   {"dry-run",       opt_dry_run, 0,
                     N_("try operation but make no changes")},
   {"ignore-ancestry", opt_ignore_ancestry, 0,
@@ -401,7 +408,8 @@ const apr_getopt_option_t svn_cl__option
    willy-nilly to every invocation of 'svn') . */
 const int svn_cl__global_options[] =
 { opt_auth_username, opt_auth_password, opt_no_auth_cache, opt_non_interactive,
-  opt_trust_server_cert, opt_config_dir, opt_config_options, 0
+  opt_force_interactive, opt_trust_server_cert, opt_config_dir,
+  opt_config_options, 0
 };
 
 /* Options for giving a log message.  (Some of these also have other uses.)
@@ -730,7 +738,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "          (the 'automatic' merge)\n"
 "       2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
 "          (the 'cherry-pick' merge)\n"
-"       3. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
+"       3. merge SOURCE1[@REV1] SOURCE2[@REV2] [TARGET_WCPATH]\n"
 "          (the '2-URL' merge)\n"
 "\n"
 "  1. This form, with one source path and no revision range, is called\n"
@@ -915,26 +923,27 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "\n"
 "  3. This form is called a '2-URL merge':\n"
 "\n"
-"       svn merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
-"\n"
-"     Two source URLs are specified, together with two revisions N and M.\n"
-"     The two sources are compared at the specified revisions, and the\n"
-"     difference is applied to TARGET_WCPATH, which is a path to a working\n"
-"     copy of another branch. The three branches involved can be completely\n"
-"     unrelated.\n"
+"       svn merge SOURCE1[@REV1] SOURCE2[@REV2] [TARGET_WCPATH]\n"
 "\n"
 "     You should use this merge variant only if the other variants do not\n"
 "     apply to your situation, as this variant can be quite complex to\n"
 "     master.\n"
 "\n"
+"     Two source URLs are specified, identifying two trees on the same\n"
+"     branch or on different branches. The trees are compared and the\n"
+"     difference from SOURCE1@REV1 to SOURCE2@REV2 is applied to the\n"
+"     working copy of the target branch at TARGET_WCPATH. The target\n"
+"     branch may be the same as one or both sources, or different again.\n"
+"     The three branches involved can be completely unrelated.\n"
+"\n"
 "     If TARGET_WCPATH is omitted, a default value of '.' is assumed.\n"
 "     However, in the special case where both sources refer to a file node\n"
-"     with the same basename and a similarly named file is also found within\n"
-"     '.', the differences will be applied to that local file.  The source\n"
-"     revisions default to HEAD if omitted.\n"
+"     with the same name and a file with the same name is also found within\n"
+"     '.', the differences will be applied to that local file. The source\n"
+"     revisions REV1 and REV2 default to HEAD if omitted.\n"
 "\n"
-"     The sources can also be specified as working copy paths, in which case\n"
-"     the URLs of the merge sources are derived from the working copies.\n"
+"     SOURCE1 and/or SOURCE2 can also be specified as a working copy path,\n"
+"     in which case the merge source URL is derived from the working copy.\n"
 "\n"
 "       - 2-URL Merge Example -\n"
 "\n"
@@ -1659,6 +1668,7 @@ sub_main(int argc, const char *argv[], a
   svn_config_t *cfg_config;
   svn_boolean_t descend = TRUE;
   svn_boolean_t interactive_conflicts = FALSE;
+  svn_boolean_t force_interactive = FALSE;
   svn_boolean_t use_notifier = TRUE;
   apr_hash_t *changelists;
   const char *sqlite_exclusive;
@@ -1982,6 +1992,9 @@ sub_main(int argc, const char *argv[], a
       case opt_non_interactive:
         opt_state.non_interactive = TRUE;
         break;
+      case opt_force_interactive:
+        force_interactive = TRUE;
+        break;
       case opt_trust_server_cert:
         opt_state.trust_server_cert = TRUE;
         break;
@@ -2191,6 +2204,20 @@ sub_main(int argc, const char *argv[], a
       }
     }
 
+  /* The --non-interactive and --force-interactive options are mutually
+   * exclusive. */
+  if (opt_state.non_interactive && force_interactive)
+    {
+      err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("--non-interactive and --force-interactive "
+                               "are mutually exclusive"));
+      return EXIT_ERROR(err);
+    }
+  else
+    opt_state.non_interactive = !svn_cmdline__be_interactive(
+                                  opt_state.non_interactive,
+                                  force_interactive);
+
   /* Turn our hash of changelists into an array of unique ones. */
   SVN_INT_ERR(svn_hash_keys(&(opt_state.changelists), changelists, pool));
 



Mime
View raw message