subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1411977 - in /subversion/branches/issue-4194-dev: ./ subversion/include/ subversion/libsvn_client/ subversion/libsvn_diff/ subversion/libsvn_ra_serf/ subversion/svn/ subversion/svnlook/
Date Wed, 21 Nov 2012 02:36:42 GMT
Author: cmpilato
Date: Wed Nov 21 02:36:40 2012
New Revision: 1411977

URL: http://svn.apache.org/viewvc?rev=1411977&view=rev
Log:
On the 'issue-4194-dev' branch: sync with recent trunk changes.
(Merged /subversion/trunk:r1411796-1411976)

Modified:
    subversion/branches/issue-4194-dev/   (props changed)
    subversion/branches/issue-4194-dev/subversion/include/svn_diff.h
    subversion/branches/issue-4194-dev/subversion/libsvn_client/diff.c
    subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff.h
    subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_file.c
    subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_memory.c
    subversion/branches/issue-4194-dev/subversion/libsvn_diff/util.c
    subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/replay.c
    subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/serf.c
    subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/update.c
    subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/util.c
    subversion/branches/issue-4194-dev/subversion/svn/propget-cmd.c
    subversion/branches/issue-4194-dev/subversion/svn/proplist-cmd.c
    subversion/branches/issue-4194-dev/subversion/svnlook/main.c

Propchange: subversion/branches/issue-4194-dev/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1411796-1411976

