You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/08/05 23:45:12 UTC

svn commit: r982797 - in /subversion/branches/issue-2779-dev: ./ subversion/include/private/ subversion/libsvn_diff/ subversion/libsvn_ra_serf/ subversion/libsvn_repos/ subversion/libsvn_subr/ subversion/tests/cmdline/ subversion/tests/libsvn_diff/

Author: cmpilato
Date: Thu Aug  5 21:45:11 2010
New Revision: 982797

URL: http://svn.apache.org/viewvc?rev=982797&view=rev
Log:
Sync branch with trunk changes.  (Merged /subversion/trunk:r982644-982796)

Modified:
    subversion/branches/issue-2779-dev/   (props changed)
    subversion/branches/issue-2779-dev/subversion/include/private/svn_mergeinfo_private.h
    subversion/branches/issue-2779-dev/subversion/libsvn_diff/parse-diff.c
    subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c
    subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/update.c
    subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/util.c
    subversion/branches/issue-2779-dev/subversion/libsvn_repos/load.c
    subversion/branches/issue-2779-dev/subversion/libsvn_subr/mergeinfo.c
    subversion/branches/issue-2779-dev/subversion/tests/cmdline/entries-dump.c
    subversion/branches/issue-2779-dev/subversion/tests/cmdline/merge_tests.py
    subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnadmin_tests.py
    subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c

Propchange: subversion/branches/issue-2779-dev/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  5 21:45:11 2010
@@ -34,4 +34,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:965496-982643
+/subversion/trunk:965496-982796

Modified: subversion/branches/issue-2779-dev/subversion/include/private/svn_mergeinfo_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/include/private/svn_mergeinfo_private.h?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/include/private/svn_mergeinfo_private.h (original)
+++ subversion/branches/issue-2779-dev/subversion/include/private/svn_mergeinfo_private.h Thu Aug  5 21:45:11 2010
@@ -225,6 +225,21 @@ svn_rangelist__initialize(svn_revnum_t s
                           svn_boolean_t inheritable,
                           apr_pool_t *result_pool);
 
