You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2015/09/18 07:06:18 UTC

svn commit: r1703741 [1/2] - in /subversion/branches/1.9.x-r1700215: ./ subversion/include/private/ subversion/libsvn_auth_kwallet/ subversion/libsvn_client/ subversion/libsvn_ra_serf/ subversion/libsvn_subr/ subversion/libsvn_subr/utf8proc/ subversion...

Author: brane
Date: Fri Sep 18 05:06:17 2015
New Revision: 1703741

URL: http://svn.apache.org/viewvc?rev=1703741&view=rev
Log:
On the 1.9.x-r1700215 backport branch: Sync with the 1.9.x branch.

Added:
    subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/upgrade_tests_data/upgrade_1_0_with_externals.tar.bz2
      - copied unchanged from r1703740, subversion/branches/1.9.x/subversion/tests/cmdline/upgrade_tests_data/upgrade_1_0_with_externals.tar.bz2
Modified:
    subversion/branches/1.9.x-r1700215/   (props changed)
    subversion/branches/1.9.x-r1700215/STATUS
    subversion/branches/1.9.x-r1700215/subversion/include/private/svn_io_private.h
    subversion/branches/1.9.x-r1700215/subversion/include/private/svn_utf_private.h
    subversion/branches/1.9.x-r1700215/subversion/libsvn_auth_kwallet/kwallet.cpp
    subversion/branches/1.9.x-r1700215/subversion/libsvn_client/merge.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_client/mtcc.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_client/upgrade.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_ra_serf/update.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/io.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/stream.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/sysinfo.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc/utf8proc.h
    subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/adm_crawler.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/update_editor.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db.c
    subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db_pristine.c
    subversion/branches/1.9.x-r1700215/subversion/svnadmin/svnadmin.c
    subversion/branches/1.9.x-r1700215/subversion/svnfsfs/stats-cmd.c
    subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/merge_automatic_tests.py
    subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/revert_tests.py
    subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnfsfs_tests.py
    subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnmucc_tests.py
    subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/update_tests.py
    subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/upgrade_tests.py

Propchange: subversion/branches/1.9.x-r1700215/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 18 05:06:17 2015
@@ -2,6 +2,7 @@
 /subversion/branches/1.5.x-r30215:870312
 /subversion/branches/1.7.x-fs-verify:1146708,1161180
 /subversion/branches/1.9-cache-improvements:1678948-1679863
+/subversion/branches/1.9.x:1701365-1703740
 /subversion/branches/1.9.x-r1664664:1674265-1674433
 /subversion/branches/1.9.x-r1667233:1673207-1673638
 /subversion/branches/10Gb:1388102,1388163-1388190,1388195,1388202,1388205,1388211,1388276,1388362,1388375,1388394,1388636,1388639-1388640,1388643-1388644,1388654,1388720,1388789,1388795,1388801,1388805,1388807,1388810,1388816,1389044,1389276,1389289,1389662,1389867,1390017,1390209,1390216,1390407,1390409,1390414,1390419,1390955
@@ -93,4 +94,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663530,1663671,1663697,1663706,1663738,1663749,1663791,1663991,1664035,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666832,1666851,1666965,1667101,1667106-1667107,1667120,1667228,1667233-1667235,1667249-1667250,1667258,1667290,1667301,1667471,1667691-1667693,1667699-1667700,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,167
 0347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,1672511-1672512,1672578,1672728,1673044,1673062-1673063,1673065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170,1674301,1674305,1674308,1674339-1674340,1674406,1674415,1674455-1674456,1674475,1674487,1674522,1674580,1674626-1674627,1674785,1674891,1675771,1675774,1676526,1676535,1676538,1676555,1676564,1676570,1676665,1676667,1676769,1677003,1677191,1677267,1677440,1678147,1678149,1678494,1678571,1678734,1678742,1678745-1678746,1678839,1678846,1678894,1678950,1678963,1679166,1679169,1679228,1679230,1679287,1679864,1679866,1679909,1680242,1680264,1680495,1680705,1680819,1681317,1682714,1682854,1683071,1683126,1683135,1683290,1683303,1683311,1683378,1683387,1684034,1684077,1684322,1684325,1684344,1684412,1684940,1685034,1685085,1686175,1686239,1686478,1686541,1686543,1686554,1686557,1686802,1686888,1686984,1687029,1687304,1687389,1687769,
 1687776,1688258,1688273,1688395,1689214,1689216,1689721,1689729,1691712-1691713,1691924,1691928,1692091,1692093,1692098,1692448,1692469-1692470,1692798-1692799,1693135,1693138,1693159,1693886,1694023,1694194,1694481,1694929,1695022,1695600,1695606,1695681,1696222,1696225,1696387,1696695,1697381,1697384,1697387,1697664,1697824,1697835,1697845,1697914,1697967,1698106,1700215,1700219-1700220,1701270
+/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663530,1663671,1663697,1663706,1663738,1663749,1663791,1663991,1664035,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666832,1666851,1666965,1667101,1667106-1667107,1667120,1667228,1667233-1667235,1667249-1667250,1667258,1667290,1667301,1667471,1667691-1667693,1667699-1667700,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,167
 0347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,1672511-1672512,1672578,1672728,1673044,1673062-1673063,1673065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170,1674301,1674305,1674308,1674339-1674340,1674406,1674415,1674455-1674456,1674475,1674487,1674522,1674580,1674626-1674627,1674785,1674891,1675771,1675774,1676526,1676535,1676538,1676555,1676564,1676570,1676665,1676667,1676769,1677003,1677191,1677267,1677440,1678147,1678149,1678494,1678571,1678734,1678742,1678745-1678746,1678755,1678839,1678846,1678894,1678950,1678963,1679166,1679169,1679228,1679230,1679240,1679287,1679864,1679866,1679909,1680242,1680264,1680495,1680705,1680819,1681317,1682714,1682854,1683071,1683126,1683135,1683290,1683303,1683311,1683378,1683387,1684034,1684077,1684322,1684325,1684344,1684412,1684940,1685034,1685085,1686175,1686239,1686478,1686541,1686543,1686554,1686557,1686802,1686888,1686984,1687029,1687304,
 1687389,1687769,1687776,1688258,1688273,1688395,1689214,1689216,1689721,1689729,1691712-1691713,1691924,1691928,1692091,1692093,1692098,1692448,1692469-1692470,1692798-1692799,1693135,1693138,1693159,1693886,1694023,1694194,1694481,1694929,1695022,1695600,1695606,1695681,1696222,1696225,1696387,1696695,1697381,1697384,1697387,1697664,1697824,1697835,1697845,1697914,1697967,1698106,1698312,1700215,1700219-1700220,1700740,1700951,1701064,1701206,1701270,1701298,1701633,1701638,1701736,1701792,1701797,1701838,1701997,1702198,1702200,1702203,1702218,1702231,1702237-1702239,1702247,1702288,1702299-1702300,1702310,1702397,1702407,1702467,1702472,1702474,1702478,1702533,1702549,1702553,1702565,1702891,1702974,1702991,1703675

Modified: subversion/branches/1.9.x-r1700215/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/STATUS?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/STATUS (original)
+++ subversion/branches/1.9.x-r1700215/STATUS Fri Sep 18 05:06:17 2015
@@ -15,24 +15,62 @@ Status of 1.9.2:
 Candidate changes:
 ==================
 
- * r1698312
-   Correctly report empty representations in 'svnfsfs stats'.
+ * r1701488
+   Issue #4592 "fix contrib check-mime-type.pl for changes to 'svnlook proplist'
+     output", http://subversion.tigris.org/issues/show_bug.cgi?id=4592
    Justification:
-     The current code displays the "0" bracket in histograms as
-     "-2147483648 .. < 1" instead of "0 .. < 1".  Technically correct
-     but annoying.  UI change only.
+     Make this contributed script work again, after 1.7.8 broke it.
+   Notes:
+     Brett Randall put effort into contributing this fix: see the dev@ email
+     thread "[patch][reboot-topic] fix check-mime-type.pl for changes to
+     'svnlook proplist' output" started by him on 2015-08-07, archived at
+     e.g. <http://svn.haxx.se/dev/archive-2015-08/0047.shtml> or
+     <http://mail-archives.apache.org/mod_mbox/subversion-dev/201508.mbox/%3CCALeEUB56NVCR0nCZ2rYki6oKQNcVPPLvWTeCoYyrMqitsov0ag@mail.gmail.com%3E>.
    Votes:
-     +1: stefan2
+     +0: julianfoad, rhuijben (he says it works, but I haven't reviewed or tested)
+
+ * r1700215, r1700219, r1700220, r1701270
+   Fix argument passing in test suite.
+   Justification:
+     Makes svnfsfs_tests.py work in fsfs-v4 and fsfs-v6 modes.
+   Branch:
+     ^/subversion/branches/1.9.x-r1700215
+   Votes:
+     +1: brane, stefan2
+     -0: rhuijben (Log level on standard invocation of win-tests.py changes)
+
+ * r1701598, r1701603, r1701611, r1701646
+   Make 'svn lock' and 'svn unlock' report (un)lock errors as failure
+   Justification:
+     A single lock or unlock failure doesn't affect the whole operation
+     since 1.9, but this has the side effect of no longer producing an
+     error at all on failures. This patch makes 'svn' return an error when
+     at least one failure is reported by the locking code.
+   Notes:
+     r1701598 is the actual fix. The other patches simplify and fix
+     test expectations.
+   Votes:
+     +1: rhuijben
+
+ * r1703581
+   Allow simple resolving of binary file text conflicts
+   Justification:
+     Simple usability improvement. Use reported. Regression.
+   Branch:
+     ^/subversion/branches/1.9.x-r1703581
+   Votes:
+     +1: rhuijben, philip
+
+ * r1703688, 1703689
+   Fix merging deletes of svn:eol-style CRLF or CR files
+   Justification:
+     Resolves unnecessary tree conflicts.
+     Any more reasons needed? :-)
+   Votes:
+     +1: rhuijben
 
 Veto-blocked changes:
 =====================
 
 Approved changes:
 =================