Modified: subversion/branches/issue-4194-dev/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/include/svn_diff.h?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/include/svn_diff.h (original)
+++ subversion/branches/issue-4194-dev/subversion/include/svn_diff.h Wed Nov 21 02:36:40 2012
@@ -279,6 +279,9 @@ svn_diff_contains_diffs(svn_diff_t *diff
  * Differences, similarities, and conflicts are described by lining up
  * "ranges" of data.
  *
+ * Any of the function pointers in this vtable may be NULL to ignore the
+ * corresponding kinds of output.
+ *
  * @note These callbacks describe data ranges in units of "tokens".
  * A "token" is whatever you've defined it to be in your datasource
  * @c svn_diff_fns_t vtable.

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_client/diff.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_client/diff.c Wed Nov 21 02:36:40
2012
@@ -619,8 +619,8 @@ display_prop_diffs(const apr_array_heade
     {
       const char *action;
       const svn_string_t *original_value;
-      const svn_prop_t *propchange =
-        &APR_ARRAY_IDX(propchanges, i, svn_prop_t);
+      const svn_prop_t *propchange
+        = &APR_ARRAY_IDX(propchanges, i, svn_prop_t);
 
       if (original_props)
         original_value = apr_hash_get(original_props,
@@ -629,7 +629,9 @@ display_prop_diffs(const apr_array_heade
         original_value = NULL;
 
       /* If the property doesn't exist on either side, or if it exists
-         with the same value, skip it.  */
+         with the same value, skip it.  This can happen if the client is
+         hitting an old mod_dav_svn server that doesn't understand the
+         "send-all" REPORT style. */
       if ((! (original_value || propchange->value))
           || (original_value && propchange->value
               && svn_string_compare(original_value, propchange->value)))
@@ -698,13 +700,11 @@ display_prop_diffs(const apr_array_heade
          * UNIX patch could apply the property diff to, so we use "##"
          * instead of "@@" as the default hunk delimiter for property diffs.
          * We also supress the diff header. */
-        SVN_ERR(svn_diff_mem_string_output_unified2(outstream, diff, FALSE,
-                                                    "##",
-                                           svn_dirent_local_style(path,
-                                                                  iterpool),
-                                           svn_dirent_local_style(path,
-                                                                  iterpool),
-                                           encoding, orig, val, iterpool));
+        SVN_ERR(svn_diff_mem_string_output_unified2(
+                  outstream, diff, FALSE, "##",
+                  svn_dirent_local_style(path, iterpool),
+                  svn_dirent_local_style(path, iterpool),
+                  encoding, orig, val, iterpool));
         if (!val_has_eol)
           {
             const char *s = "\\ No newline at end of property" APR_EOL_STR;

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff.h?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff.h (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff.h Wed Nov 21 02:36:40 2012
@@ -184,5 +184,48 @@ svn_diff__normalize_buffer(char **tgt,
                            const char *buf,
                            const svn_diff_file_options_t *opts);
 
+/* Set *OUT_STR to a newline followed by a "\ No newline at end of file" line.
+ *
+ * The text will be encoded into HEADER_ENCODING.
+ */
+svn_error_t *
+svn_diff__unified_append_no_newline_msg(svn_stringbuf_t *stringbuf,
+                                        const char *header_encoding,
+                                        apr_pool_t *scratch_pool);
+
+/* Write a unidiff hunk header to OUTPUT_STREAM.
+ *
+ * The header will use HUNK_DELIMITER (which should usually be "@@") before
+ * and after the line-number ranges which are formed from OLD_START,
+ * OLD_LENGTH, NEW_START and NEW_LENGTH.  If HUNK_EXTRA_CONTEXT is not NULL,
+ * it will be written after the final delimiter, with an intervening space.
+ *
+ * The text will be encoded into HEADER_ENCODING.
+ */
+svn_error_t *
+svn_diff__unified_write_hunk_header(svn_stream_t *output_stream,
+                                    const char *header_encoding,
+                                    const char *hunk_delimiter,
+                                    apr_off_t old_start,
+                                    apr_off_t old_length,
+                                    apr_off_t new_start,
+                                    apr_off_t new_length,
+                                    const char *hunk_extra_context,
+                                    apr_pool_t *scratch_pool);
+
+/* Write a unidiff "---" and "+++" header to OUTPUT_STREAM.
+ *
+ * Write "---" followed by a space and OLD_HEADER and a newline,
+ * then "+++" followed by a space and NEW_HEADER and a newline.
+ *
+ * The text will be encoded into HEADER_ENCODING.
+ */
+svn_error_t *
+svn_diff__unidiff_write_header(svn_stream_t *output_stream,
+                               const char *header_encoding,
+                               const char *old_header,
+                               const char *new_header,
+                               apr_pool_t *scratch_pool);
+
 
 #endif /* DIFF_H */

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_file.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_file.c Wed Nov 21 02:36:40
2012
@@ -1491,14 +1491,8 @@ output_unified_line(svn_diff__file_outpu
       if (bytes_processed && (type != svn_diff__file_output_unified_skip)
           && ! had_cr)
         {
-          const char *out_str;
-          SVN_ERR(svn_utf_cstring_from_utf8_ex2(
-               &out_str,
-               /* The string below is intentionally not marked for translation,
-                  for wider interoperability with patch(1) programs. */
-               APR_EOL_STR "\\ No newline at end of file" APR_EOL_STR,
-               baton->header_encoding, baton->pool));
-          svn_stringbuf_appendcstr(baton->hunk, out_str);
+          SVN_ERR(svn_diff__unified_append_no_newline_msg(
+                    baton->hunk, baton->header_encoding, baton->pool));
         }
 
       baton->length[idx] = 0;
@@ -1538,41 +1532,13 @@ output_unified_flush_hunk(svn_diff__file
         baton->hunk_start[i]++;
     }
 
-  /* Output the hunk header.  If the hunk length is 1, the file is a one line
-     file.  In this case, surpress the number of lines in the hunk (it is
-     1 implicitly)
-   */
-  SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                      baton->header_encoding,
-                                      baton->pool,
-                                      "@@ -%" APR_OFF_T_FMT,
-                                      baton->hunk_start[0]));
-  if (baton->hunk_length[0] != 1)
-    {
-      SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                          baton->header_encoding,
-                                          baton->pool, ",%" APR_OFF_T_FMT,
-                                          baton->hunk_length[0]));
-    }
-
-  SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                      baton->header_encoding,
-                                      baton->pool, " +%" APR_OFF_T_FMT,
-                                      baton->hunk_start[1]));
-  if (baton->hunk_length[1] != 1)
-    {
-      SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                          baton->header_encoding,
-                                          baton->pool, ",%" APR_OFF_T_FMT,
-                                          baton->hunk_length[1]));
-    }
-
-  SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                      baton->header_encoding,
-                                      baton->pool, " @@%s%s" APR_EOL_STR,
-                                      baton->hunk_extra_context[0]
-                                      ? " " : "",
-                                      baton->hunk_extra_context));
+  /* Write the hunk header */
+  SVN_ERR(svn_diff__unified_write_hunk_header(
+            baton->output_stream, baton->header_encoding, "@@",
+            baton->hunk_start[0], baton->hunk_length[0],
+            baton->hunk_start[1], baton->hunk_length[1],
+            baton->hunk_extra_context,
+            baton->pool));
 
   /* Output the hunk content */
   hunk_len = baton->hunk->len;
