subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1436192 - in /subversion/trunk/subversion: libsvn_wc/ tests/cmdline/ tests/cmdline/svntest/
Date Mon, 21 Jan 2013 04:00:59 GMT
Author: rhuijben
Date: Mon Jan 21 04:00:59 2013
New Revision: 1436192

URL: http://svn.apache.org/viewvc?rev=1436192&view=rev
Log:
Remove unneeded conversions to old_tree in several wrappers of
run_and_verify_status. This wrapping as old_tree made it impossible to run the
entries validation on these trees.

Fix the fallout of this change.

* subversion/libsvn_wc/entries.c
  (get_info_for_deleted): Allow obtaining the lock token.
  (read_one_entry): Update caller. (Found via lock_tests.py)

* subversion/tests/cmdline/commit_tests.py
  (commit_nonrecursive): Use '/' in the trees, not os.sep as that breaks the
    entries tests.

* subversion/tests/cmdline/copy_tests.py
  (move_moved_file_and_dir): Use canonical path form.

* subversion/tests/cmdline/entries-dump.c
  (entries_dump): Provide file_external boolean. (Needed for externals tests)

* subversion/tests/cmdline/merge_tests.py
  (merge_into_missing): Remove invalid entry_rev.
  (merge_away_subtrees_noninheritable_ranges): Use canonical path.

* subversion/tests/cmdline/patch_tests.py
  (patch_absolute_paths,
   patch_offset,
   patch_prop_offset,
   patch_delete_and_skip,
   patch_git_with_index_line): Use canonical path form.

* subversion/tests/cmdline/revert_tests.py
  (revert_obstructing_wc): Avoid entries comparision.


* subversion/tests/cmdline/svntest/actions.py
  (run_and_verify_checkout2,
   verify_update,
   run_and_verify_commit): Remove unneeded conversion.

* subversion/tests/cmdline/svntest/wc.py
  (add_state): Don't add root/ item for the root of the added tree.
  (tweak_for_entries_compare): Handle file externals. Add entry_copy support.
    Assume that we can't calculate switched for the root of the status walk
    from the python code. Ignore tree conflicts.
  (from_entries): Skip excluded nodes. Set switched to 'X' for file externals.

  (StateItem): Add entry_copy setting.
  (repos_join): Fix 'G:/' 'node' join. (Needed for update_tests.py)

* subversion/tests/cmdline/switch_tests.py
  (switch_with_obstructing_local_adds): Update entry expectations for
    obstructed.
  (switch_to_root): Pass the right path for path calculations.

* subversion/tests/cmdline/update_tests.py
  (update_wc_on_windows_drive): Tweak paths. Disable entry dump for 'A:mu' style
    paths.
  (update_copied_from_replaced_and_changed): Use canonical paths.
  (update_edit_delete_obstruction): Set entry info for obstructed node.

* subversion/tests/cmdline/update_tests.py
  (upgrade_missing_replaced): Mark XFail. This test crashes entries-dump on an
    assertion in wc_db.c.

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/tests/cmdline/commit_tests.py
    subversion/trunk/subversion/tests/cmdline/copy_tests.py
    subversion/trunk/subversion/tests/cmdline/entries-dump.c
    subversion/trunk/subversion/tests/cmdline/merge_tests.py
    subversion/trunk/subversion/tests/cmdline/patch_tests.py
    subversion/trunk/subversion/tests/cmdline/revert_tests.py
    subversion/trunk/subversion/tests/cmdline/svntest/actions.py
    subversion/trunk/subversion/tests/cmdline/svntest/wc.py
    subversion/trunk/subversion/tests/cmdline/switch_tests.py
    subversion/trunk/subversion/tests/cmdline/update_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Mon Jan 21 04:00:59 2013
@@ -208,6 +208,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
                      svn_kind_t *kind,
                      const char **repos_relpath,
                      const svn_checksum_t **checksum,