+/* Adjust in-place MERGEINFO's rangelists by OFFSET.  If OFFSET is negative 
+   and would adjust any part of MERGEINFO's source revisions to 0 or less,
+   then those revisions are dropped.  If all the source revisions for a merge
+   source path are dropped, then the path itself is dropped.  If all merge
+   source paths are dropped, then *ADJUSTED_MERGEINFO is set to an empty
+   hash.  *ADJUSTED_MERGEINFO is allocated in RESULT_POOL.  SCRATCH_POOL is
+   used for any temporary allocations. */
+svn_error_t *
+svn_mergeinfo__adjust_mergeinfo_rangelists(svn_mergeinfo_t *adjusted_mergeinfo,
+                                           svn_mergeinfo_t mergeinfo,
+                                           svn_revnum_t offset,
+                                           apr_pool_t *result_pool,
+                                           apr_pool_t *scratch_pool);
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_diff/parse-diff.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_diff/parse-diff.c Thu Aug  5 21:45:11 2010
@@ -991,9 +991,12 @@ git_minus(enum parse_state *new_state, c
   if (tab)
     *tab = '\0';
 
-  /* ### What if we have "--- /dev/null"? */
-  SVN_ERR(grab_filename(&patch->old_filename, line + strlen("--- a/"),
-                        result_pool, scratch_pool));
+  if (starts_with(line, "--- /dev/null"))
+    SVN_ERR(grab_filename(&patch->old_filename, "/dev/null",
+                          result_pool, scratch_pool));
+  else
+    SVN_ERR(grab_filename(&patch->old_filename, line + strlen("--- a/"),
+                          result_pool, scratch_pool));
 
   *new_state = state_git_minus_seen;
   return SVN_NO_ERROR;
@@ -1010,9 +1013,12 @@ git_plus(enum parse_state *new_state, co
   if (tab)
     *tab = '\0';
 
-  /* ### What if we have "+++ /dev/null" ? */
-  SVN_ERR(grab_filename(&patch->new_filename, line + strlen("+++ b/"),
-                        result_pool, scratch_pool));
+  if (starts_with(line, "+++ /dev/null"))
+    SVN_ERR(grab_filename(&patch->new_filename, "/dev/null",
+                          result_pool, scratch_pool));
+  else
+    SVN_ERR(grab_filename(&patch->new_filename, line + strlen("+++ b/"),
+                          result_pool, scratch_pool));
 
   *new_state = state_git_header_found;
   return SVN_NO_ERROR;
@@ -1077,7 +1083,7 @@ git_new_file(enum parse_state *new_state
 {
   patch->operation = svn_diff_op_added;
 
-  *new_state = state_git_header_found;
+  *new_state = state_git_tree_seen;
   return SVN_NO_ERROR;
 }
 
@@ -1088,7 +1094,7 @@ git_deleted_file(enum parse_state *new_s
 {
   patch->operation = svn_diff_op_deleted;
 
-  *new_state = state_git_header_found;
+  *new_state = state_git_tree_seen;
   return SVN_NO_ERROR;
 }
 
@@ -1146,7 +1152,9 @@ svn_diff_parse_next_patch(svn_patch_t **
       {"git --diff",    state_start,            git_start},
       {"--- a/",        state_git_diff_seen,    git_minus},
       {"--- a/",        state_git_tree_seen,    git_minus},
+      {"--- /dev/null", state_git_tree_seen,    git_minus},
       {"+++ b/",        state_git_minus_seen,   git_plus},
+      {"+++ /dev/null", state_git_minus_seen,   git_plus},
       {"rename from ",  state_git_diff_seen,    git_move_from},
       {"rename to ",    state_move_from_seen,   git_move_to},
       {"copy from ",    state_git_diff_seen,    git_copy_from},

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c Thu Aug  5 21:45:11 2010
@@ -770,10 +770,9 @@ create_proppatch_body(serf_bucket_t **bk
       svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", NULL);
       svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", NULL);
 
-      err = svn_ra_serf__walk_all_props(ctx->changed_props, ctx->path,
-                                        SVN_INVALID_REVNUM,
-                                         proppatch_walker, body_bkt, pool);
-      svn_error_clear(err); /* ### */
+      SVN_ERR(svn_ra_serf__walk_all_props(ctx->changed_props, ctx->path,
+                                          SVN_INVALID_REVNUM,
+                                          proppatch_walker, body_bkt, pool));
 
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:set");
@@ -784,10 +783,9 @@ create_proppatch_body(serf_bucket_t **bk
       svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:remove", NULL);
       svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", NULL);
 
-      err = svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
-                                        SVN_INVALID_REVNUM,
-                                        proppatch_walker, body_bkt, pool);
-      svn_error_clear(err); /* ### */
+      SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
+                                          SVN_INVALID_REVNUM,
+                                          proppatch_walker, body_bkt, pool));
 
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:remove");

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/update.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/update.c Thu Aug  5 21:45:11 2010
@@ -239,9 +239,6 @@ typedef struct report_fetch_t {
   /* Our pool. */
   apr_pool_t *pool;
 
-  /* Non-NULL if we received an error during processing. */
-  svn_error_t *err;
-
   /* The session we should use to fetch the file. */
   svn_ra_serf__session_t *sess;
 
@@ -721,7 +718,7 @@ cancel_fetch(serf_request_t *request,
           fetch_ctx->read_size = 0;
         }
 
-      return APR_SUCCESS;
+      return SVN_NO_ERROR;
     }
 
   /* We have no idea what went wrong. */
@@ -733,8 +730,6 @@ error_fetch(serf_request_t *request,
             report_fetch_t *fetch_ctx,
             svn_error_t *err)
 {
-  fetch_ctx->err = err;
-
   fetch_ctx->done = TRUE;
 
   fetch_ctx->done_item.data = fetch_ctx;
@@ -746,7 +741,7 @@ error_fetch(serf_request_t *request,
   serf_request_set_handler(request,
                            svn_ra_serf__response_discard_handler, NULL);
 
-  return SVN_NO_ERROR;
+  return err;
 }
 
 /* Implements svn_ra_serf__response_handler_t */
@@ -1003,19 +998,25 @@ handle_stream(serf_request_t *request,
   report_fetch_t *fetch_ctx = handler_baton;
   serf_status_line sl;
   const char *location;
+  svn_error_t *err;
 
   serf_bucket_response_status(response, &sl);
 
   /* Woo-hoo.  Nothing here to see.  */
   location = svn_ra_serf__response_get_location(response, pool);
-  fetch_ctx->err = svn_ra_serf__error_on_status(sl.code,
-                                                fetch_ctx->info->name,
-                                                location);
-  if (fetch_ctx->err)
+  
+  err = svn_ra_serf__error_on_status(sl.code,
+                                     fetch_ctx->info->name,
+                                     location);
+  if (err)
     {
       fetch_ctx->done = TRUE;
 
-      return svn_ra_serf__handle_discard_body(request, response, NULL, pool);
+      err = svn_error_compose_create(
+                  err,
+                  svn_ra_serf__handle_discard_body(request, response, NULL, pool));
+
+      return svn_error_return(err);
     }
 
   while (1)
@@ -2203,10 +2204,12 @@ open_connection_if_needed(svn_ra_serf__s
 
       /* Authentication protocol specific initalization. */
       if (sess->auth_protocol)
-        sess->auth_protocol->init_conn_func(sess, sess->conns[cur], sess->pool);
+        SVN_ERR(sess->auth_protocol->init_conn_func(sess, sess->conns[cur],
+                                                    sess->pool));
       if (sess->proxy_auth_protocol)
-        sess->proxy_auth_protocol->init_conn_func(sess, sess->conns[cur],
-                                                  sess->pool);
+        SVN_ERR(sess->proxy_auth_protocol->init_conn_func(sess,
+                                                          sess->conns[cur],
+                                                          sess->pool));
     }
 
   return SVN_NO_ERROR;
@@ -2386,21 +2389,6 @@ finish_report(void *report_baton,
           report_fetch_t *done_fetch = done_list->data;
           report_dir_t *cur_dir;
 
-          if (done_fetch->err)
-            {
-              svn_error_t *err = done_fetch->err;
-              /* Error found. There might be more, clear those first. */
-              done_list = done_list->next;
-              while (done_list)
-                {
-                  done_fetch = done_list->data;
-                  if (done_fetch->err)
-                    svn_error_clear(done_fetch->err);
-                  done_list = done_list->next;
-                }
-              return err;
-            }
-
           /* decrease our parent's directory refcount. */
           cur_dir = done_fetch->info->dir;
           cur_dir->ref_count--;
@@ -2763,7 +2751,6 @@ svn_ra_serf__get_file(svn_ra_session_t *
       svn_ra_serf__request_create(handler);
 
       SVN_ERR(svn_ra_serf__context_run_wait(&stream_ctx->done, session, pool));
-      SVN_ERR(stream_ctx->err);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/util.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/util.c Thu Aug  5 21:45:11 2010
@@ -1323,7 +1323,8 @@ svn_ra_serf__credentials_callback(char *
 
       if (err)
         {
-          ctx->session->pending_error = err;
+          session->pending_error
+              = svn_error_compose_create(session->pending_error, err);
           return err->apr_err;
         }
 
@@ -1332,10 +1333,13 @@ svn_ra_serf__credentials_callback(char *
       if (!creds || session->auth_attempts > 4)
         {
           /* No more credentials. */
-          ctx->session->pending_error =
-            svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
-                             "No more credentials or we tried too many times.\n"
-                             "Authentication failed");
+          session->pending_error
+              = svn_error_compose_create(
+                    session->pending_error,
+                    svn_error_create(
+                          SVN_ERR_AUTHN_FAILED, NULL,
+                          _("No more credentials or we tried too many times.\n"
+                            "Authentication failed")));
           return SVN_ERR_AUTHN_FAILED;
         }
 
@@ -1353,9 +1357,11 @@ svn_ra_serf__credentials_callback(char *
       if (!session->proxy_username || session->proxy_auth_attempts > 4)
         {
           /* No more credentials. */
-          ctx->session->pending_error =
-            svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
-                             "Proxy authentication failed");
+          session->pending_error
+              = svn_error_compose_create(
+                      ctx->session->pending_error,
+                      svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
+                                       _("Proxy authentication failed")));
           return SVN_ERR_AUTHN_FAILED;
         }
     }
@@ -1428,9 +1434,7 @@ handle_response(serf_request_t *request,
         {
           svn_error_t *err =
               svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA,
-                                svn_error_compose_create(
-                                           ctx->session->pending_error,
-                                           svn_error_wrap_apr(status, NULL)),
+                                svn_error_wrap_apr(status, NULL),
                                 _("Premature EOF seen from server "
                                   "(http status=%d)"), sl.code);
           /* This discard may be no-op, but let's preserve the algorithm
@@ -1470,6 +1474,7 @@ handle_response(serf_request_t *request,
 
       svn_ra_serf__priority_request_create(ctx);
 
+      *serf_status = status;
       return SVN_NO_ERROR;
     }
   else if (sl.code == 409 || sl.code >= 500)

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_repos/load.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_repos/load.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_repos/load.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_repos/load.c Thu Aug  5 21:45:11 2010
@@ -280,11 +280,36 @@ renumber_mergeinfo_revs(svn_string_t **f
                         apr_pool_t *pool)
 {
   apr_pool_t *subpool = svn_pool_create(pool);
-  apr_hash_t *mergeinfo;
-  apr_hash_t *final_mergeinfo = apr_hash_make(subpool);
+  svn_mergeinfo_t mergeinfo, predates_stream_mergeinfo;
+  svn_mergeinfo_t final_mergeinfo = apr_hash_make(subpool);
   apr_hash_index_t *hi;
 
   SVN_ERR(svn_mergeinfo_parse(&mergeinfo, initial_val->data, subpool));
+
+  /* Issue #3020
+     http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16
+     Remove mergeinfo older than the oldest revision in the dump stream
+     and adjust its revisions by the difference between the head rev of
+     the target repository and the current dump stream rev. */
+  if (rb->pb->oldest_old_rev > 1)
+    {
+      SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
+        &predates_stream_mergeinfo, mergeinfo,
+        rb->pb->oldest_old_rev - 1, 0,
+        TRUE, subpool, subpool));
+      SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
+        &mergeinfo, mergeinfo,
+        rb->pb->oldest_old_rev - 1, 0,
+        FALSE, subpool, subpool));
+      SVN_ERR(svn_mergeinfo__adjust_mergeinfo_rangelists(
+        &predates_stream_mergeinfo, predates_stream_mergeinfo,
+        -rb->rev_offset, subpool, subpool));
+    }
+  else
+    {
+      predates_stream_mergeinfo = NULL;
+    }
+
   for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
     {
       const char *merge_source;
@@ -350,6 +375,11 @@ renumber_mergeinfo_revs(svn_string_t **f
       apr_hash_set(final_mergeinfo, merge_source,
                    APR_HASH_KEY_STRING, rangelist);
     }
+
+  if (predates_stream_mergeinfo)
+      SVN_ERR(svn_mergeinfo_merge(final_mergeinfo, predates_stream_mergeinfo,
+                                  subpool));
+
   SVN_ERR(svn_mergeinfo_sort(final_mergeinfo, subpool));
 
   /* Mergeinfo revision sources for r0 and r1 are invalid; you can't merge r0
@@ -1059,6 +1089,10 @@ new_revision_record(void **revision_bato
           pb->notify->old_revision = rb->rev;
           pb->notify_func(pb->notify_baton, pb->notify, rb->pool);
         }
+
+      /* Stash the oldest "old" revision committed from the load stream. */
+      if (!SVN_IS_VALID_REVNUM(pb->oldest_old_rev))
+        pb->oldest_old_rev = rb->rev;
     }
 
   /* If we're parsing revision 0, only the revision are (possibly)
@@ -1416,10 +1450,6 @@ close_revision(void *baton)
         return svn_error_return(err);
     }
 
-  /* Stash the oldest "old" revision committed from the load stream. */
-  if (!SVN_IS_VALID_REVNUM(pb->oldest_old_rev))
-    pb->oldest_old_rev = *old_rev;
-
   /* Run post-commit hook, if so commanded.  */
   if (pb->use_post_commit_hook)
     {

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_subr/mergeinfo.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_subr/mergeinfo.c Thu Aug  5 21:45:11 2010
@@ -2090,6 +2090,58 @@ svn_mergeinfo__filter_mergeinfo_by_range
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_mergeinfo__adjust_mergeinfo_rangelists(svn_mergeinfo_t *adjusted_mergeinfo,
+                                           svn_mergeinfo_t mergeinfo,
+                                           svn_revnum_t offset,
+                                           apr_pool_t *result_pool,
+                                           apr_pool_t *scratch_pool)
+{
+  apr_hash_index_t *hi;
+  *adjusted_mergeinfo = apr_hash_make(result_pool);
+
+  if (mergeinfo)
+    {
+      for (hi = apr_hash_first(scratch_pool, mergeinfo);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          int i;
+          const char *path = svn__apr_hash_index_key(hi);
+          apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
+          apr_array_header_t *adjusted_rangelist =
+            apr_array_make(result_pool, rangelist->nelts,
+                           sizeof(svn_merge_range_t *));
+
+          for (i = 0; i < rangelist->nelts; i++)
+            {
+              svn_merge_range_t *range =
+                APR_ARRAY_IDX(rangelist, i, svn_merge_range_t *);
+
+              if (range->start + offset > 0 && range->end + offset > 0)
+                {                  
+                  if (range->start + offset < 0)
+                    range->start = 0;
+                  else
+                    range->start = range->start + offset;
+
+                  if (range->end + offset < 0)
+                    range->end = 0;
+                  else
+                    range->end = range->end + offset;
+                  APR_ARRAY_PUSH(adjusted_rangelist, svn_merge_range_t *) =
+                    range;
+                }
+            }
+
+          if (adjusted_rangelist->nelts)
+            apr_hash_set(*adjusted_mergeinfo, apr_pstrdup(result_pool, path),
+                         APR_HASH_KEY_STRING, adjusted_rangelist);
+        }
+    }
+  return SVN_NO_ERROR;
+}
+
 svn_boolean_t
 svn_mergeinfo__is_noninheritable(svn_mergeinfo_t mergeinfo,
                                  apr_pool_t *scratch_pool)

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/entries-dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/entries-dump.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/entries-dump.c Thu Aug  5 21:45:11 2010
@@ -155,10 +155,6 @@ print_dir(const char *local_abspath,
   if (kind != svn_node_dir)
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
-  if (kind != svn_node_dir)
-    return SVN_NO_ERROR;
-
   printf("%s\n",
          svn_dirent_local_style(
                    svn_dirent_join(bt->prefix_path,

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/merge_tests.py?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/merge_tests.py Thu Aug  5 21:45:11 2010
@@ -1715,10 +1715,10 @@ def merge_into_missing(sbox):
     ''      : Item(status='  ', wc_rev=1),
     'foo'   : Item(status='! ', wc_rev=2),
     'Q'     : Item(status='! ', wc_rev='?'),
+# In some intermediate WC-NG state (since r937468) this was:
+#   'Q'     : Item(status='! ', wc_rev='2', entry_rev='?'),
+# but the expected value is now back what it was.
     })
-  if svntest.main.wc_is_singledb(wc_dir):
-    # This also applied in some intermediate WC-NG state (since r937468)
-    expected_status.tweak('Q', wc_rev=2, entry_rev='?')
   expected_skip = wc.State(F_path, {
     'Q'   : Item(),
     'foo' : Item(),
@@ -1740,17 +1740,14 @@ def merge_into_missing(sbox):
     ''      : Item(status=' M', wc_rev=1),
     'foo'   : Item(status='!M', wc_rev=2),
     'Q'     : Item(status='! ', wc_rev='?'),
+# In some intermediate WC-NG state (since r937468) this was:
+#   'Q'     : Item(status='! ', wc_rev='2', entry_rev='?'),
+# but the expected value is now back what it was.
     })
-  if svntest.main.wc_is_singledb(wc_dir):
-    # This also applied in some intermediate WC-NG state (since r937468)
-    expected_status.tweak('Q', wc_rev=2, entry_rev='?')
   expected_mergeinfo_output = wc.State(F_path, {
     ''    : Item(status=' U'),
     'foo' : Item(status=' U'), # Mergeinfo is set on missing/obstructed files.
     })
-  if svntest.main.wc_is_singledb(wc_dir):
-    # mergeinfo is set on missing/obstructed directories as well
-    expected_mergeinfo_output.add({'Q'   : Item(status=' U')})
   svntest.actions.run_and_verify_merge(F_path, '1', '2', F_url, None,
                                        expected_output,
                                        expected_mergeinfo_output,
@@ -1777,10 +1774,10 @@ def merge_into_missing(sbox):
     'A/B/F'     : Item(status=' M', wc_rev=1),
     'A/B/F/foo' : Item(status='!M', wc_rev=2),
     'A/B/F/Q'   : Item(status='! ', wc_rev='?'),
+# In some intermediate WC-NG state (since r937468) this was:
+#  'A/B/F/Q'   : Item(status='! ', wc_rev='2', entry_rev='?'),
+# but the expected value is now back what it was.
     })
-  if svntest.main.wc_is_singledb(wc_dir):
-    # This also applied in some intermediate WC-NG state (since r937468)
-    expected_status.tweak('A/B/F/Q', wc_rev=2, entry_rev='?')
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 #----------------------------------------------------------------------

Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnadmin_tests.py?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/svnadmin_tests.py Thu Aug  5 21:45:11 2010
@@ -1162,28 +1162,7 @@ def dont_drop_valid_mergeinfo_during_inc
 
   # Check the resulting mergeinfo.  We expect the exact same results
   # as Part 3.
-  #
-  # Currently this fails because our current logic mapping mergeinfo revs
-  # in the load stream to their new values based on the offset of the
-  # target repository is quite flawed.  Right now this is the resulting
-  # mergeinfo:
-  #
-  #    Properties on 'svnadmin_tests-21\Projects\Project-X\branches\B1\B
-  #      svn:mergeinfo
-  #        /Projects/Project-X/branches/B2/B/E:11-12
-  #        /Projects/Project-X/trunk/B/E:5-6,8-9
-  #    Properties on 'svnadmin_tests-21\Projects\Project-X\branches\B1':
-  #      svn:mergeinfo
-  #        /Projects/Project-X/branches/B2:11-18
-  #                                           ^^
-  #                                 The *only* correct rev here!
-  #        /Projects/Project-X/trunk:6,9
-  #    Properties on 'svnadmin_tests-21\Projects\Project-X\branches\B2':
-  #      svn:mergeinfo
-  #        /Projects/Project-X/trunk:9
-  #
-  # See http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16 for
-  # more info.
+  # See http://subversion.tigris.org/issues/show_bug.cgi?id=3020#desc16.
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'propget', 'svn:mergeinfo', '-R',
                                      sbox.repo_url)
@@ -1276,7 +1255,7 @@ test_list = [ None,
               create_in_repo_subdir,
               SkipUnless(verify_with_invalid_revprops,
                          svntest.main.is_fs_type_fsfs),
-              XFail(dont_drop_valid_mergeinfo_during_incremental_loads),
+              dont_drop_valid_mergeinfo_during_incremental_loads,
               SkipUnless(hotcopy_symlink, svntest.main.is_posix_os),
              ]
 

Modified: subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c?rev=982797&r1=982796&r2=982797&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c Thu Aug  5 21:45:11 2010
@@ -86,6 +86,8 @@ static const char *git_tree_and_text_uni
   "git --diff a/iota b/iota.copied"                                     NL
   "copy from iota"                                                      NL
   "copy to iota.copied"                                                 NL
+  "--- a/iota\t(revision 2)"                                            NL
+  "+++ b/iota.copied\t(working copy)"                                   NL
   "@@ -1 +1,2 @@"                                                       NL
   " This is the file 'iota'."                                           NL
   "+some more bytes to 'iota'"                                          NL
@@ -94,9 +96,27 @@ static const char *git_tree_and_text_uni
   "git --diff a/A/mu b/A/mu.moved"                                      NL
   "rename from A/mu"                                                    NL
   "rename to A/mu.moved"                                                NL
+  "--- a/A/mu\t(revision 2)"                                            NL
+  "+++ b/A/mu.moved\t(working copy)"                                    NL
   "@@ -1 +1,2 @@"                                                       NL
   " This is the file 'mu'."                                             NL
   "+some more bytes to 'mu'"                                            NL
+  "Index: new"                                                          NL
+  "===================================================================" NL
+  "git --diff a/new b/new"                                              NL
+  "new file mode 100644"                                                NL
+  "--- /dev/null\t(revision 0)"                                         NL
+  "+++ b/new\t(working copy)"                                           NL
+  "@@ -0,0 +1 @@"                                                       NL
+  "+This is the file 'new'."                                            NL
+  "Index: A/B/lambda"                                                   NL
+  "===================================================================" NL
+  "git --diff a/A/B/lambda b/A/B/lambda"                                NL
+  "deleted file mode 100644"                                            NL
+  "--- a/A/B/lambda\t(revision 2)"                                      NL
+  "+++ /dev/null\t(working copy)"                                       NL
+  "@@ -1 +0,0 @@"                                                       NL
+  "-This is the file 'lambda'."                                         NL
   ""                                                                    NL;
 
   /* Only the last git diff header is valid. The other ones either misses a
@@ -500,6 +520,45 @@ test_parse_git_tree_and_text_diff(apr_po
                         "some more bytes to 'mu'" NL,
                         pool));
 
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "/dev/null"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "new"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 1);
+  
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+
+  SVN_ERR(check_content(hunk, TRUE,
+                        "",
+                        pool));
+
+  SVN_ERR(check_content(hunk, FALSE,
+                        "This is the file 'new'." NL,
+                        pool));
+
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "A/B/lambda"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "/dev/null"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_deleted);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 1);
+  
+  hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
+
+  SVN_ERR(check_content(hunk, TRUE,
+                        "This is the file 'lambda'." NL,
+                        pool));
+
+  SVN_ERR(check_content(hunk, FALSE,
+                        "",
+                        pool));
   return SVN_NO_ERROR;
 }
 
@@ -834,7 +893,6 @@ test_git_diffs_with_spaces_diff(apr_pool
                                     FALSE, /* ignore_whitespace */ 
                                     pool, pool));
   SVN_TEST_ASSERT(patch);
-  SVN_DBG(("%s\n", patch->old_filename));
   SVN_TEST_ASSERT(! strcmp(patch->old_filename, "dir/ b/path"));
   SVN_TEST_ASSERT(! strcmp(patch->new_filename, "dir/ b/path"));
   SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
@@ -862,7 +920,7 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_PASS2(test_parse_git_diff,
                     "test git unidiff parsing"),
     SVN_TEST_PASS2(test_parse_git_tree_and_text_diff,
-                    "test git unidiff parsing of tree and text changes"),
+                   "test git unidiff parsing of tree and text changes"),
     SVN_TEST_XFAIL2(test_bad_git_diff_headers,
                     "test badly formatted git diff headers"),
     SVN_TEST_PASS2(test_parse_property_diff,