@@ -1733,10 +1699,9 @@ svn_diff_file_output_unified3(svn_stream
                               svn_boolean_t show_c_function,
                               apr_pool_t *pool)
 {
-  svn_diff__file_output_baton_t baton;
-
   if (svn_diff_contains_diffs(diff))
     {
+      svn_diff__file_output_baton_t baton;
       const char **c;
       int i;
 
@@ -1822,10 +1787,9 @@ svn_diff_file_output_unified3(svn_stream
                   (&modified_header, modified_path, pool));
         }
 
-      SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding, pool,
-                                          "--- %s" APR_EOL_STR
-                                          "+++ %s" APR_EOL_STR,
-                                          original_header, modified_header));
+      SVN_ERR(svn_diff__unidiff_write_header(
+                output_stream, header_encoding,
+                original_header, modified_header, pool));
 
       SVN_ERR(svn_diff_output(diff, &baton,
                               &svn_diff__file_output_unified_vtable));
@@ -2238,7 +2202,6 @@ svn_diff_file_output_merge2(svn_stream_t
 {
   svn_diff3__file_output_baton_t baton;
   apr_file_t *file[3];
-  apr_off_t size;
   int idx;
 #if APR_HAS_MMAP
   apr_mmap_t *mm[3] = { 0 };
@@ -2282,6 +2245,8 @@ svn_diff_file_output_merge2(svn_stream_t
 
   for (idx = 0; idx < 3; idx++)
     {
+      apr_off_t size;
+
       SVN_ERR(map_or_read_file(&file[idx],
                                MMAP_T_ARG(mm[idx])
                                &baton.buffer[idx], &size,

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_memory.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_memory.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_memory.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_diff/diff_memory.c Wed Nov 21 02:36:40
2012
@@ -417,14 +417,8 @@ output_unified_token_range(output_baton_
     }
   if (past_last == source->tokens->nelts && source->ends_without_eol)
     {
-      const char *out_str;
-      SVN_ERR(svn_utf_cstring_from_utf8_ex2
-              (&out_str,
-               /* The string below is intentionally not marked for translation,
-                  for wider interoperability with patch(1) programs. */
-               APR_EOL_STR "\\ No newline at end of file" APR_EOL_STR,
-               btn->header_encoding, btn->pool));
-      svn_stringbuf_appendcstr(btn->hunk, out_str);
+      SVN_ERR(svn_diff__unified_append_no_newline_msg(
+                btn->hunk, btn->header_encoding, btn->pool));
     }
 
   if (tokens == 0)
@@ -458,45 +452,19 @@ output_unified_flush_hunk(output_baton_t
   if (hunk_delimiter == NULL)
     hunk_delimiter = "@@";
 
-  /* Write the hunk header */
+  /* Convert our 0-based line numbers into unidiff 1-based numbers */
   if (baton->hunk_length[0] > 0)
-    /* Convert our 0-based line numbers into unidiff 1-based numbers */
     baton->hunk_start[0]++;
-  SVN_ERR(svn_stream_printf_from_utf8(
-            baton->output_stream, baton->header_encoding,
-            baton->pool,
-            /* Hunk length 1 is implied, don't show the
-               length field if we have a hunk that long */
-            (baton->hunk_length[0] == 1)
-            ? ("%s -%" APR_OFF_T_FMT)
-            : ("%s -%" APR_OFF_T_FMT ",%" APR_OFF_T_FMT),
-            hunk_delimiter,
-            baton->hunk_start[0], baton->hunk_length[0]));
-
   if (baton->hunk_length[1] > 0)
-    /* Convert our 0-based line numbers into unidiff 1-based numbers */
     baton->hunk_start[1]++;
 
-
-  /* Hunk length 1 is implied, don't show the
-     length field if we have a hunk that long */
-  if (baton->hunk_length[1] == 1)
-    {
-      SVN_ERR(svn_stream_printf_from_utf8(
-                baton->output_stream, baton->header_encoding,
-                baton->pool,
-                " +%" APR_OFF_T_FMT " %s" APR_EOL_STR,
-                baton->hunk_start[1], hunk_delimiter));
-    }
-  else
-    {
-      SVN_ERR(svn_stream_printf_from_utf8(
-                baton->output_stream, baton->header_encoding,
-                baton->pool,
-                " +%" APR_OFF_T_FMT ",%" APR_OFF_T_FMT " %s" APR_EOL_STR,
-                baton->hunk_start[1], baton->hunk_length[1],
-                hunk_delimiter));
-    }
+  /* Write the hunk header */
+  SVN_ERR(svn_diff__unified_write_hunk_header(
+            baton->output_stream, baton->header_encoding, hunk_delimiter,
+            baton->hunk_start[0], baton->hunk_length[0],
+            baton->hunk_start[1], baton->hunk_length[1],
+            NULL /* hunk_extra_context */,
+            baton->pool));
 
   hunk_len = baton->hunk->len;
   SVN_ERR(svn_stream_write(baton->output_stream,
@@ -601,12 +569,9 @@ svn_diff_mem_string_output_unified2(svn_
 
       if (with_diff_header)
         {
-          SVN_ERR(svn_stream_printf_from_utf8(output_stream,
-                                              header_encoding, pool,
-                                              "--- %s" APR_EOL_STR
-                                              "+++ %s" APR_EOL_STR,
-                                              original_header,
-                                              modified_header));
+          SVN_ERR(svn_diff__unidiff_write_header(
+                    output_stream, header_encoding,
+                    original_header, modified_header, pool));
         }
 
       SVN_ERR(svn_diff_output(diff, &baton,

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_diff/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_diff/util.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_diff/util.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_diff/util.c Wed Nov 21 02:36:40 2012
@@ -29,6 +29,7 @@
 #include "svn_diff.h"
 #include "svn_types.h"
 #include "svn_ctype.h"
+#include "svn_utf.h"
 #include "svn_version.h"
 
 #include "diff.h"
@@ -332,6 +333,84 @@ svn_diff__normalize_buffer(char **tgt,
 #undef COPY_INCLUDED_SECTION
 }
 
+svn_error_t *
+svn_diff__unified_append_no_newline_msg(svn_stringbuf_t *stringbuf,
+                                        const char *header_encoding,
+                                        apr_pool_t *scratch_pool)
+{
+  const char *out_str;
+
+  SVN_ERR(svn_utf_cstring_from_utf8_ex2(
+            &out_str,
+            /* The string below is intentionally not marked for translation,
+               for wider interoperability with patch(1) programs. */
+            APR_EOL_STR "\\ No newline at end of file" APR_EOL_STR,
+            header_encoding, scratch_pool));
+  svn_stringbuf_appendcstr(stringbuf, out_str);
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_diff__unified_write_hunk_header(svn_stream_t *output_stream,
+                                    const char *header_encoding,
+                                    const char *hunk_delimiter,
+                                    apr_off_t old_start,
+                                    apr_off_t old_length,
+                                    apr_off_t new_start,
+                                    apr_off_t new_length,
+                                    const char *hunk_extra_context,
+                                    apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding,
+                                      scratch_pool,
+                                      "%s -%" APR_OFF_T_FMT,
+                                      hunk_delimiter, old_start));
+  /* If the hunk length is 1, suppress the number of lines in the hunk
+   * (it is 1 implicitly) */
+  if (old_length != 1)
+    {
+      SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding,
+                                          scratch_pool,
+                                          ",%" APR_OFF_T_FMT, old_length));
+    }
+
+  SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding,
+                                      scratch_pool,
+                                      " +%" APR_OFF_T_FMT, new_start));
+  if (new_length != 1)
+    {
+      SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding,
+                                          scratch_pool,
+                                          ",%" APR_OFF_T_FMT, new_length));
+    }
+
+  if (hunk_extra_context == NULL)
+      hunk_extra_context = "";
+  SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding,
+                                      scratch_pool,
+                                      " %s%s%s" APR_EOL_STR,
+                                      hunk_delimiter,
+                                      hunk_extra_context[0] ? " " : "",
+                                      hunk_extra_context));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_diff__unidiff_write_header(svn_stream_t *output_stream,
+                               const char *header_encoding,
+                               const char *old_header,
+                               const char *new_header,
+                               apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding,
+                                      scratch_pool,
+                                      "--- %s" APR_EOL_STR
+                                      "+++ %s" APR_EOL_STR,
+                                      old_header,
+                                      new_header));
+  return SVN_NO_ERROR;
+}
+
 
 /* Return the library version number. */
 const svn_version_t *

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/replay.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/replay.c Wed Nov 21 02:36:40
2012
@@ -873,14 +873,17 @@ svn_ra_serf__replay_range(svn_ra_session
           err = SVN_NO_ERROR;
           status = 0;
 
-          if (waittime_left > SVN_RA_SERF__CONTEXT_RUN_DURATION)
+          if (session->timeout)
             {
-              waittime_left -= SVN_RA_SERF__CONTEXT_RUN_DURATION;
-            }
-          else
-            {
-              return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
-                                      _("Connection timed out"));
+              if (waittime_left > SVN_RA_SERF__CONTEXT_RUN_DURATION)
+                {
+                  waittime_left -= SVN_RA_SERF__CONTEXT_RUN_DURATION;
+                }
+              else
+                {
+                  return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
+                                          _("Connection timed out"));
+                }
             }
         }
       else

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/serf.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/serf.c Wed Nov 21 02:36:40
2012
@@ -272,7 +272,7 @@ load_config(svn_ra_serf__session_t *sess
                                 _("Invalid config: negative timeout value"));
       session->timeout = apr_time_from_sec(timeout);
     }