+                     svn_wc__db_lock_t **lock,
                      svn_wc__db_t *db,
                      const char *entry_abspath,
                      const svn_wc_entry_t *parent_entry,
@@ -230,7 +231,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
                                        &entry->depth,
                                        checksum,
                                        NULL,
-                                       NULL /* lock */,
+                                       lock,
                                        &entry->has_props, NULL,
                                        NULL,
                                        db,
@@ -296,7 +297,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
           svn_wc__db_status_t status;
           SVN_ERR(svn_wc__db_base_get_info(&status, NULL, &entry->revision,
                                            NULL, NULL, NULL, NULL, NULL, NULL,
-                                           NULL, NULL, NULL, NULL, NULL, NULL,
+                                           NULL, NULL, NULL, lock, NULL, NULL,
                                            NULL,
                                            db, entry_abspath,
                                            result_pool, scratch_pool));
@@ -824,6 +825,7 @@ read_one_entry(const svn_wc_entry_t **ne
                                    &kind,
                                    &repos_relpath,
                                    &checksum,
+                                   &lock,
                                    db, entry_abspath,
                                    parent_entry,
                                    have_base, have_more_work,

Modified: subversion/trunk/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/commit_tests.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/commit_tests.py Mon Jan 21 04:00:59 2013
@@ -1589,28 +1589,28 @@ def commit_nonrecursive(sbox):
   # These paths are relative to the top of the test's working copy.
   file1_path = 'file1'
   dir1_path  = 'dir1'
-  file2_path = os.path.join('dir1', 'file2')
-  file3_path = os.path.join('dir1', 'file3')
-  dir2_path  = os.path.join('dir1', 'dir2')
-  file4_path = os.path.join('dir1', 'dir2', 'file4')
+  file2_path = 'dir1/file2'
+  file3_path = 'dir1/file3'
+  dir2_path  = 'dir1/dir2'
+  file4_path = 'dir1/dir2/file4'
 
   # Create the new files and directories.
-  svntest.main.file_append(os.path.join(wc_dir, file1_path), 'this is file1')
-  os.mkdir(os.path.join(wc_dir, dir1_path))
-  svntest.main.file_append(os.path.join(wc_dir, file2_path), 'this is file2')
-  svntest.main.file_append(os.path.join(wc_dir, file3_path), 'this is file3')
-  os.mkdir(os.path.join(wc_dir, dir2_path))
-  svntest.main.file_append(os.path.join(wc_dir, file4_path), 'this is file4')
+  svntest.main.file_append(sbox.ospath(file1_path), 'this is file1')
+  os.mkdir(sbox.ospath(dir1_path))
+  svntest.main.file_append(sbox.ospath(file2_path), 'this is file2')
+  svntest.main.file_append(sbox.ospath(file3_path), 'this is file3')
+  os.mkdir(sbox.ospath(dir2_path))
+  svntest.main.file_append(sbox.ospath(file4_path), 'this is file4')
 
   # Add them to version control.
   svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
                                      'add', '--depth=empty',
-                                     os.path.join(wc_dir, file1_path),
-                                     os.path.join(wc_dir, dir1_path),
-                                     os.path.join(wc_dir, file2_path),
-                                     os.path.join(wc_dir, file3_path),
-                                     os.path.join(wc_dir, dir2_path),
-                                     os.path.join(wc_dir, file4_path))
+                                     sbox.ospath(file1_path),
+                                     sbox.ospath(dir1_path),
+                                     sbox.ospath(file2_path),
+                                     sbox.ospath(file3_path),
+                                     sbox.ospath(dir2_path),
+                                     sbox.ospath(file4_path))
 
   # Commit.  We should see all 6 items (2 dirs, 4 files) get sent.
   expected_output = svntest.wc.State(
@@ -1639,12 +1639,12 @@ def commit_nonrecursive(sbox):
                                         expected_status,
                                         None,
                                         '-N',
-                                        os.path.join(wc_dir, file1_path),
-                                        os.path.join(wc_dir, dir1_path),
-                                        os.path.join(wc_dir, file2_path),
-                                        os.path.join(wc_dir, file3_path),
-                                        os.path.join(wc_dir, dir2_path),
-                                        os.path.join(wc_dir, file4_path))
+                                        sbox.ospath(file1_path),
+                                        sbox.ospath(dir1_path),
+                                        sbox.ospath(file2_path),
+                                        sbox.ospath(file3_path),
+                                        sbox.ospath(dir2_path),
+                                        sbox.ospath(file4_path))
 
   #######################################################################
   ###