-
- * r1700740, r1700951
-   Fix registration of kwallet to avoid double free on close
-   Justification:
-     Fixes segfault on kwallet close. User reported problem.
-   Votes:
-     +1: rhuijben, stsp, brane

Modified: subversion/branches/1.9.x-r1700215/subversion/include/private/svn_io_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/include/private/svn_io_private.h?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/include/private/svn_io_private.h (original)
+++ subversion/branches/1.9.x-r1700215/subversion/include/private/svn_io_private.h Fri Sep 18 05:06:17 2015
@@ -171,6 +171,26 @@ svn_error_t*
 svn_io__utf8_to_unicode_longpath(const WCHAR **result,
                                  const char *source,
                                  apr_pool_t *result_pool);
+
+/* This Windows-specific function marks the file to be deleted on close using
+   an existing file handle. It can be used to avoid having to reopen the file
+   as part of the delete handling. Return SVN_ERR_UNSUPPORTED_FEATURE if
+   delete on close operation is not supported by OS. */
+svn_error_t *
+svn_io__win_delete_file_on_close(apr_file_t *file,
+                                 const char *path,
+                                 apr_pool_t *pool);
+
+/* This Windows-specific function renames the file using an existing file
+   handle. It can be used to avoid having to reopen the file as part of the
+   rename operation. Return SVN_ERR_UNSUPPORTED_FEATURE if renaming open
+   file is not supported by OS.*/
+svn_error_t *
+svn_io__win_rename_open_file(apr_file_t *file,
+                             const char *from_path,
+                             const char *to_path,
+                             apr_pool_t *pool);
+
 #endif /* WIN32 */
 
 #ifdef __cplusplus

Modified: subversion/branches/1.9.x-r1700215/subversion/include/private/svn_utf_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/include/private/svn_utf_private.h?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/include/private/svn_utf_private.h (original)
+++ subversion/branches/1.9.x-r1700215/subversion/include/private/svn_utf_private.h Fri Sep 18 05:06:17 2015
@@ -204,9 +204,13 @@ svn_utf__glob(svn_boolean_t *match,
               svn_membuf_t *string_buf,
               svn_membuf_t *temp_buf);
 
-/* Return the version of the wrapped utf8proc library. */
+/* Return the compiled version of the wrapped utf8proc library. */
 const char *
-svn_utf__utf8proc_version(void);
+svn_utf__utf8proc_compiled_version(void);
+
+/* Return the runtime version of the wrapped utf8proc library. */
+const char *
+svn_utf__utf8proc_runtime_version(void);
 
 /* Convert an UTF-16 (or UCS-2) string to UTF-8, returning the pointer
  * in RESULT. If BIG_ENDIAN is set, then UTF16STR is big-endian;

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_auth_kwallet/kwallet.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_auth_kwallet/kwallet.cpp?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_auth_kwallet/kwallet.cpp (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_auth_kwallet/kwallet.cpp Fri Sep 18 05:06:17 2015
@@ -47,6 +47,7 @@
 #include "svn_auth.h"
 #include "svn_config.h"
 #include "svn_error.h"
+#include "svn_hash.h"
 #include "svn_io.h"
 #include "svn_pools.h"
 #include "svn_string.h"
@@ -135,34 +136,36 @@ get_wid(void)
   return wid;
 }
 
+/* Forward definition */
+static apr_status_t
+kwallet_terminate(void *data);
+
 static KWallet::Wallet *
 get_wallet(QString wallet_name,
            apr_hash_t *parameters)
 {
   KWallet::Wallet *wallet =
-    static_cast<KWallet::Wallet *> (apr_hash_get(parameters,
-                                                 "kwallet-wallet",
-                                                 APR_HASH_KEY_STRING));
-  if (! wallet && ! apr_hash_get(parameters,
-                                 "kwallet-opening-failed",
-                                 APR_HASH_KEY_STRING))
+    static_cast<KWallet::Wallet *> (svn_hash_gets(parameters,
+                                                  "kwallet-wallet"));
+  if (! wallet && ! svn_hash_gets(parameters, "kwallet-opening-failed"))
     {
       wallet = KWallet::Wallet::openWallet(wallet_name, get_wid(),
                                            KWallet::Wallet::Synchronous);
-    }
-  if (wallet)
-    {
-      apr_hash_set(parameters,
-                   "kwallet-wallet",
-                   APR_HASH_KEY_STRING,
-                   wallet);
-    }
-  else
-    {
-      apr_hash_set(parameters,
-                   "kwallet-opening-failed",
-                   APR_HASH_KEY_STRING,
-                   "");
+
+      if (wallet)
+        {
+          svn_hash_sets(parameters, "kwallet-wallet", wallet);
+
+          apr_pool_cleanup_register(apr_hash_pool_get(parameters),
+                                    parameters, kwallet_terminate,
+                                    apr_pool_cleanup_null);
+
+          svn_hash_sets(parameters, "kwallet-initialized", "");
+        }
+      else
+        {
+          svn_hash_sets(parameters, "kwallet-opening-failed", "");
+        }
     }
   return wallet;
 }
@@ -171,14 +174,12 @@ static apr_status_t
 kwallet_terminate(void *data)
 {
   apr_hash_t *parameters = static_cast<apr_hash_t *> (data);
-  if (apr_hash_get(parameters, "kwallet-initialized", APR_HASH_KEY_STRING))
+  if (svn_hash_gets(parameters, "kwallet-initialized"))
     {
       KWallet::Wallet *wallet = get_wallet(NULL, parameters);
       delete wallet;
-      apr_hash_set(parameters,
-                   "kwallet-initialized",
-                   APR_HASH_KEY_STRING,
-                   NULL);
+      svn_hash_sets(parameters, "kwallet-wallet", NULL);
+      svn_hash_sets(parameters, "kwallet-initialized", NULL);
     }
   return APR_SUCCESS;
 }