-  SVN_ERR_ASSERT(session->timeout > 0);
+  SVN_ERR_ASSERT(session->timeout >= 0);
 
   /* Convert the proxy port value, if any. */
   if (port_str)

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/update.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/update.c Wed Nov 21 02:36:40
2012
@@ -2695,14 +2695,17 @@ finish_report(void *report_baton,
           err = SVN_NO_ERROR;
           status = 0;
 
-          if (waittime_left > SVN_RA_SERF__CONTEXT_RUN_DURATION)
+          if (sess->timeout)
             {
-              waittime_left -= SVN_RA_SERF__CONTEXT_RUN_DURATION;
-            }
-          else
-            {
-              return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
-                                      _("Connection timed out"));
+              if (waittime_left > SVN_RA_SERF__CONTEXT_RUN_DURATION)
+                {
+                  waittime_left -= SVN_RA_SERF__CONTEXT_RUN_DURATION;
+                }
+              else
+                {
+                  return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
+                                          _("Connection timed out"));
+                }
             }
         }
       else

Modified: subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/util.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/util.c Wed Nov 21 02:36:40
2012
@@ -751,14 +751,17 @@ svn_ra_serf__context_run_wait(svn_boolea
           err = SVN_NO_ERROR;
           status = 0;
 
-          if (waittime_left > SVN_RA_SERF__CONTEXT_RUN_DURATION)
+          if (sess->timeout)
             {
-              waittime_left -= SVN_RA_SERF__CONTEXT_RUN_DURATION;
-            }
-          else
-            {
-              return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
-                                      _("Connection timed out"));
+              if (waittime_left > SVN_RA_SERF__CONTEXT_RUN_DURATION)
+                {
+                  waittime_left -= SVN_RA_SERF__CONTEXT_RUN_DURATION;
+                }
+              else 
+                {
+                  return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
+                                          _("Connection timed out"));
+                }
             }
         }
       else