@@ -1707,28 +1707,28 @@ def commit_nonrecursive(sbox):
 
   # Now add these directories and files, except the last:
   dirA_path  = 'dirA'
-  fileA_path = os.path.join('dirA', 'fileA')
-  fileB_path = os.path.join('dirA', 'fileB')
-  dirB_path  = os.path.join('dirA', 'dirB')
-  nope_1_path = os.path.join(dirB_path, 'nope_1')
-  nope_2_path = os.path.join(dirB_path, 'nope_2')
+  fileA_path = 'dirA/fileA'
+  fileB_path = 'dirA/fileB'
+  dirB_path  = 'dirA/dirB'
+  nope_1_path = 'dirA/dirB/nope_1'
+  nope_2_path = 'dirA/dirB/nope_2'
 
   # Create the new files and directories.
-  os.mkdir(os.path.join(wc_dir, dirA_path))
-  svntest.main.file_append(os.path.join(wc_dir, fileA_path), 'fileA')
-  svntest.main.file_append(os.path.join(wc_dir, fileB_path), 'fileB')
-  os.mkdir(os.path.join(wc_dir, dirB_path))
-  svntest.main.file_append(os.path.join(wc_dir, nope_1_path), 'nope_1')
-  svntest.main.file_append(os.path.join(wc_dir, nope_2_path), 'nope_2')
+  os.mkdir(sbox.ospath(dirA_path))
+  svntest.main.file_append(sbox.ospath(fileA_path), 'fileA')
+  svntest.main.file_append(sbox.ospath(fileB_path), 'fileB')
+  os.mkdir(sbox.ospath(dirB_path))
+  svntest.main.file_append(sbox.ospath(nope_1_path), 'nope_1')
+  svntest.main.file_append(sbox.ospath(nope_2_path), 'nope_2')
 
   # Add them to version control.
   svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
                                      'add', '-N',
-                                     os.path.join(wc_dir, dirA_path),
-                                     os.path.join(wc_dir, fileA_path),
+                                     sbox.ospath(dirA_path),
+                                     sbox.ospath(fileA_path),
                                      # don't add fileB
-                                     os.path.join(wc_dir, dirB_path),
-                                     os.path.join(wc_dir, nope_1_path),
+                                     sbox.ospath(dirB_path),
+                                     sbox.ospath(nope_1_path),
                                      # don't add nope_2
                                      )
 
@@ -1765,7 +1765,7 @@ def commit_nonrecursive(sbox):
                                         expected_output,
                                         expected_status,
                                         None,
