subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1140563 - in /subversion/trunk/subversion: libsvn_wc/adm_crawler.c libsvn_wc/entries.c tests/cmdline/upgrade_tests.py
Date Tue, 28 Jun 2011 12:27:17 GMT
Author: rhuijben
Date: Tue Jun 28 12:27:17 2011
New Revision: 1140563

URL: http://svn.apache.org/viewvc?rev=1140563&view=rev
Log:
Fix issue #3940 in two locations:
 - Make sure upgraded BASE NODES have a revision, even though they are still
   marked as incomplete.
 - Never report incomplete paths with SVN_INVALID_REVNUM in the adm crawler.
   (In 1.6 we would report a missing directory as deleted). The incomplete
   support for handling a cancelled update will handle the rest.
(Both changeswould fix the issue #3940 regression test just by itself)


* subversion/libsvn_wc/adm_crawler.c
  (report_revisions_and_depths): Report the parent directory revision for
    directories without a revision.

* subversion/libsvn_wc/entries.c
  (write_entry): Constify argument. Use the parent revision when writing a stub
    entry without its own revision.

* subversion/tests/cmdline/upgrade_tests.py
  (missing_dirs,
   missing_dirs2): Update expected revision.

  (upgrade_with_missing_subdir): Remove XFail marker.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_crawler.c
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/tests/cmdline/upgrade_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=1140563&r1=1140562&r2=1140563&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Tue Jun 28 12:27:17 2011
@@ -495,6 +495,16 @@ report_revisions_and_depths(svn_wc__db_t
           is_incomplete = (ths->status == svn_wc__db_status_incomplete);
           start_empty = is_incomplete;
 
+          /* When a <= 1.6 working copy is upgraded without some of its
+             subdirectories we miss some information in the database. If we
+             report the revision as -1, the update editor will receive an
+             add_directory() while it still knows the directory.
+
+             This would raise strange tree conflicts and probably assertions
+             as it would a BASE vs BASE conflict */
+          if (is_incomplete && !SVN_IS_VALID_REVNUM(ths->revnum))
+            ths->revnum = dir_rev;
+
           if (depth_compatibility_trick
               && ths->depth <= svn_depth_files
               && depth > ths->depth)

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1140563&r1=1140562&r2=1140563&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Jun 28 12:27:17 2011
@@ -1093,12 +1093,12 @@ read_entries(apr_hash_t **entries,
 
   if (wc_format < SVN_WC__WC_NG_VERSION)
     return svn_error_trace(svn_wc__read_entries_old(entries,
-                                                    wcroot_abspath,
-                                                    result_pool,
-                                                    scratch_pool));
+                                                     wcroot_abspath,
+                                                     result_pool,
+                                                     scratch_pool));
 
   return svn_error_trace(read_entries_new(entries, db, wcroot_abspath,
-                                          result_pool, scratch_pool));
+                                           result_pool, scratch_pool));
 }
 
 
@@ -1538,7 +1538,7 @@ struct write_baton {
    ### time being, we'll need both parameters. */
 static svn_error_t *
 write_entry(struct write_baton **entry_node,
-            struct write_baton *parent_node,
+            const struct write_baton *parent_node,
             svn_wc__db_t *db,
             svn_sqlite__db_t *sdb,
             apr_int64_t wc_id,
@@ -1883,6 +1883,12 @@ write_entry(struct write_baton **entry_n
                   && strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))
                 {
                   base_node->presence = svn_wc__db_status_incomplete;
+
+                  /* Store the most likely revision in the node to avoid
+                     base nodes without a valid revision. Of course
+                     we remember that the data is still incomplete. */
+                  if (parent_node->base)
+                    base_node->revision = parent_node->base->revision;
                 }
               else if (entry->incomplete)
                 {

Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=1140563&r1=1140562&r2=1140563&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Tue Jun 28 12:27:17 2011
@@ -649,10 +649,10 @@ def missing_dirs(sbox):
       'A'                 : Item(status='  ', wc_rev='1'),
       'A/mu'              : Item(status='  ', wc_rev='1'),
       'A/C'               : Item(status='  ', wc_rev='1'),
-      'A/D'               : Item(status='! ', wc_rev='-'),
+      'A/D'               : Item(status='! ', wc_rev='1'),
       'A/B'               : Item(status='  ', wc_rev='1'),
       'A/B/F'             : Item(status='  ', wc_rev='1'),
-      'A/B/E'             : Item(status='! ', wc_rev='-'),
+      'A/B/E'             : Item(status='! ', wc_rev='1'),
       'A/B/lambda'        : Item(status='  ', wc_rev='1'),
       'iota'              : Item(status='  ', wc_rev='1'),
       'A/B_new'           : Item(status='A ', wc_rev='-', copied='+'),
@@ -678,10 +678,10 @@ def missing_dirs2(sbox):
       'A'                 : Item(status='  ', wc_rev='1'),
       'A/mu'              : Item(status='  ', wc_rev='1'),
       'A/C'               : Item(status='  ', wc_rev='1'),
-      'A/D'               : Item(status='! ', wc_rev='-'),
+      'A/D'               : Item(status='! ', wc_rev='1'),
       'A/B'               : Item(status='  ', wc_rev='1'),
       'A/B/F'             : Item(status='  ', wc_rev='1'),
-      'A/B/E'             : Item(status='! ', wc_rev='-'),
+      'A/B/E'             : Item(status='! ', wc_rev='1'),
       'A/B/lambda'        : Item(status='  ', wc_rev='1'),
       'iota'              : Item(status='  ', wc_rev='1'),
       'A/B_new'           : Item(status='A ', wc_rev='-', copied='+'),
@@ -1037,7 +1037,6 @@ def add_add_x2(sbox):
   run_and_verify_status_no_server(sbox.wc_dir, expected_status)
 
 @Issue(3940)
-@XFail()
 def upgrade_with_missing_subdir(sbox):
   "test upgrading a working copy with missing subdir"
 



Mime
View raw message