@@ -236,10 +237,6 @@ kwallet_password_get(svn_boolean_t *done
       KWallet::Wallet *wallet = get_wallet(wallet_name, parameters);
       if (wallet)
         {
-          apr_hash_set(parameters,
-                       "kwallet-initialized",
-                       APR_HASH_KEY_STRING,
-                       "");
           if (wallet->setFolder(folder))
             {
               QString q_password;
@@ -254,9 +251,6 @@ kwallet_password_get(svn_boolean_t *done
         }
     }
 
-  apr_pool_cleanup_register(pool, parameters, kwallet_terminate,
-                            apr_pool_cleanup_null);
-
   return SVN_NO_ERROR;
 }
 
@@ -310,10 +304,6 @@ kwallet_password_set(svn_boolean_t *done
   KWallet::Wallet *wallet = get_wallet(wallet_name, parameters);
   if (wallet)
     {
-      apr_hash_set(parameters,
-                   "kwallet-initialized",
-                   APR_HASH_KEY_STRING,
-                   "");
       if (! wallet->hasFolder(folder))
         {
           wallet->createFolder(folder);
@@ -329,9 +319,6 @@ kwallet_password_set(svn_boolean_t *done
         }
     }
 
-  apr_pool_cleanup_register(pool, parameters, kwallet_terminate,
-                            apr_pool_cleanup_null);
-
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_client/merge.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_client/merge.c Fri Sep 18 05:06:17 2015
@@ -11636,9 +11636,6 @@ open_reintegrate_source_and_target(svn_r
   SVN_ERR(open_target_wc(&target, target_abspath,
                          FALSE, FALSE, FALSE,
                          ctx, scratch_pool, scratch_pool));
-  SVN_ERR(svn_client_open_ra_session2(target_ra_session_p,
-                                      target->loc.url, target->abspath,
-                                      ctx, result_pool, scratch_pool));
   if (! target->loc.url)
     return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
                              _("Can't reintegrate into '%s' because it is "
@@ -11647,6 +11644,10 @@ open_reintegrate_source_and_target(svn_r
                              svn_dirent_local_style(target->abspath,
                                                     scratch_pool));
 
+  SVN_ERR(svn_client_open_ra_session2(target_ra_session_p,
+                                      target->loc.url, target->abspath,
+                                      ctx, result_pool, scratch_pool));
+
   SVN_ERR(svn_client__ra_session_from_path2(
             source_ra_session_p, &source_loc,
             source_path_or_url, NULL, source_peg_revision, source_peg_revision,
@@ -11700,6 +11701,7 @@ merge_reintegrate_locked(conflict_report
 
   if (! source)
     {
+      *conflict_report = NULL;
       return SVN_NO_ERROR;
     }
 
@@ -12570,12 +12572,19 @@ client_find_automatic_merge(automatic_me
                          allow_switched_subtrees,
                          ctx, result_pool, scratch_pool));
 
+  if (!s_t->target->loc.url)
+    return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
+                             _("Can't perform automatic merge into '%s' "
+                               "because it is locally added and therefore "
+                               "not related to the merge source"),
+                             svn_dirent_local_style(target_abspath,
+                                                    scratch_pool));
+
   /* Open RA sessions to the source and target trees. */
   SVN_ERR(svn_client_open_ra_session2(&s_t->target_ra_session,
                                       s_t->target->loc.url,
                                       s_t->target->abspath,
                                       ctx, result_pool, scratch_pool));
-  /* ### check for null URL (i.e. added path) here, like in reintegrate? */
   SVN_ERR(svn_client__ra_session_from_path2(
             &s_t->source_ra_session, &s_t->source,
             source_path_or_url, NULL, source_revision, source_revision,

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_client/mtcc.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_client/mtcc.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_client/mtcc.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_client/mtcc.c Fri Sep 18 05:06:17 2015
@@ -976,19 +976,19 @@ svn_client__mtcc_check_path(svn_node_kin
           if (op->kind == OP_OPEN_DIR || op->kind == OP_ADD_DIR)
             op->performed_stat = TRUE;
           else if (op->kind == OP_OPEN_FILE || op->kind == OP_ADD_FILE)
-            return svn_error_createf(SVN_ERR_FS_NOT_DIRECTORY, NULL,
-                                     _("Can't perform directory operation "
-                                       "on '%s' as it is not a directory"),
+            return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
+                                     _("Can't perform file operation "
+                                       "on '%s' as it is not a file"),
                                      relpath);
         }
-      else if (op && *kind == svn_node_dir)
+      else if (op && *kind == svn_node_file)
         {
           if (op->kind == OP_OPEN_FILE || op->kind == OP_ADD_FILE)
             op->performed_stat = TRUE;
           else if (op->kind == OP_OPEN_DIR || op->kind == OP_ADD_DIR)
-            return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
-                                     _("Can't perform file operation "
-                                       "on '%s' as it is not a file"),
+            return svn_error_createf(SVN_ERR_FS_NOT_DIRECTORY, NULL,
+                                     _("Can't perform directory operation "
+                                       "on '%s' as it is not a directory"),
                                      relpath);
         }
       else if (op && (op->kind == OP_OPEN_DIR || op->kind == OP_OPEN_FILE))

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_client/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_client/upgrade.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_client/upgrade.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_client/upgrade.c Fri Sep 18 05:06:17 2015
@@ -83,11 +83,13 @@ fetch_repos_info(const char **repos_root
 }
 
 /* Forward definition. Upgrades svn:externals properties in the working copy
-   LOCAL_ABSPATH to the WC-NG  storage.
+   LOCAL_ABSPATH to the WC-NG  storage. INFO_BATON will be used to fetch
+   repository info using fetch_repos_info() function if needed.
  */
 static svn_error_t *
 upgrade_externals_from_properties(svn_client_ctx_t *ctx,
                                   const char *local_abspath,
+                                  struct repos_info_baton *info_baton,
                                   apr_pool_t *scratch_pool);
 
 svn_error_t *
@@ -172,7 +174,7 @@ svn_client_upgrade(const char *path,
          (There is no way to detect the difference from libsvn_client :( ) */
 
       SVN_ERR(upgrade_externals_from_properties(ctx, local_abspath,
-                                                scratch_pool));
+                                                &info_baton, scratch_pool));
     }
   return SVN_NO_ERROR;
 }
@@ -180,6 +182,7 @@ svn_client_upgrade(const char *path,
 static svn_error_t *
 upgrade_externals_from_properties(svn_client_ctx_t *ctx,
                                   const char *local_abspath,
+                                  struct repos_info_baton *info_baton,
                                   apr_pool_t *scratch_pool)
 {
   apr_hash_index_t *hi;
@@ -187,7 +190,6 @@ upgrade_externals_from_properties(svn_cl
   apr_pool_t *iterpool2;
   apr_hash_t *externals;
   svn_opt_revision_t rev = {svn_opt_revision_unspecified, {0}};
-  struct repos_info_baton info_baton;
 
   /* Now it's time to upgrade the externals too. We do it after the wc
      upgrade to avoid that errors in the externals causes the wc upgrade to
@@ -345,7 +347,7 @@ upgrade_externals_from_properties(svn_cl
             {
               err = fetch_repos_info(&repos_root_url,
                                      &repos_uuid,
-                                     &info_baton,
+                                     info_baton,
                                      resolved_url,
                                      scratch_pool, scratch_pool);
               if (err)

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_ra_serf/update.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_ra_serf/update.c Fri Sep 18 05:06:17 2015
@@ -1129,7 +1129,15 @@ handle_fetch(serf_request_t *request,
           /* Validate the delta base claimed by the server matches
              what we asked for! */
           val = serf_bucket_headers_get(hdrs, SVN_DAV_DELTA_BASE_HEADER);
-          if (val && (strcmp(val, fetch_ctx->delta_base) != 0))
+          if (val && fetch_ctx->delta_base == NULL)
+            {
+              /* We recieved response with delta base header while we didn't
+                 requested it -- report it as error. */
+              return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+                                       _("GET request returned unexpected "
+                                         "delta base: %s"), val);
+            }
+          else if (val && (strcmp(val, fetch_ctx->delta_base) != 0))
             {
               return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
                                        _("GET request returned unexpected "

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/io.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/io.c Fri Sep 18 05:06:17 2015
@@ -142,6 +142,23 @@
 #endif
 
 #ifdef WIN32
+
+#if _WIN32_WINNT < 0x600 /* Does the SDK assume Windows Vista+? */
+typedef struct _FILE_RENAME_INFO {
+  BOOL   ReplaceIfExists;
+  HANDLE RootDirectory;
+  DWORD  FileNameLength;
+  WCHAR  FileName[1];
+} FILE_RENAME_INFO, *PFILE_RENAME_INFO;
+
+typedef struct _FILE_DISPOSITION_INFO {
+  BOOL DeleteFile;
+} FILE_DISPOSITION_INFO, *PFILE_DISPOSITION_INFO;
+
+#define FileRenameInfo 3
+#define FileDispositionInfo 4
+#endif /* WIN32 < Vista */
+
 /* One-time initialization of the late bound Windows API functions. */
 static volatile svn_atomic_t win_dynamic_imports_state = 0;
 
@@ -152,7 +169,13 @@ typedef DWORD (WINAPI *GETFINALPATHNAMEB
                DWORD cchFilePath,
                DWORD dwFlags);
 
+typedef BOOL (WINAPI *SetFileInformationByHandle_t)(HANDLE hFile,
+                                                    int FileInformationClass,
+                                                    LPVOID lpFileInformation,
+                                                    DWORD dwBufferSize);
+
 static GETFINALPATHNAMEBYHANDLE get_final_path_name_by_handle_proc = NULL;
+static SetFileInformationByHandle_t set_file_information_by_handle_proc = NULL;
 
 /* Forward declaration. */
 static svn_error_t * io_win_read_link(svn_string_t **dest,
@@ -1861,11 +1884,18 @@ io_win_file_attrs_set(const char *fname,
 
 static svn_error_t *win_init_dynamic_imports(void *baton, apr_pool_t *pool)
 {
-    get_final_path_name_by_handle_proc = (GETFINALPATHNAMEBYHANDLE)
-      GetProcAddress(GetModuleHandleA("kernel32.dll"),
-                     "GetFinalPathNameByHandleW");
+  HMODULE kernel32 = GetModuleHandleA("kernel32.dll");
 
-    return SVN_NO_ERROR;
+  if (kernel32)
+    {
+      get_final_path_name_by_handle_proc = (GETFINALPATHNAMEBYHANDLE)
+        GetProcAddress(kernel32, "GetFinalPathNameByHandleW");
+
+      set_file_information_by_handle_proc = (SetFileInformationByHandle_t)
+        GetProcAddress(kernel32, "SetFileInformationByHandle");
+    }
+
+  return SVN_NO_ERROR;
 }
 
 static svn_error_t * io_win_read_link(svn_string_t **dest,
@@ -1937,6 +1967,130 @@ static svn_error_t * io_win_read_link(sv
       }
 }
 
+/* Wrapper around Windows API function SetFileInformationByHandle() that
+ * returns APR status instead of boolean flag. */
+static apr_status_t
+win32_set_file_information_by_handle(HANDLE hFile,
+                                     int FileInformationClass,
+                                     LPVOID lpFileInformation,
+                                     DWORD dwBufferSize)
+{
+  svn_error_clear(svn_atomic__init_once(&win_dynamic_imports_state,
+                                        win_init_dynamic_imports,
+                                        NULL, NULL));
+
+  if (!set_file_information_by_handle_proc)
+    {
+      return SVN_ERR_UNSUPPORTED_FEATURE;
+    }
+
+  if (!set_file_information_by_handle_proc(hFile, FileInformationClass,
+                                           lpFileInformation,
+                                           dwBufferSize))
+    {
+      return apr_get_os_error();
+    }
+
+  return APR_SUCCESS;
+}
+
+svn_error_t *
+svn_io__win_delete_file_on_close(apr_file_t *file,
+                                 const char *path,
+                                 apr_pool_t *pool)
+{
+  FILE_DISPOSITION_INFO disposition_info;
+  HANDLE hFile;
+  apr_status_t status;
+
+  apr_os_file_get(&hFile, file);
+
+  disposition_info.DeleteFile = TRUE;
+
+  status = win32_set_file_information_by_handle(hFile, FileDispositionInfo,
+                                                &disposition_info,
+                                                sizeof(disposition_info));
+
+  if (status)
+    {
+      return svn_error_wrap_apr(status, _("Can't remove file '%s'"),
+                                svn_dirent_local_style(path, pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_io__win_rename_open_file(apr_file_t *file,
+                             const char *from_path,
+                             const char *to_path,
+                             apr_pool_t *pool)
+{
+  WCHAR *w_final_abspath;
+  size_t path_len;
+  size_t rename_size;
+  FILE_RENAME_INFO *rename_info;
+  HANDLE hFile;
+  apr_status_t status;
+
+  apr_os_file_get(&hFile, file);
+
+  SVN_ERR(svn_io__utf8_to_unicode_longpath(
+            &w_final_abspath, svn_dirent_local_style(to_path,pool),
+            pool));
+
+  path_len = wcslen(w_final_abspath);
+  rename_size = sizeof(*rename_info) + sizeof(WCHAR) * path_len;
+
+  /* The rename info struct doesn't need hacks for long paths,
+     so no ugly escaping calls here */
+  rename_info = apr_pcalloc(pool, rename_size);
+  rename_info->ReplaceIfExists = TRUE;
+  rename_info->FileNameLength = path_len;
+  memcpy(rename_info->FileName, w_final_abspath, path_len * sizeof(WCHAR));
+
+  status = win32_set_file_information_by_handle(hFile, FileRenameInfo,
+                                                rename_info,
+                                                rename_size);
+
+  if (APR_STATUS_IS_EACCES(status) || APR_STATUS_IS_EEXIST(status))
+    {
+      /* Set the destination file writable because Windows will not allow
+         us to rename when final_abspath is read-only. */
+      SVN_ERR(svn_io_set_file_read_write(to_path, TRUE, pool));
+
+      status = win32_set_file_information_by_handle(hFile,
+                                                    FileRenameInfo,
+                                                    rename_info,
+                                                    rename_size);
+   }
+
+  /* Windows returns Vista+ client accessing network share stored on Windows
+     Server 2003 returns ERROR_ACCESS_DENIED. The same happens when Vista+
+     client access Windows Server 2008 with disabled SMBv2 protocol.
+
+     So return SVN_ERR_UNSUPPORTED_FEATURE in this case like we do when
+     SetFileInformationByHandle() is not available and let caller to
+     handle it.
+
+     See "Access denied error on checkout-commit after updating to 1.9.X"
+     discussion on dev@s.a.o:
+     http://svn.haxx.se/dev/archive-2015-09/0054.shtml */
+  if (status == APR_FROM_OS_ERROR(ERROR_ACCESS_DENIED))
+    {
+      status = SVN_ERR_UNSUPPORTED_FEATURE;
+    }
+
+  if (status)
+    {
+      return svn_error_wrap_apr(status, _("Can't move '%s' to '%s'"),
+                                svn_dirent_local_style(from_path, pool),
+                                svn_dirent_local_style(to_path, pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 #endif /* WIN32 */
 
 svn_error_t *

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/stream.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/stream.c Fri Sep 18 05:06:17 2015
@@ -1051,10 +1051,12 @@ svn_stream_open_unique(svn_stream_t **st
 }
 
 
-svn_stream_t *
-svn_stream_from_aprfile2(apr_file_t *file,
-                         svn_boolean_t disown,
-                         apr_pool_t *pool)
+/* Helper function that creates a stream from an APR file. */
+static svn_stream_t *
+make_stream_from_apr_file(apr_file_t *file,
+                          svn_boolean_t disown,
+                          svn_boolean_t supports_seek,
+                          apr_pool_t *pool)
 {
   struct baton_apr *baton;
   svn_stream_t *stream;
@@ -1068,9 +1070,14 @@ svn_stream_from_aprfile2(apr_file_t *fil
   stream = svn_stream_create(baton, pool);
   svn_stream_set_read2(stream, read_handler_apr, read_full_handler_apr);
   svn_stream_set_write(stream, write_handler_apr);
-  svn_stream_set_skip(stream, skip_handler_apr);
-  svn_stream_set_mark(stream, mark_handler_apr);
-  svn_stream_set_seek(stream, seek_handler_apr);
+
+  if (supports_seek)
+    {
+      svn_stream_set_skip(stream, skip_handler_apr);
+      svn_stream_set_mark(stream, mark_handler_apr);
+      svn_stream_set_seek(stream, seek_handler_apr);
+    }
+
   svn_stream_set_data_available(stream, data_available_handler_apr);
   svn_stream__set_is_buffered(stream, is_buffered_handler_apr);
   stream->file = file;
@@ -1081,6 +1088,14 @@ svn_stream_from_aprfile2(apr_file_t *fil
   return stream;
 }
 
+svn_stream_t *
+svn_stream_from_aprfile2(apr_file_t *file,
+                         svn_boolean_t disown,
+                         apr_pool_t *pool)
+{
+  return make_stream_from_apr_file(file, disown, TRUE, pool);
+}
+
 apr_file_t *
 svn_stream__aprfile(svn_stream_t *stream)
 {
@@ -1717,7 +1732,11 @@ svn_stream_for_stdin(svn_stream_t **in,
   if (apr_err)
     return svn_error_wrap_apr(apr_err, "Can't open stdin");
 
-  *in = svn_stream_from_aprfile2(stdin_file, TRUE, pool);
+  /* STDIN may or may not support positioning requests, but generally
+     it does not, or the behavior is implementation-specific.  Hence,
+     we cannot safely advertise mark(), seek() and non-default skip()
+     support. */
+  *in = make_stream_from_apr_file(stdin_file, TRUE, FALSE, pool);
 
   return SVN_NO_ERROR;
 }
@@ -1733,7 +1752,11 @@ svn_stream_for_stdout(svn_stream_t **out
   if (apr_err)
     return svn_error_wrap_apr(apr_err, "Can't open stdout");
 
-  *out = svn_stream_from_aprfile2(stdout_file, TRUE, pool);
+  /* STDOUT may or may not support positioning requests, but generally
+     it does not, or the behavior is implementation-specific.  Hence,
+     we cannot safely advertise mark(), seek() and non-default skip()
+     support. */
+  *out = make_stream_from_apr_file(stdout_file, TRUE, FALSE, pool);
 
   return SVN_NO_ERROR;
 }
@@ -1749,7 +1772,11 @@ svn_stream_for_stderr(svn_stream_t **err
   if (apr_err)
     return svn_error_wrap_apr(apr_err, "Can't open stderr");
 
-  *err = svn_stream_from_aprfile2(stderr_file, TRUE, pool);
+  /* STDERR may or may not support positioning requests, but generally
+     it does not, or the behavior is implementation-specific.  Hence,
+     we cannot safely advertise mark(), seek() and non-default skip()
+     support. */
+  *err = make_stream_from_apr_file(stderr_file, TRUE, FALSE, pool);
 
   return SVN_NO_ERROR;
 }
@@ -2001,48 +2028,6 @@ struct install_baton_t
 
 #ifdef WIN32
 
-#if _WIN32_WINNT < 0x600 /* Does the SDK assume Windows Vista+? */
-typedef struct _FILE_RENAME_INFO {
-  BOOL   ReplaceIfExists;
-  HANDLE RootDirectory;
-  DWORD  FileNameLength;
-  WCHAR  FileName[1];
-} FILE_RENAME_INFO, *PFILE_RENAME_INFO;
-
-typedef struct _FILE_DISPOSITION_INFO {
-  BOOL DeleteFile;
-} FILE_DISPOSITION_INFO, *PFILE_DISPOSITION_INFO;
-
-#define FileRenameInfo 3
-#define FileDispositionInfo 4
-
-typedef BOOL (WINAPI *SetFileInformationByHandle_t)(HANDLE hFile,
-                                                    int FileInformationClass,
-                                                    LPVOID lpFileInformation,
-                                                    DWORD dwBufferSize);
-
-static volatile SetFileInformationByHandle_t SetFileInformationByHandle_p = 0;
-#define SetFileInformationByHandle (*SetFileInformationByHandle_p)
-
-static volatile svn_atomic_t SetFileInformationByHandle_a = 0;
-
-
-static svn_error_t *
-find_SetFileInformationByHandle(void *baton, apr_pool_t *scratch_pool)
-{
-  HMODULE kernel32 = GetModuleHandle("Kernel32.dll");
-
-  if (kernel32)
-    {
-      SetFileInformationByHandle_p =
-                    (SetFileInformationByHandle_t)
-                      GetProcAddress(kernel32, "SetFileInformationByHandle");
-    }
-
-  return SVN_NO_ERROR;
-}
-#endif /* WIN32 < Vista */
-
 /* Create and open a tempfile in DIRECTORY. Return its handle and path */
 static svn_error_t *
 create_tempfile(HANDLE *hFile,
@@ -2200,98 +2185,40 @@ svn_stream__install_stream(svn_stream_t
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(final_abspath));
 #ifdef WIN32
-
-#if _WIN32_WINNT < 0x600
-  SVN_ERR(svn_atomic__init_once(&SetFileInformationByHandle_a,
-                                find_SetFileInformationByHandle,
-                                NULL, scratch_pool));
-
-  if (!SetFileInformationByHandle_p)
-    SVN_ERR(svn_io_file_close(ib->baton_apr.file, scratch_pool));
-  else
-#endif /* WIN32 < Windows Vista */
+  err = svn_io__win_rename_open_file(ib->baton_apr.file,  ib->tmp_path,
+                                     final_abspath, scratch_pool);
+  if (make_parents && err && APR_STATUS_IS_ENOENT(err->apr_err))
     {
-      WCHAR *w_final_abspath;
-      size_t path_len;
-      size_t rename_size;
-      FILE_RENAME_INFO *rename_info;
-      HANDLE hFile;
-
-      apr_os_file_get(&hFile, ib->baton_apr.file);
-
-      SVN_ERR(svn_io__utf8_to_unicode_longpath(&w_final_abspath,
-                                               svn_dirent_local_style(
-                                                          final_abspath,
-                                                          scratch_pool),
-                                               scratch_pool));
-      path_len = wcslen(w_final_abspath);
-      rename_size = sizeof(*rename_info) + sizeof(WCHAR) * path_len;
-
-      /* The rename info struct doesn't need hacks for long paths,
-         so no ugly escaping calls here */
-      rename_info = apr_pcalloc(scratch_pool, rename_size);
-      rename_info->ReplaceIfExists = TRUE;
-      rename_info->FileNameLength = path_len;
-      memcpy(rename_info->FileName, w_final_abspath, path_len * sizeof(WCHAR));
+      svn_error_t *err2;
 
-      if (!SetFileInformationByHandle(hFile, FileRenameInfo, rename_info,
-                                      rename_size))
-        {
-          svn_boolean_t retry = FALSE;
-          err = svn_error_wrap_apr(apr_get_os_error(), NULL);
+      err2 = svn_io_make_dir_recursively(svn_dirent_dirname(final_abspath,
+                                                    scratch_pool),
+                                         scratch_pool);
 
-          /* ### rhuijben: I wouldn't be surprised if we later find out that we
-                           have to fall back to close+rename on some specific
-                           error values here, to support some non standard NAS
-                           and filesystem scenarios. */
-
-          if (make_parents && err && APR_STATUS_IS_ENOENT(err->apr_err))
-            {
-              svn_error_t *err2;
+      if (err2)
+        return svn_error_trace(svn_error_compose_create(err, err2));
+      else
+        svn_error_clear(err);
 
-              err2 = svn_io_make_dir_recursively(svn_dirent_dirname(final_abspath,
-                                                            scratch_pool),
-                                                 scratch_pool);
+      err = svn_io__win_rename_open_file(ib->baton_apr.file, ib->tmp_path,
+                                         final_abspath, scratch_pool);
+    }
 
-              if (err2)
-                return svn_error_trace(svn_error_compose_create(err, err2));
-              else
-                svn_error_clear(err);
-
-              retry = TRUE;
-              err = NULL;
-            }
-          else if (err && (APR_STATUS_IS_EACCES(err->apr_err)
-                           || APR_STATUS_IS_EEXIST(err->apr_err)))
-            {
-              svn_error_clear(err);
-              retry = TRUE;
-              err = NULL;
-
-              /* Set the destination file writable because Windows will not allow
-                 us to rename when final_abspath is read-only. */
-              SVN_ERR(svn_io_set_file_read_write(final_abspath, TRUE,
-                                                 scratch_pool));
-            }
-
-          if (retry)
-            {
-              if (!SetFileInformationByHandle(hFile, FileRenameInfo,
-                                              rename_info, rename_size))
-                {
-                  err = svn_error_wrap_apr(
-                                apr_get_os_error(),
-                                _("Can't move '%s' to '%s'"),
-                                svn_dirent_local_style(ib->tmp_path,
-                                                       scratch_pool),
-                                svn_dirent_local_style(final_abspath,
-                                                       scratch_pool));
-                }
-            }
-        }
-      else
-        err = NULL;
+  /* ### rhuijben: I wouldn't be surprised if we later find out that we
+                   have to fall back to close+rename on some specific
+                   error values here, to support some non standard NAS
+                   and filesystem scenarios. */
+  if (err && err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
+    {
+      /* Rename open files is not supported on this platform: fallback to
+         svn_io_file_rename2(). */
+      svn_error_clear(err);
+      err = SVN_NO_ERROR;
 
+      SVN_ERR(svn_io_file_close(ib->baton_apr.file, scratch_pool));
+    }
+  else
+    {
       return svn_error_compose_create(err,
                                       svn_io_file_close(ib->baton_apr.file,
                                                         scratch_pool));
@@ -2355,37 +2282,22 @@ svn_stream__install_delete(svn_stream_t
   struct install_baton_t *ib = install_stream->baton;
 
 #ifdef WIN32
-  BOOL done;
-
-#if _WIN32_WINNT < 0x600
-
-  SVN_ERR(svn_atomic__init_once(&SetFileInformationByHandle_a,
-                                find_SetFileInformationByHandle,
-                                NULL, scratch_pool));
+  svn_error_t *err;
 
-  if (!SetFileInformationByHandle_p)
-    done = FALSE;
-  else
-#endif /* WIN32 < Windows Vista */
+  /* Mark the file as delete on close to avoid having to reopen
+     the file as part of the delete handling. */
+  err = svn_io__win_delete_file_on_close(ib->baton_apr.file,  ib->tmp_path,
+                                         scratch_pool);
+  if (err == SVN_NO_ERROR)
     {
-      FILE_DISPOSITION_INFO disposition_info;
-      HANDLE hFile;
-
-      apr_os_file_get(&hFile, ib->baton_apr.file);
-
-      disposition_info.DeleteFile = TRUE;
-
-      /* Mark the file as delete on close to avoid having to reopen
-         the file as part of the delete handling. */
-      done = SetFileInformationByHandle(hFile, FileDispositionInfo,
-                                        &disposition_info,
-                                        sizeof(disposition_info));
+      SVN_ERR(svn_io_file_close(ib->baton_apr.file, scratch_pool));
+      return SVN_NO_ERROR; /* File is already gone */
     }
 
-   SVN_ERR(svn_io_file_close(ib->baton_apr.file, scratch_pool));
-
-   if (done)
-     return SVN_NO_ERROR; /* File is already gone */
+  /* Deleting file on close may be unsupported, so ignore errors and
+     fallback to svn_io_remove_file2(). */
+  svn_error_clear(err);
+  SVN_ERR(svn_io_file_close(ib->baton_apr.file, scratch_pool));
 #endif
 
   return svn_error_trace(svn_io_remove_file2(ib->tmp_path, FALSE,

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/sysinfo.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/sysinfo.c Fri Sep 18 05:06:17 2015
@@ -46,6 +46,7 @@
 
 #include "private/svn_sqlite.h"
 #include "private/svn_subr_private.h"
+#include "private/svn_utf_private.h"
 
 #include "sysinfo.h"
 #include "svn_private_config.h"
@@ -126,7 +127,7 @@ const apr_array_header_t *
 svn_sysinfo__linked_libs(apr_pool_t *pool)
 {
   svn_version_ext_linked_lib_t *lib;
-  apr_array_header_t *array = apr_array_make(pool, 5, sizeof(*lib));
+  apr_array_header_t *array = apr_array_make(pool, 6, sizeof(*lib));
 
   lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "APR";
@@ -157,6 +158,11 @@ svn_sysinfo__linked_libs(apr_pool_t *poo
 #endif
 
   lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
+  lib->name = "Utf8proc";
+  lib->compiled_version = apr_pstrdup(pool, svn_utf__utf8proc_compiled_version());
+  lib->runtime_version = apr_pstrdup(pool, svn_utf__utf8proc_runtime_version());
+
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "ZLib";
   lib->compiled_version = apr_pstrdup(pool, svn_zlib__compiled_version());
   lib->runtime_version = apr_pstrdup(pool, svn_zlib__runtime_version());

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc.c Fri Sep 18 05:06:17 2015
@@ -37,7 +37,19 @@
 #undef strlen
 
 
-const char *svn_utf__utf8proc_version(void)
+
+const char *
+svn_utf__utf8proc_compiled_version(void)
+{
+  static const char utf8proc_version[] =
+                                  APR_STRINGIFY(UTF8PROC_VERSION_MAJOR) "."
+                                  APR_STRINGIFY(UTF8PROC_VERSION_MINOR) "."
+                                  APR_STRINGIFY(UTF8PROC_VERSION_PATCH);
+  return utf8proc_version;
+}
+
+const char *
+svn_utf__utf8proc_runtime_version(void)
 {
   /* Unused static function warning removal hack. */
   SVN_UNUSED(utf8proc_NFD);

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc/utf8proc.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc/utf8proc.h?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc/utf8proc.h (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_subr/utf8proc/utf8proc.h Fri Sep 18 05:06:17 2015
@@ -51,6 +51,27 @@
 #ifndef UTF8PROC_H
 #define UTF8PROC_H
 
+/** @name API version
+ *  
+ * The utf8proc API version MAJOR.MINOR.PATCH, following
+ * semantic-versioning rules (http://semver.org) based on API
+ * compatibility.
+ *
+ * This is also returned at runtime by @ref utf8proc_version; however, the
+ * runtime version may append a string like "-dev" to the version number
+ * for prerelease versions.
+ *
+ * @note The shared-library version number in the Makefile may be different,
+ *       being based on ABI compatibility rather than API compatibility.
+ */
+/** @{ */
+/** The MAJOR version number (increased when backwards API compatibility is broken). */
+#define UTF8PROC_VERSION_MAJOR 1
+/** The MINOR version number (increased when new functionality is added in a backwards-compatible manner). */
+#define UTF8PROC_VERSION_MINOR 1
+/** The PATCH version (increased for fixes that do not change the API). */
+#define UTF8PROC_VERSION_PATCH 5
+/** @} */
 
 /*
  * Define UTF8PROC_INLINE and include utf8proc.c to embed a static

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/adm_crawler.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/adm_crawler.c Fri Sep 18 05:06:17 2015
@@ -1016,6 +1016,7 @@ svn_wc__internal_transmit_text_deltas(co
   svn_checksum_t *local_sha1_checksum;  /* calc'd SHA1 of LOCAL_STREAM */
   svn_wc__db_install_data_t *install_data = NULL;
   svn_error_t *err;
+  svn_error_t *err2;
   svn_stream_t *base_stream;  /* delta source */
   svn_stream_t *local_stream;  /* delta target: LOCAL_ABSPATH transl. to NF */
 
@@ -1112,7 +1113,15 @@ svn_wc__internal_transmit_text_deltas(co
                         scratch_pool, scratch_pool);
 
   /* Close the two streams to force writing the digest */
-  err = svn_error_compose_create(err, svn_stream_close(base_stream));
+  err2 = svn_stream_close(base_stream);
+  if (err2)
+    {
+      /* Set verify_checksum to NULL if svn_stream_close() returns error
+         because checksum will be uninitialized in this case. */
+      verify_checksum = NULL;
+      err = svn_error_compose_create(err, err2);
+    }
+
   err = svn_error_compose_create(err, svn_stream_close(local_stream));
 
   /* If we have an error, it may be caused by a corrupt text base,

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/update_editor.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/update_editor.c Fri Sep 18 05:06:17 2015
@@ -1863,13 +1863,14 @@ add_directory(const char *path,
   SVN_ERR_ASSERT(! (copyfrom_path || SVN_IS_VALID_REVNUM(copyfrom_rev)));
 
   SVN_ERR(make_dir_baton(&db, path, eb, pb, TRUE, pool));
-  SVN_ERR(calculate_repos_relpath(&db->new_repos_relpath, db->local_abspath,
-                                  NULL, eb, pb, db->pool, scratch_pool));
   *child_baton = db;
 
   if (db->skip_this)
     return SVN_NO_ERROR;
 
+  SVN_ERR(calculate_repos_relpath(&db->new_repos_relpath, db->local_abspath,
+                                  NULL, eb, pb, db->pool, scratch_pool));
+
   SVN_ERR(mark_directory_edited(db, pool));
 
   if (strcmp(eb->target_abspath, db->local_abspath) == 0)
@@ -3066,13 +3067,13 @@ add_file(const char *path,
   SVN_ERR_ASSERT(! (copyfrom_path || SVN_IS_VALID_REVNUM(copyfrom_rev)));
 
   SVN_ERR(make_file_baton(&fb, pb, path, TRUE, pool));
-  SVN_ERR(calculate_repos_relpath(&fb->new_repos_relpath, fb->local_abspath,
-                                  NULL, eb, pb, fb->pool, pool));
   *file_baton = fb;
 
   if (fb->skip_this)
     return SVN_NO_ERROR;
 
+  SVN_ERR(calculate_repos_relpath(&fb->new_repos_relpath, fb->local_abspath,
+                                  NULL, eb, pb, fb->pool, pool));
   SVN_ERR(mark_file_edited(fb, pool));
 
   /* The file_pool can stick around for a *long* time, so we want to
@@ -3551,15 +3552,23 @@ lazy_open_target(svn_stream_t **stream,
                  apr_pool_t *scratch_pool)
 {
   struct handler_baton *hb = baton;
+  svn_wc__db_install_data_t *install_data;
 
+  /* By convention return value is undefined on error, but we rely
+     on HB->INSTALL_DATA value in window_handler() and abort
+     INSTALL_STREAM if is not NULL on error.
+     So we store INSTALL_DATA to local variable first, to leave
+     HB->INSTALL_DATA unchanged on error. */
   SVN_ERR(svn_wc__db_pristine_prepare_install(stream,
-                                              &hb->install_data,
+                                              &install_data,
                                               &hb->new_text_base_sha1_checksum,
                                               NULL,
                                               hb->fb->edit_baton->db,
                                               hb->fb->dir_baton->local_abspath,
                                               result_pool, scratch_pool));
 
+  hb->install_data = install_data;
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db.c Fri Sep 18 05:06:17 2015
@@ -6799,6 +6799,75 @@ clear_moved_to(svn_wc__db_wcroot_t *wcro
   return SVN_NO_ERROR;
 }
 
+/* Helper function for op_revert_txn. Raises move tree conflicts on
+   descendants to ensure database stability on a non recursive revert
+   of an ancestor that contains a possible move related tree conflict.
+ */
+static svn_error_t *
+revert_maybe_raise_moved_away(svn_wc__db_wcroot_t * wcroot,
+                              svn_wc__db_t *db,
+                              const char *local_relpath,
+                              int op_depth_below,
+                              apr_pool_t *scratch_pool)
+{
+  svn_skel_t *conflict;
+  svn_wc_operation_t operation;
+  svn_boolean_t tree_conflicted;
+  const apr_array_header_t *locations;
+  svn_wc_conflict_reason_t reason;
+  svn_wc_conflict_action_t action;
+
+  SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, NULL, wcroot,
+                                            local_relpath,
+                                            scratch_pool, scratch_pool));
+
+  if (!conflict)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_info(&operation, &locations, NULL, NULL,
+                                     &tree_conflicted,
+                                     db, wcroot->abspath,
+                                     conflict,
+                                     scratch_pool, scratch_pool));
+
+  if (!tree_conflicted
+      || (operation != svn_wc_operation_update
+          && operation != svn_wc_operation_switch))
+    {
+      return SVN_NO_ERROR;
+    }
+
+  SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
+                                              NULL,
+                                              db, wcroot->abspath,
+                                              conflict,
+                                              scratch_pool,
+                                              scratch_pool));
+
+  if (reason == svn_wc_conflict_reason_deleted
+      || reason == svn_wc_conflict_reason_replaced)
+    {
+      SVN_ERR(svn_wc__db_op_raise_moved_away_internal(
+        wcroot, local_relpath, op_depth_below, db,
+        operation, action,
+        (locations && locations->nelts > 0)
+        ? APR_ARRAY_IDX(locations, 0,
+                        const svn_wc_conflict_version_t *)
+        : NULL,
+        (locations && locations->nelts > 1)
+        ? APR_ARRAY_IDX(locations, 1,
+                        const svn_wc_conflict_version_t *)
+        : NULL,
+        scratch_pool));
+
+      /* Transform the move information into revert information */
+      SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
+                                          STMT_MOVE_NOTIFY_TO_REVERT));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Baton for op_revert_txn and op_revert_recursive_txn */
 struct revert_baton_t
 {
@@ -6823,9 +6892,7 @@ op_revert_txn(void *baton,
   svn_boolean_t moved_here;
   int affected_rows;
   const char *moved_to;
-  int op_depth_increased = 0;
   int op_depth_below;
-  svn_skel_t *conflict;
 
   /* ### Similar structure to op_revert_recursive_txn, should they be
          combined? */
@@ -6887,16 +6954,11 @@ op_revert_txn(void *baton,
                                                 local_relpath, op_depth,
                                                 moved_to, NULL, scratch_pool));
     }
-  else
-    {
-      SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, NULL, wcroot,
-                                                local_relpath,
-                                                scratch_pool, scratch_pool));
-    }
-
 
   if (op_depth > 0 && op_depth == relpath_depth(local_relpath))
     {
+      int op_depth_increased;
+
       /* Can't do non-recursive revert if children exist */
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SELECT_GE_OP_DEPTH_CHILDREN));
@@ -6935,54 +6997,12 @@ op_revert_txn(void *baton,
       /* If this node was moved-here, clear moved-to at the move source. */
       if (moved_here)
         SVN_ERR(clear_moved_to(wcroot, local_relpath, scratch_pool));
-    }
-
-  if (op_depth_increased && conflict)
-    {
-      svn_wc_operation_t operation;
-      svn_boolean_t tree_conflicted;
-      const apr_array_header_t *locations;
-
-      SVN_ERR(svn_wc__conflict_read_info(&operation, &locations, NULL, NULL,
-                                          &tree_conflicted,
-                                          db, wcroot->abspath,
-                                          conflict,
-                                          scratch_pool, scratch_pool));
-      if (tree_conflicted
-          && (operation == svn_wc_operation_update
-              || operation == svn_wc_operation_switch))
-        {
-          svn_wc_conflict_reason_t reason;
-          svn_wc_conflict_action_t action;
-
-          SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
-                                                      NULL,
-                                                      db, wcroot->abspath,
-                                                      conflict,
-                                                      scratch_pool,
-                                                      scratch_pool));
-
-          if (reason == svn_wc_conflict_reason_deleted
-              || reason == svn_wc_conflict_reason_replaced)
-            {
-              SVN_ERR(svn_wc__db_op_raise_moved_away_internal(
-                          wcroot, local_relpath, op_depth_below, db,
-                          operation, action,
-                          (locations && locations->nelts > 0)
-                            ? APR_ARRAY_IDX(locations, 0,
-                                            const svn_wc_conflict_version_t *)
-                            : NULL,
-                          (locations && locations->nelts > 1)
-                            ? APR_ARRAY_IDX(locations, 1,
-                                            const svn_wc_conflict_version_t *)
-                            : NULL,
-                          scratch_pool));
 
-              /* Transform the move information into revert information */
-              SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb,
-                                                  STMT_MOVE_NOTIFY_TO_REVERT));
-            }
-        }
+      /* If the node was moved itself, we don't have interesting moved
+         children (and the move itself was already broken) */
+      if (op_depth_increased && !moved_to)
+        SVN_ERR(revert_maybe_raise_moved_away(wcroot, db, local_relpath,
+                                              op_depth_below, scratch_pool));
     }
 
   if (rvb->clear_changelists)
@@ -8740,6 +8760,45 @@ svn_wc__db_op_delete_many(svn_wc__db_t *
                                            scratch_pool));
 }
 
+/* Helper function for read_info() to provide better diagnostics than just
+   asserting.
+
+   ### BH: Yes this code is ugly, and that is why I only introduce it in
+   ### read_info(). But we really need something to determine the root cause
+   ### of this problem to diagnose why TortoiseSVN users were seeing all those
+   ### assertions.
+
+   Adds an error to the *err chain if invalid values are encountered. In that
+   case the value is set to the first value in the map, assuming that caller
+   will just return the combined error.
+ */
+static int
+column_token_err(svn_error_t **err,
+                 svn_sqlite__stmt_t *stmt,
+                 int column,
+                 const svn_token_map_t *map)
+{
+  svn_error_t *err2;
+  const char *word = svn_sqlite__column_text(stmt, column, NULL);
+  int value;
+
+  /* svn_token__from_word_err() handles NULL for us */
+  err2 = svn_token__from_word_err(&value, map, word);
+
+  if (err2)
+    {
+      *err = svn_error_compose_create(
+                *err,
+                svn_error_createf(
+                    SVN_ERR_WC_CORRUPT, err2,
+                    _("Encountered invalid node state in column %d of "
+                      "info query to working copy database"),
+                    column));
+      value = map[0].val;
+    }
+
+  return value;
+}
 
 /* Like svn_wc__db_read_info(), but taking WCROOT+LOCAL_RELPATH instead of
    DB+LOCAL_ABSPATH, and outputting repos ids instead of URL+UUID. */
@@ -8807,11 +8866,11 @@ read_info(svn_wc__db_status_t *status,
       svn_node_kind_t node_kind;
 
       op_depth = svn_sqlite__column_int(stmt_info, 0);
-      node_kind = svn_sqlite__column_token(stmt_info, 4, kind_map);
+      node_kind = column_token_err(&err, stmt_info, 4, kind_map);
 
       if (status)
         {
-          *status = svn_sqlite__column_token(stmt_info, 3, presence_map);
+          *status = column_token_err(&err, stmt_info, 3, presence_map);
 
           if (op_depth != 0) /* WORKING */
             err = svn_error_compose_create(err,
@@ -8863,14 +8922,11 @@ read_info(svn_wc__db_status_t *status,
       if (depth)
         {
           if (node_kind != svn_node_dir)
-            {
-              *depth = svn_depth_unknown;
-            }
+            *depth = svn_depth_unknown;
+          else if (svn_sqlite__column_is_null(stmt_info, 11))
+            *depth = svn_depth_unknown;
           else
-            {
-              *depth = svn_sqlite__column_token_null(stmt_info, 11, depth_map,
-                                                     svn_depth_unknown);
-            }
+            *depth = column_token_err(&err, stmt_info, 11, depth_map);
         }
       if (checksum)
         {
@@ -15117,7 +15173,7 @@ make_copy_txn(svn_wc__db_wcroot_t *wcroo
       const char *name = svn_relpath_skip_ancestor(last_repos_relpath,
                                                    repos_relpath);
 
-      if (strcmp(name, svn_relpath_basename(local_relpath, NULL)) == 0)
+      if (name && strcmp(name, svn_relpath_basename(local_relpath, NULL)) == 0)
         op_depth = last_op_depth;
     }
 

Modified: subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db_pristine.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/libsvn_wc/wc_db_pristine.c Fri Sep 18 05:06:17 2015
@@ -335,7 +335,6 @@ pristine_install_txn(svn_sqlite__db_t *s
     apr_finfo_t finfo;
     SVN_ERR(svn_stream__install_get_info(&finfo, install_stream, APR_FINFO_SIZE,
                                          scratch_pool));
-    SVN_ERR(svn_io_set_file_read_write(pristine_abspath, TRUE, scratch_pool));
     SVN_ERR(svn_stream__install_stream(install_stream, pristine_abspath,
                                         TRUE, scratch_pool));
 
@@ -383,9 +382,10 @@ svn_wc__db_pristine_prepare_install(svn_
   *install_data = apr_pcalloc(result_pool, sizeof(**install_data));
   (*install_data)->wcroot = wcroot;
 
-  SVN_ERR(svn_stream__create_for_install(stream,
-                                         temp_dir_abspath,
-                                         result_pool, scratch_pool));
+  SVN_ERR_W(svn_stream__create_for_install(stream,
+                                           temp_dir_abspath,
+                                           result_pool, scratch_pool),
+            _("Unable to create pristine install stream"));
 
   (*install_data)->inner_stream = *stream;
 

Modified: subversion/branches/1.9.x-r1700215/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/svnadmin/svnadmin.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/svnadmin/svnadmin.c Fri Sep 18 05:06:17 2015
@@ -1089,8 +1089,7 @@ repos_notify_handler(void *baton,
                                             "%" APR_INT64_T_FMT,
                                             notify->shard);
         svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
-                              _("Packing revision properties"
-                                " in shard %s..."),
+                              _("Packed revision properties in shard %s\n"),
                               shardstr));
         return;
       }
@@ -1101,8 +1100,8 @@ repos_notify_handler(void *baton,
                                             "%" APR_INT64_T_FMT,
                                             notify->shard);
         svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
-                              _("Removing non-packed revision properties"
-                                " in shard %s..."),
+                              _("Removed non-packed revision properties"
+                                " in shard %s\n"),
                               shardstr));
         return;
       }

Modified: subversion/branches/1.9.x-r1700215/subversion/svnfsfs/stats-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/svnfsfs/stats-cmd.c?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/svnfsfs/stats-cmd.c (original)
+++ subversion/branches/1.9.x-r1700215/subversion/svnfsfs/stats-cmd.c Fri Sep 18 05:06:17 2015
@@ -20,6 +20,8 @@
  * ====================================================================
  */
 
+#include <assert.h>
+
 #include "svn_fs.h"
 #include "svn_pools.h"
 #include "svn_sorts.h"
@@ -47,10 +49,10 @@ print_two_power(int i,
    */
   const char *si_prefixes = " kMGTPEZY";
 
-  int number = (1 << (i % 10));
-  int thousands = i / 10;
+  int number = (i >= 0) ? (1 << (i % 10)) : 0;
+  int thousands = (i >= 0) ? (i / 10) : 0;
 
-  char si_prefix = ((thousands >= 0) && (thousands < strlen(si_prefixes)))
+  char si_prefix = (thousands < strlen(si_prefixes))
                  ? si_prefixes[thousands]
                  : '?';
 
@@ -235,6 +237,10 @@ print_extensions_by_changes(svn_fs_fs__s
     {
       svn_fs_fs__extension_info_t *info
         = APR_ARRAY_IDX(data, i, svn_fs_fs__extension_info_t *);
+
+      /* If there are elements, then their count cannot be 0. */
+      assert(stats->file_histogram.total.count);
+
       sum += info->node_histogram.total.count;
       printf(_("%11s %20s (%2d%%) representations\n"),
              info->extension,
@@ -243,11 +249,28 @@ print_extensions_by_changes(svn_fs_fs__s
                    stats->file_histogram.total.count));
     }
 
-  printf(_("%11s %20s (%2d%%) representations\n"),
-         "(others)",
-         svn__ui64toa_sep(stats->file_histogram.total.count - sum, ',', pool),
-         (int)((stats->file_histogram.total.count - sum) * 100 /
-               stats->file_histogram.total.count));
+  if (stats->file_histogram.total.count)
+    {
+      printf(_("%11s %20s (%2d%%) representations\n"),
+             "(others)",
+             svn__ui64toa_sep(stats->file_histogram.total.count - sum, ',',
+                              pool),
+             (int)((stats->file_histogram.total.count - sum) * 100 /
+                   stats->file_histogram.total.count));
+    }
+}
+
+/* Calculate a percentage, handling edge cases. */
+static int
+get_percentage(apr_uint64_t part,
+               apr_uint64_t total)
+{
+  /* This include total == 0. */
+  if (part >= total)
+    return 100;
+
+  /* Standard case. */
+  return (int)(part * 100.0 / total);
 }
 
 /* Print the (up to) 16 extensions in STATS with the largest total size of
@@ -269,15 +292,20 @@ print_extensions_by_nodes(svn_fs_fs__sta
       printf(_("%11s %20s (%2d%%) bytes\n"),
              info->extension,
              svn__ui64toa_sep(info->node_histogram.total.sum, ',', pool),
-             (int)(info->node_histogram.total.sum * 100 /
-                   stats->file_histogram.total.sum));
+             get_percentage(info->node_histogram.total.sum,
+                            stats->file_histogram.total.sum));
     }
 
-  printf(_("%11s %20s (%2d%%) bytes\n"),
-         "(others)",
-         svn__ui64toa_sep(stats->file_histogram.total.sum - sum, ',', pool),
-         (int)((stats->file_histogram.total.sum - sum) * 100 /
-               stats->file_histogram.total.sum));
+  if (stats->file_histogram.total.sum > sum)
+    {
+      /* Total sum can't be zero here. */
+      printf(_("%11s %20s (%2d%%) bytes\n"),
+             "(others)",
+             svn__ui64toa_sep(stats->file_histogram.total.sum - sum, ',',
+                              pool),
+             get_percentage(stats->file_histogram.total.sum - sum,
+                            stats->file_histogram.total.sum));
+    }
 }
 
 /* Print the (up to) 16 extensions in STATS with the largest total size of
@@ -299,16 +327,20 @@ print_extensions_by_reps(svn_fs_fs__stat
       printf(_("%11s %20s (%2d%%) bytes\n"),
              info->extension,
              svn__ui64toa_sep(info->rep_histogram.total.sum, ',', pool),
-             (int)(info->rep_histogram.total.sum * 100 /
-                   stats->rep_size_histogram.total.sum));
+             get_percentage(info->rep_histogram.total.sum,
+                            stats->rep_size_histogram.total.sum));
     }
 
-  printf(_("%11s %20s (%2d%%) bytes\n"),
-         "(others)",
-         svn__ui64toa_sep(stats->rep_size_histogram.total.sum - sum, ',',
-                          pool),
-         (int)((stats->rep_size_histogram.total.sum - sum) * 100 /
-               stats->rep_size_histogram.total.sum));
+  if (stats->rep_size_histogram.total.sum > sum)
+    {
+      /* Total sum can't be zero here. */
+      printf(_("%11s %20s (%2d%%) bytes\n"),
+             "(others)",
+             svn__ui64toa_sep(stats->rep_size_histogram.total.sum - sum, ',',
+                              pool),
+             get_percentage(stats->rep_size_histogram.total.sum - sum,
+                            stats->rep_size_histogram.total.sum));
+    }
 }
 
 /* Print per-extension histograms for the most frequent extensions in STATS.

Modified: subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/merge_automatic_tests.py?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/merge_automatic_tests.py Fri Sep 18 05:06:17 2015
@@ -1327,6 +1327,31 @@ def reintegrate_subtree_not_updated(sbox
   sbox.simple_commit()
   sbox.simple_update()
 
+def merge_to_copy_and_add(sbox):
+  "merge peg to a copy and add"
+
+  sbox.build()
+
+  sbox.simple_copy('A', 'AA')
+  sbox.simple_append('A/mu', 'A/mu')
+  sbox.simple_commit('A')
+
+  # This is the scenario the code is supposed to support; a copy
+  svntest.actions.run_and_verify_svn(None, [],
+                                     'merge', '^/A', sbox.ospath('AA'))
+
+  sbox.simple_mkdir('A3')
+  # And this case currently segfaults, because merge doesn't check
+  # if the path has a repository location
+  expected_err = ".*svn: E195012: Can't perform .*A3'.*added.*"
+  svntest.actions.run_and_verify_svn(None, expected_err,
+                                     'merge', '^/A', sbox.ospath('A3'))
+  # Try the same merge with --reintegrate, for completeness' sake.
+  expected_err = ".*svn: E195012: Can't reintegrate into .*A3'.*added.*"
+  svntest.actions.run_and_verify_svn(None, expected_err,
+                                     'merge', '--reintegrate', '^/A',
+                                     sbox.ospath('A3'))
+
 ########################################################################
 # Run the tests
 
@@ -1356,6 +1381,7 @@ test_list = [ None,
               auto_merge_handles_replacements_in_merge_source,
               effective_sync_results_in_reintegrate,
               reintegrate_subtree_not_updated,
+              merge_to_copy_and_add,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/revert_tests.py?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/revert_tests.py Fri Sep 18 05:06:17 2015
@@ -1630,7 +1630,13 @@ def revert_obstructing_wc(sbox):
   svntest.actions.run_and_verify_svn("Skipped '.*A' -- .*obstruct.*", [],
                                      'revert', '-R', wc_dir)
 
+def revert_moved_dir_partial(sbox):
+  "partial revert moved_dir"
 
+  sbox.build(read_only = True)
+
+  sbox.simple_move('A', 'A_')
+  svntest.actions.run_and_verify_svn(None, [], 'revert', sbox.ospath('A'))
 
 
 ########################################################################
@@ -1673,6 +1679,7 @@ test_list = [ None,
               revert_with_unversioned_targets,
               revert_nonexistent,
               revert_obstructing_wc,
+              revert_moved_dir_partial,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnfsfs_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnfsfs_tests.py?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnfsfs_tests.py (original)
+++ subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnfsfs_tests.py Fri Sep 18 05:06:17 2015
@@ -173,6 +173,15 @@ def load_index_sharded(sbox):
   svntest.actions.run_and_verify_svnadmin(expected_output, [],
                                           "verify", sbox.repo_dir)
 
+@SkipUnless(svntest.main.is_fs_type_fsfs)
+def test_stats_on_empty_repo(sbox):
+  "stats on empty repo shall not crash"
+
+  sbox.build(create_wc=False, empty=True)
+
+  exit_code, output, errput = \
+    svntest.actions.run_and_verify_svnfsfs(None, [], 'stats', sbox.repo_dir)
+
 ########################################################################
 # Run the tests
 
@@ -180,6 +189,7 @@ def load_index_sharded(sbox):
 # list all tests here, starting with None:
 test_list = [ None,
               load_index_sharded,
+              test_stats_on_empty_repo,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnmucc_tests.py?rev=1703741&r1=1703740&r2=1703741&view=diff
==============================================================================
--- subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/branches/1.9.x-r1700215/subversion/tests/cmdline/svnmucc_tests.py Fri Sep 18 05:06:17 2015
@@ -106,7 +106,9 @@ def basic_svnmucc(sbox):
 
   sbox.build()
   empty_file = sbox.ospath('empty')
+  file = sbox.ospath('file')
   svntest.main.file_append(empty_file, '')
+  svntest.main.file_append(file, 'file')
 
   # revision 2
   test_svnmucc(sbox.repo_url,
@@ -301,6 +303,14 @@ def basic_svnmucc(sbox):
                'propsetf', 'testprop', empty_file, 'foo/z.c',
                'propsetf', 'testprop', empty_file, 'foo/foo')
 
+  # revision 21
+  test_svnmucc(sbox.repo_url,
+               ['M /foo/z.c',
+                ], #---------
+               '-m', 'log msg',
+               'propset', 'testprop', 'false', 'foo/z.c',
+               'put', file, 'foo/z.c')
+
   # Expected missing revision error
   xtest_svnmucc(sbox.repo_url,
                 ["svnmucc: E200004: 'a' is not a revision"
@@ -453,6 +463,132 @@ rm A/B/C/Y
                                      'log', '-qvr3', repo_url)
 
 
+def prohibited_deletes_and_moves(sbox):
+  "test prohibited delete and move operations"
+
+  # These action sequences were allowed in 1.8.13, but are prohibited in 1.9.x
+  # and later.  Most of them probably indicate an inadvertent user mistake.
+  # See dev@, 2015-05-11, "Re: Issue 4579 / svnmucc fails to process certain
+  # deletes", <http://svn.haxx.se/dev/archive-2015-05/0038.shtml>
+
+  sbox.build(read_only = True)
+  svntest.main.file_write(sbox.ospath('file'), "New contents")
+
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't delete node at 'iota'",
+                 ], #---------
+                '-m', 'r2: modify and delete /iota',
+                'put', sbox.ospath('file'), 'iota',
+                'rm', 'iota')
+
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't delete node at 'iota'",
+                 ], #---------
+                '-m', 'r2: propset and delete /iota',
+                'propset', 'prop', 'val', 'iota',
+                'rm', 'iota')
+
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E160013: Can't delete node at 'iota' as it does "
+                 "not exist",
+                 ], #---------
+                '-m', 'r2: delete and delete /iota',
+                'rm', 'iota',
+                'rm', 'iota')
+
+  # Subversion 1.8.13 used to move /iota without applying the text change.
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't delete node at 'iota'",
+                 ], #---------
+                '-m', 'r2: modify and move /iota',
+                'put', sbox.ospath('file'), 'iota',
+                'mv', 'iota', 'iota2')
+
+  # Subversion 1.8.13 used to move /A without applying the inner remove.
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't delete node at 'A'",
+                 ], #---------
+                '-m', 'r2: delete /A/B and move /A',
+                'rm', 'A/B',
+                'mv', 'A', 'A1')
+
+def svnmucc_type_errors(sbox):
+  "test type errors"
+
+  sbox.build(read_only=True)
+
+  sbox.simple_append('file', 'New contents')
+
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E160016: Can't operate on 'B' "
+                "because 'A' is not a directory"],
+                '-m', '',
+                'put', sbox.ospath('file'), 'A',
+                'mkdir', 'A/B',
+                'propset', 'iota', 'iota', 'iota')
+
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't delete node at 'A'"],
+                '-m', '',
+                'mkdir', 'A/Z',
+                'put', sbox.ospath('file'), 'A')
+
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E160020: Path 'Z' already exists"],
+                '-m', '',
+                'mkdir', 'A/Z',
+                'put', sbox.ospath('file'), 'A/Z')
+
+def svnmucc_propset_and_put(sbox):
+  "propset and put"
+
+  sbox.build()
+
+  sbox.simple_append('file', 'New contents')
+
+  # First in the sane order: put, then propset
+  xtest_svnmucc(sbox.repo_url,
+                [],
+                '-m', '',
+                'put', sbox.ospath('file'), 't1',
+                'propset', 't1', 't1', 't1')
+
+  # And now in an impossible order: propset, then put
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't set properties at not existing 't2'"],
+                '-m', '',
+                'propset', 't2', 't2', 't2',
+                'put', sbox.ospath('file'), 't2')
+
+  # And if the target already exists (dir)
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't delete node at 'A'"],
+                '-m', '',
+                'propset', 'A', 'A', 'A',
+                'put', sbox.ospath('file'), 'A')
+
+  # And if the target already exists (file) # fixed in r1702467
+  xtest_svnmucc(sbox.repo_url,
+                [],
+                '-m', '',
+                'propset', 'iota', 'iota', 'iota',
+                'put', sbox.ospath('file'), 'iota')
+
+  # Put same file twice (non existing)
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E160020: Path 't3' already exists"],
+                '-m', '',
+                'put', sbox.ospath('file'), 't3',
+                'put', sbox.ospath('file'), 't3')
+
+  # Put same file twice (existing)
+  xtest_svnmucc(sbox.repo_url,
+                ["svnmucc: E200009: Can't update file at 't1'"],
+                '-m', '',
+                'put', sbox.ospath('file'), 't1',
+                'put', sbox.ospath('file'), 't1')
+
+
 ######################################################################
 
 test_list = [ None,
@@ -462,6 +598,9 @@ test_list = [ None,
               too_many_log_messages,
               no_log_msg_non_interactive,
               nested_replaces,
+              prohibited_deletes_and_moves,
+              svnmucc_type_errors,
+              svnmucc_propset_and_put,
             ]
 
 if __name__ == '__main__':