-                                        '-N', os.path.join(wc_dir, dirA_path))
+                                        '-N', sbox.ospath(dirA_path))
 
 #----------------------------------------------------------------------
 # Regression for #1017: ra_neon was allowing the deletion of out-of-date

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Mon Jan 21 04:00:59 2013
@@ -2110,7 +2110,7 @@ def move_moved_file_and_dir(sbox):
   # Create expected status tree
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.add({
-    'A/D/G/E_move_moved/'      : Item(status='  ', wc_rev=2),
+    'A/D/G/E_move_moved'       : Item(status='  ', wc_rev=2),
     'A/D/G/E_move_moved/alpha' : Item(status='  ', wc_rev=2),
     'A/D/G/E_move_moved/beta'  : Item(status='  ', wc_rev=2),
     'A/B/F/rho_move_moved'     : Item(status='  ', wc_rev=2),

Modified: subversion/trunk/subversion/tests/cmdline/entries-dump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/entries-dump.c?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/trunk/subversion/tests/cmdline/entries-dump.c Mon Jan 21 04:00:59 2013
@@ -148,7 +148,7 @@ entries_dump(const char *dir_path, apr_p
       /* skip: keep_local */
       int_value("depth", entry->depth);
       /* skip: tree_conflict_data */
-      /* skip: file_external_path */
+      bool_value("file_external", entry->file_external_path != NULL);
       /* skip: file_external_peg_rev */
       /* skip: file_external_rev */
       bool_value("locked", locked && *entry->name == '\0');

Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Mon Jan 21 04:00:59 2013
@@ -1831,7 +1831,7 @@ def merge_into_missing(sbox):
   expected_status = wc.State(F_path, {
     ''      : Item(status='  ', wc_rev=1),
     'foo'   : Item(status='! ', wc_rev=2),
-    'Q'     : Item(status='! ', entry_rev='?', wc_rev='2'),
+    'Q'     : Item(status='! ', wc_rev='2'),
     # Revision is known and we can record mergeinfo
     'Q/R'      : Item(status='! ', wc_rev='3'),
     'Q/R/bar'  : Item(status='! ', wc_rev='3'),
@@ -7420,16 +7420,16 @@ def merge_away_subtrees_noninheritable_r
 
   # Now merge -c10 from A to A_COPY.
   svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
-  expected_output = wc.State('.', {
+  expected_output = wc.State('', {
     'nu': Item(status='A '),
     })
-  expected_mergeinfo_output = wc.State('.', {
+  expected_mergeinfo_output = wc.State('', {
     ''   : Item(status=' U'),
     'nu' : Item(status=' U'),
     })
-  expected_elision_output = wc.State('.', {
+  expected_elision_output = wc.State('', {
     })
-  expected_status = wc.State('.', {
+  expected_status = wc.State('', {
     ''          : Item(status=' M'),
     'nu'        : Item(status='A ', copied='+'),
     'B'         : Item(status='  '),
@@ -7479,7 +7479,7 @@ def merge_away_subtrees_noninheritable_r
   expected_skip = wc.State('.', { })
   saved_cwd = os.getcwd()
   os.chdir(A_COPY_path)
-  svntest.actions.run_and_verify_merge('.', '9', '10',
+  svntest.actions.run_and_verify_merge('', '9', '10',
                                        sbox.repo_url + '/A', None,
                                        expected_output,
                                        expected_mergeinfo_output,
@@ -7527,7 +7527,7 @@ def merge_away_subtrees_noninheritable_r
     })
   expected_elision_output = wc.State('.', {
     })
-  expected_status = wc.State('.', {
+  expected_status = wc.State('', {
     ''          : Item(status=' M'),
     'B'         : Item(status='  '),
     'mu'        : Item(status='MM'),

Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Mon Jan 21 04:00:59 2013
@@ -274,14 +274,14 @@ def patch_absolute_paths(sbox):
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.tweak('A/B/E/alpha', contents=alpha_contents)
 
-  expected_status = svntest.actions.get_virginal_state('.', 1)
+  expected_status = svntest.actions.get_virginal_state('', 1)
   expected_status.tweak('A/B/E/alpha', status='M ')
 
   expected_skip = wc.State('', {
     lambda_path:  Item(verb='Skipped missing target'),
   })
 
-  svntest.actions.run_and_verify_patch('.', os.path.abspath(patch_file_path),
+  svntest.actions.run_and_verify_patch('', os.path.abspath(patch_file_path),
                                        expected_output,
                                        expected_disk,
                                        expected_status,
@@ -488,13 +488,13 @@ def patch_offset(sbox):
   expected_disk.tweak('A/mu', contents=''.join(mu_contents))
   expected_disk.tweak('iota', contents=''.join(iota_contents))
 
-  expected_status = svntest.actions.get_virginal_state('.', 1)
+  expected_status = svntest.actions.get_virginal_state('', 1)
   expected_status.tweak('A/mu', status='M ', wc_rev=2)
   expected_status.tweak('iota', status='M ', wc_rev=2)
 
   expected_skip = wc.State('', { })
 
-  svntest.actions.run_and_verify_patch('.', os.path.abspath(patch_file_path),
+  svntest.actions.run_and_verify_patch('', os.path.abspath(patch_file_path),
                                        expected_output,
                                        expected_disk,
                                        expected_status,
@@ -2836,12 +2836,12 @@ def patch_prop_offset(sbox):
   expected_disk.tweak('iota', props = {'prop1' : prop1_content,
                                        'prop2' : prop2_content})
 
-  expected_status = svntest.actions.get_virginal_state('.', 1)
+  expected_status = svntest.actions.get_virginal_state('', 1)
   expected_status.tweak('iota', status=' M', wc_rev=2)
 
   expected_skip = wc.State('', { })
 
-  svntest.actions.run_and_verify_patch('.', os.path.abspath(patch_file_path),
+  svntest.actions.run_and_verify_patch('', os.path.abspath(patch_file_path),
                                        expected_output,
                                        expected_disk,
                                        expected_status,
@@ -3977,7 +3977,7 @@ def patch_delete_and_skip(sbox):
   expected_disk.remove('A/B/E/beta')
   expected_disk.remove('A/B/E')
 
-  expected_status = svntest.actions.get_virginal_state('.', 1)
+  expected_status = svntest.actions.get_virginal_state('', 1)
   expected_status.tweak('A/B/E', status='D ')
   expected_status.tweak('A/B/E/alpha', status='D ')
   expected_status.tweak('A/B/E/beta', status='D ')
@@ -3986,7 +3986,7 @@ def patch_delete_and_skip(sbox):
     '',
     {skipped_path: Item(verb='Skipped missing target')})
 
-  svntest.actions.run_and_verify_patch('.', os.path.abspath(patch_file_path),
+  svntest.actions.run_and_verify_patch('', os.path.abspath(patch_file_path),
                                        expected_output,
                                        expected_disk,
                                        expected_status,
@@ -4182,9 +4182,9 @@ def patch_git_with_index_line(sbox):
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.add({
-      'src/'                            : Item(status='A ', wc_rev=0),
+      'src'                             : Item(status='A ', wc_rev=0),
       'src/tools'                       : Item(status='A ', wc_rev=0),
-      'src/tools/ConsoleRunner/'        : Item(status='A ', wc_rev=0),
+      'src/tools/ConsoleRunner'         : Item(status='A ', wc_rev=0),
       'src/tools/ConsoleRunner/hi.txt'  : Item(status='A ', wc_rev=0),
   })
 

Modified: subversion/trunk/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/revert_tests.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/revert_tests.py Mon Jan 21 04:00:59 2013
@@ -1630,8 +1630,10 @@ def revert_obstructing_wc(sbox):
     # A is not versioned but exists
   })
 
+  # Use expected_status.old_tree() to avoid doing an entries comparion
   svntest.actions.run_and_verify_update(wc_dir,
-                                        expected_output, None, expected_status,
+                                        expected_output, None,
+                                        expected_status.old_tree(),
                                         None, None, None,
                                         None, None, None,
                                         wc_dir, '--set-depth', 'infinity')

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Mon Jan 21 04:00:59 2013
@@ -455,8 +455,6 @@ def run_and_verify_checkout2(do_remove,
 
   if isinstance(output_tree, wc.State):
     output_tree = output_tree.old_tree()
-  if isinstance(disk_tree, wc.State):
-    disk_tree = disk_tree.old_tree()
 
   # Remove dir if it's already there, unless this is a forced checkout.
   # In that case assume we want to test a forced checkout's toleration
@@ -752,8 +750,6 @@ def verify_update(actual_output,
     mergeinfo_output_tree = mergeinfo_output_tree.old_tree()
   if isinstance(elision_output_tree, wc.State):
     elision_output_tree = elision_output_tree.old_tree()
-  if isinstance(status_tree, wc.State):
-    status_tree = status_tree.old_tree()
 
   # Verify actual output against expected output.
   if output_tree:
@@ -1413,8 +1409,6 @@ def run_and_verify_commit(wc_dir_name, o
 
   if isinstance(output_tree, wc.State):
     output_tree = output_tree.old_tree()
-  if isinstance(status_tree, wc.State):
-    status_tree = status_tree.old_tree()
 
   # Commit.
   if '-m' not in args and '-F' not in args:

Modified: subversion/trunk/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/wc.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/wc.py Mon Jan 21 04:00:59 2013
@@ -145,10 +145,11 @@ class State:
     "Import state items from a State object, reparent the items to PARENT."
     assert isinstance(state, State)
 
-    if parent and parent[-1] != '/':
-      parent += '/'
     for path, item in state.desc.items():
-      path = parent + path
+      if path == '':
+        path = parent
+      else:
+        path = parent + '/' + path
       self.desc[path] = item
 
   def remove(self, *paths):
@@ -338,6 +339,13 @@ class State:
         # These are only in their parents' THIS_DIR, they don't have entries.
         if item.status[0] in '!?' and item.treeconflict == 'C':
           del self.desc[path]
+        # Normal externals are not stored in the parent wc, drop the root
+        # and everything in these working copies
+        elif item.status == 'X ' or item.prev_status == 'X ':
+          del self.desc[path]
+          for p, i in self.desc.copy().items():
+            if p.startswith(path + '/'):
+              del self.desc[p]
         else:
           # when reading the entry structures, we don't examine for text or
           # property mods, so clear those flags. we also do not examine the
@@ -356,6 +364,9 @@ class State:
           if item.entry_status is not None:
             item.status = item.entry_status
             item.entry_status = None
+          if item.entry_copied is not None:
+            item.copied = item.entry_copied
+            item.entry_copied = None
       if item.writelocked:
         # we don't contact the repository, so our only information is what
         # is in the working copy. 'K' means we have one and it matches the
@@ -373,6 +384,9 @@ class State:
           item.writelocked = None
       item.moved_from = None
       item.moved_to = None
+      if path == '':
+        item.switched = None
+      item.treeconflict = None
 
   def old_tree(self):
     "Return an old-style tree (for compatibility purposes)."
@@ -676,6 +690,9 @@ class State:
         # entries that are ABSENT don't show up in status
         if entry.absent:
           continue
+        # entries that are User Excluded don't show up in status
+        if entry.depth == -1:
+          continue
         if name and entry.kind == 2:
           # stub subdirectory. leave a "missing" StateItem in here. note
           # that we can't put the status as "! " because that gets tweaked
@@ -685,6 +702,7 @@ class State:
           continue
         item = StateItem.from_entry(entry)
         if name:
+          print('P: %s, N: %s -> %s' % (parent, name, repos_join(parent, name)))
           desc[repos_join(parent, name)] = item
           implied_url = repos_join(parent_url, svn_uri_quote(name))
         else:
@@ -701,6 +719,9 @@ class State:
         if implied_url and implied_url != entry.url:
           item.switched = 'S'
 
+        if entry.file_external:
+          item.switched = 'X'
+
     return cls('', desc)
 
 
@@ -714,7 +735,7 @@ class StateItem:
 
   def __init__(self, contents=None, props=None,
                status=None, verb=None, wc_rev=None,
-               entry_rev=None, entry_status=None,
+               entry_rev=None, entry_status=None, entry_copied=None,
                locked=None, copied=None, switched=None, writelocked=None,
                treeconflict=None, moved_from=None, moved_to=None,
                prev_status=None, prev_verb=None, prev_treeconflict=None):
@@ -744,6 +765,7 @@ class StateItem:
     # found in the entries code.
     self.entry_rev = entry_rev
     self.entry_status = entry_status
+    self.entry_copied = entry_copied
     # For the following attributes, the value is the status character of that
     # field from 'svn status', except using value None instead of status ' '.
     self.locked = locked
@@ -914,9 +936,12 @@ def repos_join(base, path):
   """Join two repos paths. This generally works for URLs too."""
   if base == '':
     return path
-  if path == '':
+  elif path == '':
     return base
-  return base + '/' + path
+  elif base[len(base)-1:] == '/':
+    return base + path
+  else:
+    return base + '/' + path
 
 
 def svn_uri_quote(url):

Modified: subversion/trunk/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/switch_tests.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/switch_tests.py Mon Jan 21 04:00:59 2013
@@ -1463,15 +1463,15 @@ def switch_with_obstructing_local_adds(s
   expected_status.add({
     'A/B/F/gamma'     : Item(status='R ', treeconflict='C', wc_rev='1'),
     'A/B/F/G'         : Item(status='R ', treeconflict='C', wc_rev='1'),
-    'A/B/F/G/pi'      : Item(status='A ', wc_rev='-'),
-    'A/B/F/G/tau'     : Item(status='A ', wc_rev='-'),
-    'A/B/F/G/upsilon' : Item(status='A ', wc_rev='-'),
+    'A/B/F/G/pi'      : Item(status='A ', wc_rev='-', entry_status='R ', entry_rev='1'),
+    'A/B/F/G/tau'     : Item(status='A ', wc_rev='-', entry_status='R ', entry_rev='1'),
+    'A/B/F/G/upsilon' : Item(status='A ', wc_rev='-', entry_rev='0'),
     'A/B/F/G/rho'     : Item(status='D ', wc_rev='1'),
     'A/B/F/H'         : Item(status='  ', wc_rev='1'),
     'A/B/F/H/chi'     : Item(status='  ', wc_rev='1'),
     'A/B/F/H/omega'   : Item(status='  ', wc_rev='1'),
     'A/B/F/H/psi'     : Item(status='  ', wc_rev='1'),
-    'A/B/F/I'         : Item(status='A ', wc_rev='-'),
+    'A/B/F/I'         : Item(status='A ', wc_rev='-', entry_rev='0'),
   })
 
   # "Extra" files that we expect to result from the conflicts.
@@ -2213,7 +2213,7 @@ def switch_to_root(sbox):
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.remove('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
   expected_status.add_state('A/D/G',
-                            svntest.actions.get_virginal_state(wc_dir, 1))
+                            svntest.actions.get_virginal_state(wc_dir + '/A/D/G', 1))
   expected_status.tweak('A/D/G', switched = 'S')
   svntest.actions.run_and_verify_switch(wc_dir, ADG_path, sbox.repo_url,
                                         expected_output,

Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1436192&r1=1436191&r2=1436192&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Mon Jan 21 04:00:59 2013
@@ -2351,9 +2351,9 @@ def update_wc_on_windows_drive(sbox):
                                        sbox.repo_url, wc_dir)
 
     # Make some local modifications
-    mu_path = os.path.join(wc_dir, 'A', 'mu')
+    mu_path = os.path.join(wc_dir, 'A', 'mu').replace(os.sep, '/')
     svntest.main.file_append(mu_path, '\nAppended text for mu')
-    zeta_path = os.path.join(wc_dir, 'zeta')
+    zeta_path = os.path.join(wc_dir, 'zeta').replace(os.sep, '/')
     svntest.main.file_append(zeta_path, "This is the file 'zeta'\n")
     svntest.main.run_svn(None, 'add', zeta_path)
 
@@ -2374,7 +2374,7 @@ def update_wc_on_windows_drive(sbox):
                                           wc_dir, zeta_path)
 
     # Non recursive commit
-    dir1_path = os.path.join(wc_dir, 'dir1')
+    dir1_path = os.path.join(wc_dir, 'dir1').replace(os.sep, '/')
     os.mkdir(dir1_path)
     svntest.main.run_svn(None, 'add', '-N', dir1_path)
     file1_path = os.path.join(dir1_path, 'file1')
@@ -2443,10 +2443,11 @@ def update_wc_on_windows_drive(sbox):
     expected_disk.tweak('A/mu', contents = expected_disk.desc['A/mu'].contents
                         + '\nAppended text for mu')
 
+    # Use .old_tree() for status to avoid the entries validation
     svntest.actions.run_and_verify_update(wc_dir,
                                           expected_output,
                                           expected_disk,
-                                          expected_status)
+                                          expected_status.old_tree())
 
   finally:
     os.chdir(was_cwd)
@@ -3509,12 +3510,12 @@ def update_copied_from_replaced_and_chan
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  fn1_relpath = os.path.join('A', 'B', 'E', 'aardvark')
-  fn2_relpath = os.path.join('A', 'B', 'E', 'alpha')
-  fn3_relpath = os.path.join('A', 'B', 'E', 'beta')
-  fn1_path = os.path.join(wc_dir, fn1_relpath)
-  fn2_path = os.path.join(wc_dir, fn2_relpath)
-  fn3_path = os.path.join(wc_dir, fn3_relpath)
+  fn1_relpath = 'A/B/E/aardvark'
+  fn2_relpath = 'A/B/E/alpha'
+  fn3_relpath = 'A/B/E/beta'
+  fn1_path = sbox.ospath(fn1_relpath)
+  fn2_path = sbox.ospath(fn2_relpath)
+  fn3_path = sbox.ospath(fn3_relpath)
 
   # Move fn2 to fn1
   svntest.actions.run_and_verify_svn(None, None, [],
@@ -5911,13 +5912,15 @@ def update_edit_delete_obstruction(sbox)
     'A/D/H/psi'         : Item(status='! ', wc_rev='2'),
     'A/D/gamma'         : Item(status='! ', wc_rev='2'),
     'A/C'               : Item(status='  ', wc_rev='2'),
-    'A/B'               : Item(status='~ ', treeconflict='C', wc_rev='-'),
-    'A/B/F'             : Item(status='! ', wc_rev='-'),
-    'A/B/E'             : Item(status='! ', wc_rev='-'),
-    'A/B/E/beta'        : Item(status='! ', wc_rev='-'),
-    'A/B/E/alpha'       : Item(status='! ', wc_rev='-'),
-    'A/B/lambda'        : Item(status='! ', wc_rev='-'),
-    'iota'              : Item(status='~ ', treeconflict='C', wc_rev='-'),
+    'A/B'               : Item(status='~ ', treeconflict='C', wc_rev='-',
+                               entry_status='A ', entry_copied='+'),
+    'A/B/F'             : Item(status='! ', wc_rev='-', entry_copied='+'),
+    'A/B/E'             : Item(status='! ', wc_rev='-', entry_copied='+'),
+    'A/B/E/beta'        : Item(status='! ', wc_rev='-', entry_copied='+'),
+    'A/B/E/alpha'       : Item(status='! ', wc_rev='-', entry_copied='+'),
+    'A/B/lambda'        : Item(status='! ', wc_rev='-', entry_copied='+'),
+    'iota'              : Item(status='~ ', treeconflict='C', wc_rev='-',
+                               entry_status='A ', entry_copied='+'),
   })
   expected_disk = svntest.wc.State('', {
     'A/D'               : Item(contents="Obstruction", props={'key':'value'}),



Mime
View raw message