Modified: subversion/branches/issue-4194-dev/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/svn/propget-cmd.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/issue-4194-dev/subversion/svn/propget-cmd.c Wed Nov 21 02:36:40 2012
@@ -147,6 +147,7 @@ print_properties_xml(const char *pname,
    All other arguments are as per print_properties. */
 static svn_error_t *
 print_single_prop(svn_string_t *propval,
+                  const char *target_abspath_or_url,
                   const char *abspath_or_URL,
                   const char *wc_path_prefix,
                   svn_stream_t *out,
@@ -171,9 +172,24 @@ print_single_prop(svn_string_t *propval,
       /* In verbose mode, print exactly same as "proplist" does;
        * otherwise, print a brief header. */
       if (inherited_property)
-        header = apr_psprintf(scratch_pool, like_proplist
-                              ? _("Properties inherited from '%s':\n")
-                              : "%s - ", abspath_or_URL);
+        {
+          if (like_proplist)
+            {
+              if (! svn_path_is_url(target_abspath_or_url))
+                target_abspath_or_url =
+                  svn_cl__local_style_skip_ancestor(wc_path_prefix,
+                                                    target_abspath_or_url,
+                                                    scratch_pool);
+              header = apr_psprintf(
+                scratch_pool,
+                _("Inherited properties on '%s',\nfrom '%s':\n"),
+                target_abspath_or_url, abspath_or_URL);
+            }
+          else
+            {
+              header = apr_psprintf(scratch_pool, "%s - ", abspath_or_URL);
+            }
+        }
       else
         header = apr_psprintf(scratch_pool, like_proplist
                               ? _("Properties on '%s':\n")
@@ -218,6 +234,8 @@ print_single_prop(svn_string_t *propval,
    value.  INHERITED_PROPS is a depth-first ordered array of
    svn_prop_inherited_item_t * structures.
 
+   TARGET_ABSPATH_OR_URL is the path which inherits INHERITED_PROPS.
+
    PROPS may be an empty hash, but is never null.  INHERITED_PROPS may be
    null.
 
@@ -234,6 +252,7 @@ print_single_prop(svn_string_t *propval,
    like "svn proplist -v" does. */
 static svn_error_t *
 print_properties(svn_stream_t *out,
+                 const char *target_abspath_or_url,
                  const char *pname_utf8,
                  apr_hash_t *props,
                  apr_array_header_t *inherited_props,
@@ -259,7 +278,7 @@ print_properties(svn_stream_t *out,
             APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
           svn_string_t *propval = svn__apr_hash_index_val(apr_hash_first(pool,
                                                           iprop->prop_hash));
-          SVN_ERR(print_single_prop(propval,
+          SVN_ERR(print_single_prop(propval, target_abspath_or_url,
                                     iprop->path_or_url,
                                     path_prefix, out, pname_utf8,
                                     print_filenames, omit_newline,
@@ -276,8 +295,8 @@ print_properties(svn_stream_t *out,
 
       svn_pool_clear(iterpool);
 
-      SVN_ERR(print_single_prop(propval, filename, path_prefix,
-                                out, pname_utf8, print_filenames,
+      SVN_ERR(print_single_prop(propval, target_abspath_or_url, filename,
+                                path_prefix, out, pname_utf8, print_filenames,
                                 omit_newline, like_proplist, FALSE,
                                 iterpool));
     }
@@ -456,7 +475,7 @@ svn_cl__propget(apr_getopt_t *os,
               subpool));
           else
             SVN_ERR(print_properties(
-              out, pname_utf8,
+              out, truepath, pname_utf8,
               props,
               opt_state->show_inherited_props ? inherited_props : NULL,
               print_filenames,

Modified: subversion/branches/issue-4194-dev/subversion/svn/proplist-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/svn/proplist-cmd.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/svn/proplist-cmd.c (original)
+++ subversion/branches/issue-4194-dev/subversion/svn/proplist-cmd.c Wed Nov 21 02:36:40 2012
@@ -151,12 +151,13 @@ proplist_receiver(void *baton,
             {
               if (svn_path_is_url(iprop->path_or_url))
                 SVN_ERR(svn_cmdline_printf(
-                  iterpool, _("Properties inherited from '%s':\n"),
-                  iprop->path_or_url));
+                  iterpool, _("Inherited properties on '%s',\nfrom '%s':\n"),
+                  name_local, iprop->path_or_url));
               else
                 SVN_ERR(svn_cmdline_printf(
-                  iterpool, _("Properties inherited from '%s':\n"),
-                  svn_dirent_local_style(iprop->path_or_url, iterpool)));
+                  iterpool, _("Inherited properties on '%s',\nfrom '%s':\n"),
+                  name_local, svn_dirent_local_style(iprop->path_or_url,
+                                                     iterpool)));
             }
 
           SVN_ERR(svn_cl__print_prop_hash(NULL, iprop->prop_hash,

Modified: subversion/branches/issue-4194-dev/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-4194-dev/subversion/svnlook/main.c?rev=1411977&r1=1411976&r2=1411977&view=diff
==============================================================================
--- subversion/branches/issue-4194-dev/subversion/svnlook/main.c (original)
+++ subversion/branches/issue-4194-dev/subversion/svnlook/main.c Wed Nov 21 02:36:40 2012
@@ -840,42 +840,56 @@ static const char under_string[] =
 
 /* Helper function to display differences in properties of a file */
 static svn_error_t *
-display_prop_diffs(const apr_array_header_t *prop_diffs,
-                   apr_hash_t *orig_props,
+display_prop_diffs(const apr_array_header_t *propchanges,
+                   apr_hash_t *original_props,
                    const char *path,
                    apr_pool_t *pool)
 {
+  const char *encoding = svn_cmdline_output_encoding(pool);
+  svn_stream_t *outstream;
+  apr_pool_t *iterpool;
   int i;
 
-  SVN_ERR(svn_cmdline_printf(pool, "\nProperty changes on: %s\n%s\n",
-                             path, under_string));
+  SVN_ERR(svn_stream_for_stdout(&outstream, pool));
 
-  for (i = 0; i < prop_diffs->nelts; i++)
-    {
-      const char *header_label;
-      const svn_string_t *orig_value;
-      const svn_prop_t *pc = &APR_ARRAY_IDX(prop_diffs, i, svn_prop_t);
+  SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
+                                      _("%sProperty changes on: %s%s"),
+                                      APR_EOL_STR,
+                                      path,
+                                      APR_EOL_STR));
+
+  SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
+                                      "%s" APR_EOL_STR, under_string));
+
+  iterpool = svn_pool_create(pool);
+  for (i = 0; i < propchanges->nelts; i++)
+    {
+      const char *action;
+      const svn_string_t *original_value;
+      const svn_prop_t *propchange
+        = &APR_ARRAY_IDX(propchanges, i, svn_prop_t);
 
       SVN_ERR(check_cancel(NULL));
 
-      if (orig_props)
-        orig_value = apr_hash_get(orig_props, pc->name, APR_HASH_KEY_STRING);
+      if (original_props)
+        original_value = apr_hash_get(original_props,
+                                      propchange->name, APR_HASH_KEY_STRING);
       else
-        orig_value = NULL;
+        original_value = NULL;
 
-      if (! orig_value)
-        header_label = "Added";
-      else if (! pc->value)
-        header_label = "Deleted";
-      else
-        header_label = "Modified";
-      SVN_ERR(svn_cmdline_printf(pool, "%s: %s\n", header_label, pc->name));
+      svn_pool_clear(iterpool);
 
-      /* Flush stdout before we open a stream to it below. */
-      SVN_ERR(svn_cmdline_fflush(stdout));
+      if (! original_value)
+        action = "Added";
+      else if (! propchange->value)
+        action = "Deleted";
+      else
+        action = "Modified";
+      SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, iterpool,
+                                          "%s: %s%s", action,
+                                          propchange->name, APR_EOL_STR));
 
       {
-        svn_stream_t *out;
         svn_diff_t *diff;
         svn_diff_file_options_t options;
         const svn_string_t *tmp;
@@ -883,20 +897,20 @@ display_prop_diffs(const apr_array_heade
         const svn_string_t *val;
         svn_boolean_t val_has_eol;
 
-        SVN_ERR(svn_stream_for_stdout(&out, pool));
-
         /* The last character in a property is often not a newline.
            An eol character is appended to prevent the diff API to add a
            '\ No newline at end of file' line. We add
            '\ No newline at end of property' manually if needed. */
-        tmp = orig_value ? orig_value : svn_string_create_empty(pool);
-        orig = maybe_append_eol(tmp, NULL, pool);
-
-        tmp = pc->value ? pc->value :
-                                  svn_string_create_empty(pool);
-        val = maybe_append_eol(tmp, &val_has_eol, pool);
+        tmp = original_value ? original_value
+                             : svn_string_create_empty(iterpool);
+        orig = maybe_append_eol(tmp, NULL, iterpool);
+
+        tmp = propchange->value ? propchange->value :
+                                  svn_string_create_empty(iterpool);
+        val = maybe_append_eol(tmp, &val_has_eol, iterpool);
 
-        SVN_ERR(svn_diff_mem_string_diff(&diff, orig, val, &options, pool));
+        SVN_ERR(svn_diff_mem_string_diff(&diff, orig, val, &options,
+                                         iterpool));
 
         /* UNIX patch will try to apply a diff even if the diff header
          * is missing. It tries to be helpful by asking the user for a
@@ -905,18 +919,21 @@ display_prop_diffs(const apr_array_heade
          * UNIX patch could apply the property diff to, so we use "##"
          * instead of "@@" as the default hunk delimiter for property diffs.
          * We also supress the diff header. */
-        SVN_ERR(svn_diff_mem_string_output_unified2(out, diff, FALSE, "##",
-                                           svn_dirent_local_style(path, pool),
-                                           svn_dirent_local_style(path, pool),
-                                           svn_cmdline_output_encoding(pool),
-                                           orig, val, pool));
+        SVN_ERR(svn_diff_mem_string_output_unified2(
+                  outstream, diff, FALSE, "##",
+                  svn_dirent_local_style(path, iterpool),
+                  svn_dirent_local_style(path, iterpool),
+                  encoding, orig, val, iterpool));
         if (!val_has_eol)
           {
             const char *s = "\\ No newline at end of property" APR_EOL_STR;
-            SVN_ERR(svn_stream_puts(out, s));
+            SVN_ERR(svn_stream_puts(outstream, s));
           }
       }
     }
+  svn_pool_destroy(iterpool);
+
+  SVN_ERR(svn_stream_close(outstream));
   return svn_cmdline_fflush(stdout);
 }
 



Mime
View raw message