svn commit: r980335 - /subversion/trunk/subversion/tests/cmdline/diff_tests.py

2010-07-29 Thread dannas
Author: dannas
Date: Thu Jul 29 06:52:55 2010
New Revision: 980335

URL: http://svn.apache.org/viewvc?rev=980335view=rev
Log:
Add XFailing test for creating a property diff with multiple hunks.

At the moment, only the last hunk of a property diff has the right
hunk header '## -a,b +b,c ##'. The previous ones have '@@ -a,b +b,c @@'.

* subversion/tests/cmdline/diff_tests.py
  (diff_prop_multiple_hunks): New.
  (test_list): Add the new test and mark it with XFail.

Modified:
subversion/trunk/subversion/tests/cmdline/diff_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/diff_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/diff_tests.py?rev=980335r1=980334r2=980335view=diff
==
--- subversion/trunk/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/diff_tests.py Thu Jul 29 06:52:55 
2010
@@ -3423,6 +3423,86 @@ def diff_prop_missing_context(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [],
  'diff', iota_path)
 
+def diff_prop_multiple_hunks(sbox):
+  diff for property with multiple hunks
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  iota_path = os.path.join(wc_dir, 'iota')
+  prop_val = .join([
+   line 1\n,
+   line 2\n,
+   line 3\n,
+   line 4\n,
+   line 5\n,
+   line 6\n,
+   line 7\n,
+   line 8\n,
+   line 9\n,
+   line 10\n,
+   line 11\n,
+   line 12\n,
+   line 13\n,
+ ])
+  svntest.main.run_svn(None,
+   propset, prop, prop_val, iota_path)
+
+  expected_output = svntest.wc.State(wc_dir, {
+  'iota': Item(verb='Sending'),
+  })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('iota', wc_rev=2)
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+expected_status, None, wc_dir)
+
+  prop_val = .join([
+   line 1\n,
+   line 2\n,
+   line 3\n,
+   Add a line here\n,
+   line 4\n,
+   line 5\n,
+   line 6\n,
+   line 7\n,
+   line 8\n,
+   line 9\n,
+   line 10\n,
+   And add a line here\n,
+   line 11\n,
+   line 12\n,
+   line 13\n,
+ ])
+  svntest.main.run_svn(None,
+   propset, prop, prop_val, iota_path)
+  expected_output = [
+Index: iota\n,
+===\n,
+--- iota\t(revision 2)\n,
++++ iota\t(working copy)\n,
+\n,
+Property changes on: iota\n,
+___\n,
+Modified: prop\n,
+## -1,6 +1,7 ##\n,
+ line 1\n,
+ line 2\n,
+ line 3\n,
++Add a line here\n,
+ line 4\n,
+ line 5\n,
+ line 6\n,
+## -8,6 +9,7 ##\n,
+ line 8\n,
+ line 9\n,
+ line 10\n,
++And add a line here\n,
+ line 11\n,
+ line 12\n,
+ line 13\n,
+  ]
+
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'diff', iota_path)
 
 
 #Run the tests
@@ -3484,6 +3564,7 @@ test_list = [ None,
   diff_git_format_url_wc,
   diff_git_format_url_url,
   XFail(diff_prop_missing_context),
+  XFail(diff_prop_multiple_hunks),
   ]
 
 if __name__ == '__main__':




svn commit: r980362 - in /subversion/trunk/subversion/tests/cmdline: entries_tests.py svntest/main.py

2010-07-29 Thread rhuijben
Author: rhuijben
Date: Thu Jul 29 08:47:33 2010
New Revision: 980362

URL: http://svn.apache.org/viewvc?rev=980362view=rev
Log:
Update entries test to check for different expected values in single-db
and without single-db mode. Add a temporary helper function that guesses if
single-db is used, which should be safe for any working copy containing at least
a file with pristine test

* subversion/tests/cmdline/entries_tests.py
  (obstructed_entries): Update expected values for single-db.

* subversion/tests/cmdline/svntest/main.py
  (wc_is_singledb): New function.

Modified:
subversion/trunk/subversion/tests/cmdline/entries_tests.py
subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/entries_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/entries_tests.py?rev=980362r1=980361r2=980362view=diff
==
--- subversion/trunk/subversion/tests/cmdline/entries_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/entries_tests.py Thu Jul 29 
08:47:33 2010
@@ -182,7 +182,12 @@ def obstructed_entries(sbox):
 
   entries = svntest.main.run_entriesdump(D_path)
   check_names(entries, 'H')
-  validate(entries['H'], revision=-1)
+
+  if svntest.main.wc_is_singledb(wc_dir):
+# Data is not missing in single-db
+validate(entries['H'], revision=1)
+  else:
+validate(entries['H'], revision=-1)
 
   ### need to get svn_wc__db_read_info() to generate obstructed_add
 

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=980362r1=980361r2=980362view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Thu Jul 29 
08:47:33 2010
@@ -269,6 +269,22 @@ def get_admin_name():
   else:
 return '.svn'
 
+def wc_is_singledb(wcpath):
+  Temporary function that checks whether a working copy directory looks
+  like it is part of a single-db working copy.
+
+  pristine = os.path.join(wcpath, get_admin_name(), 'pristine')
+  if not os.path.exists(pristine):
+return True
+
+  for name in os.listdir(pristine):
+if len(name) == 2:
+  return True
+elif len(name) == 40:
+  return False
+
+  return False
+
 def get_start_commit_hook_path(repo_dir):
   Return the path of the start-commit-hook conf file in REPO_DIR.
 




svn commit: r980373 - in /subversion/trunk/subversion: libsvn_client/patch.c svn/notify.c

2010-07-29 Thread dannas
Author: dannas
Date: Thu Jul 29 09:13:41 2010
New Revision: 980373

URL: http://svn.apache.org/viewvc?rev=980373view=rev
Log:
Make 'svn patch' report conflicts for prop targets. At the same time 
start printing rejected property hunks to the reject stream.

Note that we do not yet give notifications on the hunk level for 
properties.

* subversion/svn/notify.c
  (notify): Print ' C' for paths with prop conflicts.

* subversion/libsvn_client/patch.c
  (patch_target_t): Add field 'had_prop_rejects' to make it possible to
distinguish between prop and text conflicts.
  (reject_hunk): Replace parameter 'is_prop_hunk' with 'prop_name' 
since we need the property name when printing prop hunks. Use '##'
instead of '@@' for property hunks.
  (apply_hunk): Replace parameter 'is_prop_hunk' with 'prop_name'
since reject_hunk() may be called from here.
  (send_patch_notification): Start notifying about prop conflicts.
  (apply_one_patch): Update caller of reject_hunk() and apply_hunk().
  (write_out_rejected_hunks): Start writing rejected prop hunks.

Modified:
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/svn/notify.c

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=980373r1=980372r2=980373view=diff
==
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Thu Jul 29 09:13:41 2010
@@ -176,6 +176,9 @@ typedef struct patch_target_t {
   /* True if at least one hunk was rejected. */
   svn_boolean_t had_rejects;
 
+  /* True if atleast one property hunk was rejected. */
+  svn_boolean_t had_prop_rejects;
+
   /* True if the target file had local modifications before the
* patch was applied to it. */
   svn_boolean_t local_mods;
@@ -1271,19 +1274,38 @@ copy_lines_to_target(target_content_info
  * Do temporary allocations in POOL. */
 static svn_error_t *
 reject_hunk(patch_target_t *target, target_content_info_t *content_info, 
-hunk_info_t *hi, svn_boolean_t is_prop_hunk,  apr_pool_t *pool)
+hunk_info_t *hi, const char *prop_name, apr_pool_t *pool)
 {
   const char *hunk_header;
   apr_size_t len;
   svn_boolean_t eof;
   apr_pool_t *iterpool;
 
-  hunk_header = apr_psprintf(pool, @@ -%lu,%lu +%lu,%lu @@%s,
- svn_diff_hunk_get_original_start(hi-hunk),
- svn_diff_hunk_get_original_length(hi-hunk),
- svn_diff_hunk_get_modified_start(hi-hunk),
- svn_diff_hunk_get_modified_length(hi-hunk),
- APR_EOL_STR);
+  if (prop_name)
+{
+  const char *prop_header;
+
+  /* ### Print 'Added', 'Deleted' or 'Modified' instead of 'Propperty'.
+   */
+  prop_header = apr_psprintf(pool, Property: %s\n, prop_name);
+  len = strlen(prop_header);
+
+  SVN_ERR(svn_stream_write(content_info-reject, prop_header, len));
+
+  hunk_header = apr_psprintf(pool, ## -%lu,%lu +%lu,%lu ##%s,
+ svn_diff_hunk_get_original_start(hi-hunk),
+ svn_diff_hunk_get_original_length(hi-hunk),
+ svn_diff_hunk_get_modified_start(hi-hunk),
+ svn_diff_hunk_get_modified_length(hi-hunk),
+ APR_EOL_STR);
+}
+  else
+hunk_header = apr_psprintf(pool, @@ -%lu,%lu +%lu,%lu @@%s,
+   svn_diff_hunk_get_original_start(hi-hunk),
+   svn_diff_hunk_get_original_length(hi-hunk),
+   svn_diff_hunk_get_modified_start(hi-hunk),
+   svn_diff_hunk_get_modified_length(hi-hunk),
+   APR_EOL_STR);
   len = strlen(hunk_header);
   SVN_ERR(svn_stream_write(content_info-reject, hunk_header, len));
 
@@ -1311,9 +1333,9 @@ reject_hunk(patch_target_t *target, targ
   while (! eof);
   svn_pool_destroy(iterpool);
 
-  /* ### had_rejects is used for notification. We haven't yet turned on
-   * ### notification for properties. */
-  if (! is_prop_hunk)
+  if (prop_name)
+target-had_prop_rejects = TRUE;
+  else
 target-had_rejects = TRUE;
 
   return SVN_NO_ERROR;
@@ -1323,7 +1345,7 @@ reject_hunk(patch_target_t *target, targ
  * stream of CONTENT_INFO. Do temporary allocations in POOL. */
 static svn_error_t *
 apply_hunk(patch_target_t *target, target_content_info_t *content_info,  
-   hunk_info_t *hi, svn_boolean_t is_prop_hunk, apr_pool_t *pool)
+   hunk_info_t *hi, const char *prop_name, apr_pool_t *pool)
 {
   svn_linenum_t lines_read;
   svn_boolean_t eof;
@@ -1331,7 +1353,7 @@ apply_hunk(patch_target_t *target, targe
 
   /* ### Is there a cleaner way to describe if we have 

svn commit: r980376 - /subversion/trunk/subversion/tests/cmdline/update_tests.py

2010-07-29 Thread rhuijben
Author: rhuijben
Date: Thu Jul 29 09:32:32 2010
New Revision: 980376

URL: http://svn.apache.org/viewvc?rev=980376view=rev
Log:
Don't assume that we need a remote update to pull in missing files when
single-db can just restore them. This patch fixes 3 currently failing
tests for single-db.

* subversion/tests/cmdline/update_tests.py
  (update_missing): Nodes will just be restored in single-db mode.
  (update_deleted_missing_dir): Restoring is not an error in single-db.
  (nested_in_read_only): With single-db the scenario 'updating a writable
working copy inside a read only parent working copy' is no longer
supported.

Modified:
subversion/trunk/subversion/tests/cmdline/update_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=980376r1=980375r2=980376view=diff
==
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Thu Jul 29 
09:32:32 2010
@@ -324,17 +324,23 @@ def update_missing(sbox):
   svntest.main.safe_rmtree(E_path)
   svntest.main.safe_rmtree(H_path)
 
+  # In single-db mode all missing items will just be restored
+  if svntest.main.wc_is_singledb(wc_dir):
+A_or_Restored = Item(verb='Restored')
+  else:
+A_or_Restored = Item(status='A ')
+
   # Create expected output tree for an update of the missing items by name
   expected_output = svntest.wc.State(wc_dir, {
 'A/mu': Item(verb='Restored'),
 'A/D/G/rho'   : Item(verb='Restored'),
-'A/B/E' : Item(status='A '),
-'A/B/E/alpha' : Item(status='A '),
-'A/B/E/beta' : Item(status='A '),
-'A/D/H' : Item(status='A '),
-'A/D/H/chi' : Item(status='A '),
-'A/D/H/omega' : Item(status='A '),
-'A/D/H/psi' : Item(status='A '),
+'A/B/E'   : A_or_Restored,
+'A/B/E/alpha' : A_or_Restored,
+'A/B/E/beta'  : A_or_Restored,
+'A/D/H'   : A_or_Restored,
+'A/D/H/chi'   : A_or_Restored,
+'A/D/H/omega' : A_or_Restored,
+'A/D/H/psi'   : A_or_Restored,
 })
 
   # Create expected disk tree for the update.
@@ -1072,6 +1078,17 @@ def update_deleted_missing_dir(sbox):
 'A/D/H' : Item(status='D '),
 })
 
+  # In single-db mode the missing items are restored before the update
+  if svntest.main.wc_is_singledb(wc_dir):
+expected_output.add({
+  'A/D/H/psi' : Item(verb='Restored'),
+  'A/D/H/omega'   : Item(verb='Restored'),
+  'A/D/H/chi' : Item(verb='Restored'),
+  'A/B/E/beta': Item(verb='Restored'),
+  'A/B/E/alpha'   : Item(verb='Restored')
+  # A/B/E and A/D/H are also restored, but are then overriden by the delete
+})
+
   # Create expected disk tree for the update.
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta')
@@ -1097,6 +1114,12 @@ def update_deleted_missing_dir(sbox):
   # This time we're updating the whole working copy
   expected_status.tweak(wc_rev=2)
 
+  # And now we don't expect restore operations
+  expected_output = svntest.wc.State(wc_dir, {
+'A/B/E' : Item(status='D '),
+'A/D/H' : Item(status='D '),
+})
+
   # Do the update, on the whole working copy this time
   svntest.actions.run_and_verify_update(wc_dir,
 expected_output,
@@ -1144,12 +1167,23 @@ def another_hudson_problem(sbox):
   # Update missing directory to receive the delete, this should mark G
   # as 'deleted' and should not alter gamma's entry.
 
+  if not svntest.main.wc_is_singledb(wc_dir):
+expected_output = ['D'+G_path+'\n',
+   'Updated to revision 3.\n',
+   ]
+  else:
+expected_output = ['Restored \'' + G_path + '\'\n',
+   'Restored \'' + G_path + os.path.sep + 'pi\'\n',
+   'Restored \'' + G_path + os.path.sep + 'rho\'\n',
+   'Restored \'' + G_path + os.path.sep + 'tau\'\n',
+   'D'+G_path+'\n',
+   'Updated to revision 3.\n',
+   ]
+
   # Sigh, I can't get run_and_verify_update to work (but not because
   # of issue 919 as far as I can tell)
   svntest.actions.run_and_verify_svn(None,
- ['D'+G_path+'\n',
-  'Updated to revision 3.\n',
-  ], [],
+ expected_output, [],
  'up', G_path)
 
   # Both G and gamma should be 'deleted', update should produce no output
@@ -1555,6 +1589,9 @@ def nested_in_read_only(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
+  if svntest.main.wc_is_singledb(wc_dir):
+raise svntest.Skip('Unsupported in single-db')
+
   # Delete/commit a file
  

svn commit: r980382 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

2010-07-29 Thread rhuijben
Author: rhuijben
Date: Thu Jul 29 09:57:58 2010
New Revision: 980382

URL: http://svn.apache.org/viewvc?rev=980382view=rev
Log:
Mark some copy tests that XPass with-single db, as Work in progress
'Needs single db'.

* subversion/tests/cmdline/copy_tests.py
  (Imports): Import Wimp.
  (test_list): Mark, allow_unversioned_parent_for_copy_src,
move_added_nodes and copy_over_deleted_dir as Wimp instead of XFail.

Modified:
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=980382r1=980381r2=980382view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Thu Jul 29 09:57:58 
2010
@@ -36,6 +36,7 @@ from svntest.main import SVN_PROP_MERGEI
 Skip = svntest.testcase.Skip
 SkipUnless = svntest.testcase.SkipUnless
 XFail = svntest.testcase.XFail
+Wimp = svntest.testcase.Wimp
 Item = svntest.wc.StateItem
 
 
@@ -4905,7 +4906,7 @@ test_list = [ None,
   copy_make_parents_wc_repo,
   copy_make_parents_repo_repo,
   URI_encoded_repos_to_wc,
-  XFail(allow_unversioned_parent_for_copy_src),
+  Wimp('Needs single db', allow_unversioned_parent_for_copy_src),
   replaced_local_source_for_incoming_copy,
   unneeded_parents,
   double_parents_with_url,
@@ -4924,11 +4925,11 @@ test_list = [ None,
   copy_dir_with_space,
   changed_data_should_match_checkout,
   XFail(changed_dir_data_should_match_checkout),
-  XFail(move_added_nodes),
+  Wimp('Needs single db', move_added_nodes),
   # Serf needs a different testcase for this issue
   XFail(Skip(locate_wrong_origin,
  svntest.main.is_ra_type_dav_serf)),
-  XFail(copy_over_deleted_dir),
+  Wimp('Needs single db', copy_over_deleted_dir),
  ]
 
 if __name__ == '__main__':




svn commit: r980405 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/copy.c libsvn_wc/adm_ops.c libsvn_wc/copy.c libsvn_wc/deprecated.c libsvn_wc/wc_db.h libsvn_wc/wc_db_pdh.c

2010-07-29 Thread philip
Author: philip
Date: Thu Jul 29 11:20:55 2010
New Revision: 980405

URL: http://svn.apache.org/viewvc?rev=980405view=rev
Log:
Start making url-to-wc copy work in single-db.

* subversion/libsvn_wc/adm_ops.c
  (svn_wc_add4): Add single-db implementation of join-by-rewriting.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_drop_root): New.

* subversion/libsvn_wc/wc_db_pdh.c
  (svn_wc__db_drop_root): New.

* subversion/include/svn_wc.h
  (svn_wc_copy3): Add metadata_only parameter.

* subversion/libsvn_wc/copy.c
  (copy_versioned_file, copy_versioned_dir, svn_wc_copy3): Add metadata_only
   processing.  A subsequent commit will make large whitespace changes.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_copy2): Adjust call to svn_wc_copy3.

* subversion/libsvn_client/copy.c
  (do_wc_to_wc_copies_with_write_lock, do_wc_to_wc_moves_with_lock): Adjust
   call to svn_wc_copy3.

Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/copy.c
subversion/trunk/subversion/libsvn_wc/adm_ops.c
subversion/trunk/subversion/libsvn_wc/copy.c
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/libsvn_wc/wc_db_pdh.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=980405r1=980404r2=980405view=diff
==
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Thu Jul 29 11:20:55 2010
@@ -4215,12 +4215,15 @@ svn_wc_status_set_repos_locks(void *set_
  * is used for accessing the working copy and must contain a write lock for
  * the parent directory of @a dst_abspath,
  *
+ * If metadata_only is TRUE then this a database only operation and
+ * the working directories and files are not copied.
+ *
  * @a src_abspath must be a file or directory under version control;
  * the parent of @a dst_abspath must be a directory under version control
  * in the same working copy; @a dst_abspath will be the name of the copied
- * item, and it must not exist already.  Note that when @a src points to a
- * versioned file, the working file doesn't necessarily exist in which case
- * its text-base is used instead.
+ * item, and it must not exist already if metadata_only is FALSE.  Note that
+ * when @a src points to a versioned file, the working file doesn't
+ * necessarily exist in which case its text-base is used instead.
  *
  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
  * various points during the operation.  If it returns an error
@@ -4243,6 +4246,7 @@ svn_error_t *
 svn_wc_copy3(svn_wc_context_t *wc_ctx,
  const char *src_abspath,
  const char *dst_abspath,
+ svn_boolean_t metadata_only,
  svn_cancel_func_t cancel_func,
  void *cancel_baton,
  svn_wc_notify_func2_t notify_func,

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=980405r1=980404r2=980405view=diff
==
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Thu Jul 29 11:20:55 2010
@@ -277,6 +277,7 @@ do_wc_to_wc_copies_with_write_lock(void 
   dst_abspath = svn_dirent_join(pair-dst_parent_abspath, pair-base_name,
 iterpool);
   err = svn_wc_copy3(b-ctx-wc_ctx, pair-src_abspath_or_url, dst_abspath,
+ FALSE /* metadata_only */,
  b-ctx-cancel_func, b-ctx-cancel_baton,
  b-ctx-notify_func2, b-ctx-notify_baton2, 
iterpool);
   if (err)
@@ -336,7 +337,7 @@ do_wc_to_wc_moves_with_locks2(void *bato
 scratch_pool);
 
   SVN_ERR(svn_wc_copy3(b-ctx-wc_ctx, b-pair-src_abspath_or_url,
-   dst_abspath,
+   dst_abspath, FALSE /* metadata_only */,
b-ctx-cancel_func, b-ctx-cancel_baton,
b-ctx-notify_func2, b-ctx-notify_baton2,
scratch_pool));

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=980405r1=980404r2=980405view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Thu Jul 29 11:20:55 2010
@@ -1236,12 +1236,13 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
scratch_pool));
   else
 {
+  svn_boolean_t owns_lock;
+#ifndef SVN_WC__SINGLE_DB
   svn_wc__db_status_t absent_status;

svn commit: r980406 - /subversion/trunk/subversion/tests/cmdline/prop_tests.py

2010-07-29 Thread rhuijben
Author: rhuijben
Date: Thu Jul 29 11:21:26 2010
New Revision: 980406

URL: http://svn.apache.org/viewvc?rev=980406view=rev
Log:
Fix another obstruction test's expectations for single-db: we don't
loose data; shouldn't that be ok?

* subversion/tests/cmdline/prop_tests.py
  (obstructed_subdirs): Assume that we keep the data in single-db mode.

Modified:
subversion/trunk/subversion/tests/cmdline/prop_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/prop_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/prop_tests.py?rev=980406r1=980405r2=980406view=diff
==
--- subversion/trunk/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/prop_tests.py Thu Jul 29 11:21:26 
2010
@@ -1944,20 +1944,32 @@ def obstructed_subdirs(sbox):
  expected_disk.old_tree())
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
-  expected_status.tweak('A/C', status='! ', wc_rev='?')
+  if svntest.main.wc_is_singledb(wc_dir):
+expected_status.tweak('A/C', status='! ', wc_rev='1')
+  else:
+expected_status.tweak('A/C', status='! ', wc_rev='?')
+
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
   # Drop an empty file there to obstruct the now-deleted subdir
   open(C_path, 'w')
 
-  expected_disk.add({'A/C': Item(contents='')})
+  # Single-DB doesn't lose properties
+  if svntest.main.wc_is_singledb(wc_dir):
+expected_disk.add({'A/C': Item(contents='', props={'red': 'blue'})})
+expected_status.tweak('A/C', status='~ ', wc_rev='1')
+  else:
+expected_disk.add({'A/C': Item(contents='')})
+
+# NOTE: r943346 fixes a problem with reporter processing, which
+#   is necessary for this status to complete properly.
+expected_status.tweak('A/C', status='~ ', wc_rev='?')
+
   actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, load_props=True)
   svntest.tree.compare_trees(disk, actual_disk_tree,
  expected_disk.old_tree())
 
-  # NOTE: r943346 fixes a problem with reporter processing, which
-  #   is necessary for this status to complete properly.
-  expected_status.tweak('A/C', status='~ ', wc_rev='?')
+  
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 




svn commit: r980409 - /subversion/trunk/subversion/libsvn_wc/copy.c

2010-07-29 Thread philip
Author: philip
Date: Thu Jul 29 11:37:05 2010
New Revision: 980409

URL: http://svn.apache.org/viewvc?rev=980409view=rev
Log:
Followup to r980405, whitespace only changes.

* subversion/libsvn_wc/copy.c
  (copy_versioned_file, copy_versioned_dir): Reindent.

Modified:
subversion/trunk/subversion/libsvn_wc/copy.c

Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=980409r1=980408r2=980409view=diff
==
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Thu Jul 29 11:37:05 2010
@@ -143,70 +143,76 @@ copy_versioned_file(svn_wc__db_t *db,
 
   if (!metadata_only)
 {
-  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(tmpdir_abspath, db,
- dst_abspath,
- scratch_pool, scratch_pool));
-
-  /* This goes away when we centralise, but until then we might need
- to do a cross-db pristine copy. */
-  if (strcmp(svn_dirent_dirname(src_abspath, scratch_pool),
- svn_dirent_dirname(dst_abspath, scratch_pool)))
-{
-  const svn_checksum_t *checksum;
+  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(tmpdir_abspath, db,
+ dst_abspath,
+ scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-   NULL, NULL, NULL, NULL,
-   checksum,
-   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-   NULL, NULL, NULL, NULL, NULL,
-   db, src_abspath,
-   scratch_pool, scratch_pool));
-  if (checksum)
+  /* This goes away when we centralise, but until then we might need
+ to do a cross-db pristine copy. */
+  if (strcmp(svn_dirent_dirname(src_abspath, scratch_pool),
+ svn_dirent_dirname(dst_abspath, scratch_pool)))
 {
-  svn_stream_t *tmp_pristine;
-  const char *tmp_pristine_abspath;
-  const svn_checksum_t *sha1_checksum, *md5_checksum;
+  const svn_checksum_t *checksum;
 
-  if (checksum-kind == svn_checksum_md5)
-{
-  md5_checksum = checksum;
-  SVN_ERR(svn_wc__db_pristine_get_sha1(sha1_checksum, db,
-   src_abspath, checksum,
-   scratch_pool, 
scratch_pool));
-}
-  else
+  SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, 
NULL,
+   NULL, NULL, NULL, NULL,
+   checksum,
+   NULL, NULL, NULL, NULL, NULL, NULL, 
NULL,
+   NULL, NULL, NULL, NULL, NULL,
+   db, src_abspath,
+   scratch_pool, scratch_pool));
+  if (checksum)
 {
-  sha1_checksum = checksum;
-  SVN_ERR(svn_wc__db_pristine_get_md5(md5_checksum, db,
-  src_abspath, checksum,
-  scratch_pool, scratch_pool));
+  svn_stream_t *tmp_pristine;
+  const char *tmp_pristine_abspath;
+  const svn_checksum_t *sha1_checksum, *md5_checksum;
+
+  if (checksum-kind == svn_checksum_md5)
+{
+  md5_checksum = checksum;
+  SVN_ERR(svn_wc__db_pristine_get_sha1(sha1_checksum, db,
+   src_abspath, checksum,
+   scratch_pool,
+   scratch_pool));
+}
+  else
+{
+  sha1_checksum = checksum;
+  SVN_ERR(svn_wc__db_pristine_get_md5(md5_checksum, db,
+  src_abspath, checksum,
+  scratch_pool,
+  scratch_pool));
+}
+  SVN_ERR(svn_wc__db_pristine_read(src_pristine, db,
+   src_abspath, sha1_checksum,
+   scratch_pool, scratch_pool));
+  SVN_ERR(svn_stream_open_unique(tmp_pristine,
+ tmp_pristine_abspath,
+ tmpdir_abspath,
+ 

svn propchange: r980405 - svn:log

2010-07-29 Thread philip
Author: philip
Revision: 980405
Modified property: svn:log

Modified: svn:log at Thu Jul 29 11:38:25 2010
--
--- svn:log (original)
+++ svn:log Thu Jul 29 11:38:25 2010
@@ -14,7 +14,7 @@ Start making url-to-wc copy work in sing
 
 * subversion/libsvn_wc/copy.c
   (copy_versioned_file, copy_versioned_dir, svn_wc_copy3): Add metadata_only
-   processing.  A subsequent commit will make large whitespace changes.
+   processing.  A subsequent commit (r980409) makes large whitespace changes.
 
 * subversion/libsvn_wc/deprecated.c
   (svn_wc_copy2): Adjust call to svn_wc_copy3.



svn commit: r980427 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/patch.c svn/notify.c tests/cmdline/patch_tests.py

2010-07-29 Thread dannas
Author: dannas
Date: Thu Jul 29 12:43:56 2010
New Revision: 980427

URL: http://svn.apache.org/viewvc?rev=980427view=rev
Log:
Make 'svn patch' do notifications for property hunks.

We use the same notification actions as for text hunks but replace
the headers to look like:
  '## -1,6 +1,7 ##'
instead of:
  '@@ -1,6 +1,7 @@'

Note that we don't specify what property a hunk belongs to (that information
is available in the reject file).

* subversion/svn/notify.c
  (notify): Print different hunk headers depending on whether we have
a property or not.

* subversion/include/svn_wc.h
  (svn_wc_notify_t): Add 'is_prop_hunk' field.

* subversion/libsvn_client/patch.c
  (send_patch_notification): Iterate over the hunks of the property 
targets in the same manner as is done for the text hunks.

* subversion/tests/cmdline/patch_tests.py
  (test_with_properties): Mark as XFail. We get a notification saying
a hunk that adds one line to a non-existent property is beeing applied
with offset 1.

Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/svn/notify.c
subversion/trunk/subversion/tests/cmdline/patch_tests.py

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=980427r1=980426r2=980427view=diff
==
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Thu Jul 29 12:43:56 2010
@@ -1266,6 +1266,10 @@ typedef struct svn_wc_notify_t {
* @since New in 1.7 */
   int hunk_fuzz;
 
+  /** If @c action relates to hunks, specifies whether the hunk is a
+   * property hunk or not. */
+  svn_boolean_t is_prop_hunk;
+
   /* NOTE: Add new fields at the end to preserve binary compatibility.
  Also, if you add fields here, you have to update svn_wc_create_notify
  and svn_wc_dup_notify. */

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=980427r1=980426r2=980427view=diff
==
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Thu Jul 29 12:43:56 2010
@@ -1487,6 +1487,7 @@ send_patch_notification(const patch_targ
 {
   int i;
   apr_pool_t *iterpool;
+  apr_hash_index_t *hash_index;
 
   iterpool = svn_pool_create(pool);
   for (i = 0; i  target-content_info-hunks-nelts; i++)
@@ -1518,9 +1519,56 @@ send_patch_notification(const patch_targ
 svn_diff_hunk_get_modified_length(hi-hunk);
   notify-hunk_matched_line = hi-matched_line;
   notify-hunk_fuzz = hi-fuzz;
+  /* ### Should is_prop_hunk be a field in hunk_info_t? */
+  notify-is_prop_hunk = FALSE;
 
   (*ctx-notify_func2)(ctx-notify_baton2, notify, pool);
 }
+
+  for (hash_index = apr_hash_first(pool, target-prop_targets);
+   hash_index;
+   hash_index = apr_hash_next(hash_index))
+{
+  prop_patch_target_t *prop_target; 
+  
+  prop_target = svn__apr_hash_index_val(hash_index);
+
+  for (i = 0; i  prop_target-content_info-hunks-nelts; i++)
+{
+  hunk_info_t *hi;
+
+  svn_pool_clear(iterpool);
+
+  hi = APR_ARRAY_IDX(prop_target-content_info-hunks, i,
+ hunk_info_t *);
+
+  if (hi-already_applied)
+action = svn_wc_notify_patch_hunk_already_applied;
+  else if (hi-rejected)
+action = svn_wc_notify_patch_rejected_hunk;
+  else
+action = svn_wc_notify_patch_applied_hunk;
+
+  notify = svn_wc_create_notify(target-local_abspath
+? target-local_abspath
+: target-local_relpath,
+action, pool);
+  notify-hunk_original_start =
+svn_diff_hunk_get_original_start(hi-hunk);
+  notify-hunk_original_length =
+svn_diff_hunk_get_original_length(hi-hunk);
+  notify-hunk_modified_start =
+svn_diff_hunk_get_modified_start(hi-hunk);
+  notify-hunk_modified_length =
+svn_diff_hunk_get_modified_length(hi-hunk);
+  notify-hunk_matched_line = hi-matched_line;
+  notify-hunk_fuzz = hi-fuzz;
+  /* ### Should is_prop_hunk be a field in hunk_info_t? */
+  notify-is_prop_hunk = TRUE;
+
+  (*ctx-notify_func2)(ctx-notify_baton2, notify, pool);
+}
+}
   svn_pool_destroy(iterpool);
 }
 


Re: svn commit: r980139 - in /subversion/trunk/subversion: include/svn_dirent_uri.h libsvn_subr/dirent_uri.c

2010-07-29 Thread C. Michael Pilato
On 07/28/2010 01:51 PM, julianf...@apache.org wrote:
 Author: julianfoad
 Date: Wed Jul 28 17:51:10 2010
 New Revision: 980139
 
 URL: http://svn.apache.org/viewvc?rev=980139view=rev
 Log:
 Rename some function parameters for clarity: where xxx1 and xxx2
 represent two paths in a parent-child relationship, rename them to
 parent_xxx and child_xxx respectively.

There's a part of me that groans a little bit here because in having
parameters named parent_path and child_path, you're almost dictating that
relationship to the callers.  That's all wrong, though, because in many of
these cases, the functions are asking questions of that very relationship.
(Is CHILD_PATH really a child path of PARENT_PATH?).

That said, for years now I've been far more irritated by the fact that I
have to read the docstring for those is-child type functions just to
remember which of PATH1 and PATH2 is which.  So...

   T H A N KY O U !


-- 
C. Michael Pilato cmpil...@collab.net
CollabNet  www.collab.net  Distributed Development On Demand



signature.asc
Description: OpenPGP digital signature


svn commit: r980454 - /subversion/trunk/subversion/tests/libsvn_client/client-test.c

2010-07-29 Thread philip
Author: philip
Date: Thu Jul 29 14:37:58 2010
New Revision: 980454

URL: http://svn.apache.org/viewvc?rev=980454view=rev
Log:
This makes the test pass in single-db but shows a limitation of the
legacy 1.6 support.

* subversion/tests/libsvn_client/client-test.c
  (test_wc_add_scenarios): Destroy/recreate wc context.

Modified:
subversion/trunk/subversion/tests/libsvn_client/client-test.c

Modified: subversion/trunk/subversion/tests/libsvn_client/client-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/client-test.c?rev=980454r1=980453r2=980454view=diff
==
--- subversion/trunk/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/client-test.c Thu Jul 29 
14:37:58 2010
@@ -470,6 +470,14 @@ test_wc_add_scenarios(const svn_test_opt
 SVN_ERR(svn_wc_adm_open3(adm_access, NULL, wc_path, TRUE, -1, NULL, NULL,
  pool));
 
+/* ### The above svn_wc_adm_open3 creates a new svn_wc__db_t
+   ### instance.  The svn_wc_add3 below doesn't work while the
+   ### original svn_wc__db_t created by svn_client_create_context
+   ### remains open.  Closing the wc-context gets around the
+   ### problem but is obviously a hack. */
+SVN_ERR(svn_wc_context_destroy(ctx-wc_ctx));
+SVN_ERR(svn_wc_context_create(ctx-wc_ctx, ctx-config, pool, pool));
+
 /* Fix up copy as add with history */
 SVN_ERR(svn_wc_add3(new_dir_path, adm_access, svn_depth_infinity,
 repos_url, committed_rev, NULL, NULL, NULL, NULL,




svn propchange: r980454 - svn:log

2010-07-29 Thread philip
Author: philip
Revision: 980454
Modified property: svn:log

Modified: svn:log at Thu Jul 29 14:38:55 2010
--
--- svn:log (original)
+++ svn:log Thu Jul 29 14:38:55 2010
@@ -1,4 +1,4 @@
-This makes the test pass in single-db but shows a limitation of the
+This makes client-test pass in single-db but shows a limitation of the
 legacy 1.6 support.
 
 * subversion/tests/libsvn_client/client-test.c



svn commit: r980459 - /subversion/trunk/subversion/libsvn_wc/copy.c

2010-07-29 Thread philip
Author: philip
Date: Thu Jul 29 14:54:23 2010
New Revision: 980459

URL: http://svn.apache.org/viewvc?rev=980459view=rev
Log:
* subversion/libsvn_wc/copy.c
  (copy_versioned_file): The pristine is part of the metadata so is always
   copied.

Modified:
subversion/trunk/subversion/libsvn_wc/copy.c

Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=980459r1=980458r2=980459view=diff
==
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Thu Jul 29 14:54:23 2010
@@ -141,65 +141,60 @@ copy_versioned_file(svn_wc__db_t *db,
   const char *tmp_dst_abspath;
   svn_node_kind_t kind;
 
-  if (!metadata_only)
+  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(tmpdir_abspath, db, dst_abspath,
+ scratch_pool, scratch_pool));
+
+  /* This goes away when we centralise, but until then we might need
+ to do a cross-db pristine copy. */
+  if (strcmp(svn_dirent_dirname(src_abspath, scratch_pool),
+ svn_dirent_dirname(dst_abspath, scratch_pool)))
 {
-  SVN_ERR(svn_wc__db_temp_wcroot_tempdir(tmpdir_abspath, db,
- dst_abspath,
- scratch_pool, scratch_pool));
+  const svn_checksum_t *checksum;
 
-  /* This goes away when we centralise, but until then we might need
- to do a cross-db pristine copy. */
-  if (strcmp(svn_dirent_dirname(src_abspath, scratch_pool),
- svn_dirent_dirname(dst_abspath, scratch_pool)))
+  SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL,
+   checksum,
+   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+   NULL, NULL, NULL, NULL, NULL,
+   db, src_abspath,
+   scratch_pool, scratch_pool));
+  if (checksum)
 {
-  const svn_checksum_t *checksum;
+  svn_stream_t *tmp_pristine;
+  const char *tmp_pristine_abspath;
+  const svn_checksum_t *sha1_checksum, *md5_checksum;
 
-  SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, 
NULL,
-   NULL, NULL, NULL, NULL,
-   checksum,
-   NULL, NULL, NULL, NULL, NULL, NULL, 
NULL,
-   NULL, NULL, NULL, NULL, NULL,
-   db, src_abspath,
-   scratch_pool, scratch_pool));
-  if (checksum)
+  if (checksum-kind == svn_checksum_md5)
 {
-  svn_stream_t *tmp_pristine;
-  const char *tmp_pristine_abspath;
-  const svn_checksum_t *sha1_checksum, *md5_checksum;
-
-  if (checksum-kind == svn_checksum_md5)
-{
-  md5_checksum = checksum;
-  SVN_ERR(svn_wc__db_pristine_get_sha1(sha1_checksum, db,
-   src_abspath, checksum,
-   scratch_pool,
-   scratch_pool));
-}
-  else
-{
-  sha1_checksum = checksum;
-  SVN_ERR(svn_wc__db_pristine_get_md5(md5_checksum, db,
-  src_abspath, checksum,
-  scratch_pool,
-  scratch_pool));
-}
-  SVN_ERR(svn_wc__db_pristine_read(src_pristine, db,
-   src_abspath, sha1_checksum,
-   scratch_pool, scratch_pool));
-  SVN_ERR(svn_stream_open_unique(tmp_pristine,
- tmp_pristine_abspath,
- tmpdir_abspath,
- svn_io_file_del_none,
- scratch_pool, scratch_pool));
-  SVN_ERR(svn_stream_copy3(src_pristine, tmp_pristine,
-   cancel_func, cancel_baton,
-   scratch_pool));
-  SVN_ERR(svn_wc__db_pristine_install(db, tmp_pristine_abspath,
-  sha1_checksum, md5_checksum,
-  scratch_pool));
+  md5_checksum = checksum;
+  

svn commit: r980461 - /subversion/trunk/subversion/tests/libsvn_client/client-test.c

2010-07-29 Thread philip
Author: philip
Date: Thu Jul 29 15:00:47 2010
New Revision: 980461

URL: http://svn.apache.org/viewvc?rev=980461view=rev
Log:
* subversion/tests/libsvn_client/client-test.c
  (test_wc_add_scanarios): Pass NULL for config when recreating context.

Modified:
subversion/trunk/subversion/tests/libsvn_client/client-test.c

Modified: subversion/trunk/subversion/tests/libsvn_client/client-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/client-test.c?rev=980461r1=980460r2=980461view=diff
==
--- subversion/trunk/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/client-test.c Thu Jul 29 
15:00:47 2010
@@ -476,7 +476,7 @@ test_wc_add_scenarios(const svn_test_opt
### remains open.  Closing the wc-context gets around the
### problem but is obviously a hack. */
 SVN_ERR(svn_wc_context_destroy(ctx-wc_ctx));
-SVN_ERR(svn_wc_context_create(ctx-wc_ctx, ctx-config, pool, pool));
+SVN_ERR(svn_wc_context_create(ctx-wc_ctx, NULL, pool, pool));
 
 /* Fix up copy as add with history */
 SVN_ERR(svn_wc_add3(new_dir_path, adm_access, svn_depth_infinity,




svn commit: r980465 - /subversion/trunk/subversion/tests/cmdline/export_tests.py

2010-07-29 Thread julianfoad
Author: julianfoad
Date: Thu Jul 29 15:11:03 2010
New Revision: 980465

URL: http://svn.apache.org/viewvc?rev=980465view=rev
Log:
Extend an export test to expose a bug in the case where a file is
locally replaced and we're exporting the base version.

* subversion/tests/cmdline/export_tests.py
  (export_working_copy_at_base_revision): Extend to cover all supported
combinations of file/dir modify/add/delete/replace.
  (test_list): Mark that test as XFail.

Modified:
subversion/trunk/subversion/tests/cmdline/export_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/export_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/export_tests.py?rev=980465r1=980464r2=980465view=diff
==
--- subversion/trunk/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/export_tests.py Thu Jul 29 
15:11:03 2010
@@ -268,20 +268,28 @@ def export_working_copy_at_base_revision
   wc_dir = sbox.wc_dir
 
   mu_path = os.path.join(wc_dir, 'A', 'mu')
+  C_path = os.path.join(wc_dir, 'A', 'C')
   kappa_path = os.path.join(wc_dir, 'kappa')
+  K_path = os.path.join(wc_dir, 'K')
   gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
   E_path = os.path.join(wc_dir, 'A', 'B', 'E')
+  rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
 
-  # Appends some text to A/mu, and add a new file
-  # called kappa.  These modifications should *not*
-  # get exported at the base revision.
+  # Make some local modifications: modify mu and C, add kappa and K, delete
+  # gamma and E, and replace rho.  (Directories can't yet be replaced.)
+  # These modifications should *not* get exported at the base revision.
   svntest.main.file_append(mu_path, 'Appended text')
+  svntest.main.run_svn(None, 'propset', 'p', 'v', mu_path, C_path)
   svntest.main.file_append(kappa_path, This is the file 'kappa'.)
   svntest.main.run_svn(None, 'add', kappa_path)
+  svntest.main.run_svn(None, 'mkdir', K_path)
   svntest.main.run_svn(None, 'rm', E_path, gamma_path)
+  svntest.main.run_svn(None, 'rm', rho_path)
+  svntest.main.file_append(rho_path, Replacement file 'rho'.)
+  svntest.main.run_svn(None, 'add', rho_path)
 
   # Note that we don't tweak the expected disk tree at all,
-  # since the appended text and kappa should not be present.
+  # since the modifications should not be present.
   expected_disk = svntest.main.greek_state.copy()
 
   export_target = sbox.add_wc_path('export')
@@ -527,7 +535,7 @@ test_list = [ None,
   export_eol_translation,
   export_working_copy_with_keyword_translation,
   export_working_copy_with_property_mods,
-  export_working_copy_at_base_revision,
+  XFail(export_working_copy_at_base_revision),
   export_native_eol_option,
   export_nonexistent_file,
   export_unversioned_file,




svn commit: r980470 - /subversion/trunk/subversion/libsvn_wc/copy.c

2010-07-29 Thread philip
Author: philip
Date: Thu Jul 29 15:25:46 2010
New Revision: 980470

URL: http://svn.apache.org/viewvc?rev=980470view=rev
Log:
* subversion/libsvn_wc/copy.c
  (copy_versioned_dir): Avoid using unitialised variable.

Found by: rhuijben

Modified:
subversion/trunk/subversion/libsvn_wc/copy.c

Modified: subversion/trunk/subversion/libsvn_wc/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/copy.c?rev=980470r1=980469r2=980470view=diff
==
--- subversion/trunk/subversion/libsvn_wc/copy.c (original)
+++ subversion/trunk/subversion/libsvn_wc/copy.c Thu Jul 29 15:25:46 2010
@@ -406,7 +406,7 @@ copy_versioned_dir(svn_wc__db_t *db,
   (*notify_func)(notify_baton, notify, scratch_pool);
 }
 
-  if (kind == svn_node_dir)
+  if (!metadata_only  kind == svn_node_dir)
 /* All children, versioned and unversioned.  We're only interested in the
names of the children, so we can pass TRUE as the only_check_type
param. */
@@ -451,12 +451,12 @@ copy_versioned_dir(svn_wc__db_t *db,
  svn_dirent_local_style(child_src_abspath,
 scratch_pool));
 
-  if (kind == svn_node_dir)
+  if (!metadata_only  kind == svn_node_dir)
 /* Remove versioned child as it has been handled */
 apr_hash_set(children, child_name, APR_HASH_KEY_STRING, NULL);
 }
 
-  if (kind == svn_node_dir  !metadata_only)
+  if (!metadata_only  kind == svn_node_dir)
 {
   /* All the remaining children are unversioned. */
   apr_hash_index_t *hi;




svn commit: r980477 - in /subversion/branches/issue-2779-dev/subversion: include/svn_wc.h libsvn_client/ra.c svn/notify.c

2010-07-29 Thread cmpilato
Author: cmpilato
Date: Thu Jul 29 15:41:00 2010
New Revision: 980477

URL: http://svn.apache.org/viewvc?rev=980477view=rev
Log:
On the 'issue-2779-dev' branch: Notify the client about followed
redirections.

* subversion/include/svn_wc.h
  (svn_wc_notify_action_t): Add 'svn_wc_notify_url_redirect' enum value.

* subversion/libsvn_client/ra.c
  (svn_client__open_ra_session_internal): Call the client's
notification function with notice of URL redirection.

* subversion/svn/notify.c
  (notify): Handle notifications of type svn_wc_notify_url_redirect.

Modified:
subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
subversion/branches/issue-2779-dev/subversion/libsvn_client/ra.c
subversion/branches/issue-2779-dev/subversion/svn/notify.c

Modified: subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/include/svn_wc.h?rev=980477r1=980476r2=980477view=diff
==
--- subversion/branches/issue-2779-dev/subversion/include/svn_wc.h (original)
+++ subversion/branches/issue-2779-dev/subversion/include/svn_wc.h Thu Jul 29 
15:41:00 2010
@@ -1086,6 +1086,11 @@ typedef enum svn_wc_notify_action_t
* @since New in 1.7. */
   svn_wc_notify_patch_hunk_already_applied,
 
+  /** The server has instructed the client to follow a URL
+   * redirection.
+   * @since New in 1.7. */
+  svn_wc_notify_url_redirect
+
 } svn_wc_notify_action_t;
 
 

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_client/ra.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_client/ra.c?rev=980477r1=980476r2=980477view=diff
==
--- subversion/branches/issue-2779-dev/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_client/ra.c Thu Jul 29 
15:41:00 2010
@@ -360,7 +360,14 @@ svn_client__open_ra_session_internal(svn
   if (! corrected)
 break;
 
-  /* ### TODO: Notify the user that a redirect is being followed. */
+  /* Notify the user that a redirect is being followed. */
+  if (ctx-notify_func2 != NULL)
+{
+  svn_wc_notify_t *notify = 
+svn_wc_create_notify_url(corrected, 
+ svn_wc_notify_url_redirect, pool);
+  (*ctx-notify_func2)(ctx-notify_baton2, notify, pool);
+}
 
   /* Our caller will want to know what our final corrected URL was. */
   *corrected_url = corrected;

Modified: subversion/branches/issue-2779-dev/subversion/svn/notify.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/svn/notify.c?rev=980477r1=980476r2=980477view=diff
==
--- subversion/branches/issue-2779-dev/subversion/svn/notify.c (original)
+++ subversion/branches/issue-2779-dev/subversion/svn/notify.c Thu Jul 29 
15:41:00 2010
@@ -792,6 +792,12 @@ notify(void *baton, const svn_wc_notify_
   goto print_error;
   break;
 
+case svn_wc_notify_url_redirect:
+  err = svn_cmdline_printf(pool, _(Redirecting to URL '%s'\n),
+   n-url);
+  if (err)
+goto print_error;
+
 default:
   break;
 }




svn commit: r980486 - /subversion/trunk/subversion/tests/cmdline/copy_tests.py

2010-07-29 Thread rhuijben
Author: rhuijben
Date: Thu Jul 29 15:53:14 2010
New Revision: 980486

URL: http://svn.apache.org/viewvc?rev=980486view=rev
Log:
Update another tests expected behavior for single-db: fixing copy_tests.py 46
move a moved dir back to original location for single-db.

* subversion/tests/cmdline/copy_tests.py
  (move_dir_back_and_forth): Assume this just works for single-db.

Modified:
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=980486r1=980485r2=980486view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Thu Jul 29 15:53:14 
2010
@@ -2461,16 +2461,18 @@ def move_dir_back_and_forth(sbox):
 
   # Move the moved dir: D_moved back to its starting
   # location at A/D.
-  exit_code, out, err = svntest.actions.run_and_verify_svn(
-None, None, svntest.verify.AnyOutput,
-'mv', D_move_path, D_path)
-
-  for line in err:
-if re.match('.*Cannot copy to .*as it is scheduled for deletion',
-line, ):
-  return
-  raise svntest.Failure(mv failed but not in the expected way)
 
+  if svntest.main.wc_is_singledb(wc_dir):
+# In single-db target is gone on-disk after it was moved away, so this
+# move works ok
+expected_err = []
+  else:
+# In !SINGLE_DB the target of the copy exists on-dir, so svn tries
+# to move the file below the deleted directory
+expected_err = '.*Cannot copy to .*as it is scheduled for deletion'
+
+  svntest.actions.run_and_verify_svn(None, None, expected_err,
+ 'mv', D_move_path, D_path)
 
 def copy_move_added_paths(sbox):
   copy and move added paths without commits




svn commit: r980497 - /subversion/trunk/subversion/tests/cmdline/export_tests.py

2010-07-29 Thread julianfoad
Author: julianfoad
Date: Thu Jul 29 16:15:46 2010
New Revision: 980497

URL: http://svn.apache.org/viewvc?rev=980497view=rev
Log:
Add an XFail test for exporting from a WC at depths less than infinity.

* subversion/tests/cmdline/export_tests.py
  (export_working_copy_with_depths): New test.
  (test_list): Add the new test as XFail.

Modified:
subversion/trunk/subversion/tests/cmdline/export_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/export_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/export_tests.py?rev=980497r1=980496r2=980497view=diff
==
--- subversion/trunk/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/export_tests.py Thu Jul 29 
16:15:46 2010
@@ -519,6 +519,37 @@ def export_with_url_unsafe_characters(sb
   if not os.path.exists(export_target):
 raise svntest.Failure(export did not fetch file with URL unsafe path)
 
+def export_working_copy_with_depths(sbox):
+  export working copy with different depths
+  sbox.build(read_only = True)
+
+  expected_disk = svntest.wc.State('', {
+  'A': Item(),
+  'iota': Item(contents=This is the file 'iota'.\n),
+  })
+  export_target = sbox.add_wc_path('immediates')
+  svntest.actions.run_and_verify_export(sbox.wc_dir,
+export_target,
+svntest.wc.State(sbox.wc_dir, {}),
+expected_disk,
+'--depth=immediates')
+
+  expected_disk.remove('A')
+  export_target = sbox.add_wc_path('files')
+  svntest.actions.run_and_verify_export(sbox.wc_dir,
+export_target,
+svntest.wc.State(sbox.wc_dir, {}),
+expected_disk,
+'--depth=files')
+
+  expected_disk.remove('iota')
+  export_target = sbox.add_wc_path('empty')
+  svntest.actions.run_and_verify_export(sbox.wc_dir,
+export_target,
+svntest.wc.State(sbox.wc_dir, {}),
+expected_disk,
+'--depth=empty')
+
 
 # Run the tests
 
@@ -546,6 +577,7 @@ test_list = [ None,
   export_ignoring_keyword_translation,
   export_working_copy_ignoring_keyword_translation,
   export_with_url_unsafe_characters,
+  XFail(export_working_copy_with_depths),
  ]
 
 if __name__ == '__main__':




svn commit: r980500 - /subversion/trunk/subversion/tests/cmdline/lock_tests.py

2010-07-29 Thread rhuijben
Author: rhuijben
Date: Thu Jul 29 16:31:34 2010
New Revision: 980500

URL: http://svn.apache.org/viewvc?rev=980500view=rev
Log:
Fix lock tests 23 lock/unlock switched files, 36 try to lock a file
twice in one working copy  and 39 test replace + propset of locked file
for single-db.

* subversion/tests/cmdline/lock_tests.py
  (lock_switched_files): Expect to see owned locks instead of missing locks.
  (lock_twice_in_one_wc): Committing with the lock in the single-db should
 succeed.
  (replace_and_propset_locked_path): Recreate directory before calling add
 on it.

Modified:
subversion/trunk/subversion/tests/cmdline/lock_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/lock_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/lock_tests.py?rev=980500r1=980499r2=980500view=diff
==
--- subversion/trunk/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/lock_tests.py Thu Jul 29 16:31:34 
2010
@@ -858,7 +858,15 @@ def lock_switched_files(sbox):
  gamma_path, lambda_path)
 
   expected_status.tweak('A/D/gamma', 'A/B/lambda', writelocked='K')
-  expected_status.tweak('A/B/E/alpha', 'iota', writelocked='O')
+
+  # In WC-NG locks are kept per working copy, not per file
+  if svntest.main.wc_is_singledb(wc_dir):
+# In single-db you see these files are locked locally
+expected_status.tweak('A/B/E/alpha', 'iota', writelocked='K')
+  else:
+# In multi-db you see these files are not locked in the right dir
+expected_status.tweak('A/B/E/alpha', 'iota', writelocked='O')
+
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
   svntest.actions.run_and_verify_svn(None, .*unlocked, [], 'unlock',
@@ -1428,9 +1436,15 @@ def lock_twice_in_one_wc(sbox):
   os.chmod(mu2_path, 0700)
   svntest.main.file_append(mu2_path, Updated text)
 
-  # Commit should fail because it is locked in the other location
-  svntest.actions.run_and_verify_svn(None, None,
- '.*(([Nn]o)|(Server)).*[lL]ock.*',
+  if svntest.main.wc_is_singledb(wc_dir):
+# Commit will just succeed as the DB owns the lock. It's a user decision
+# to commit the other target instead of the one originally locked
+expected_err = []
+  else:
+# Commit should fail because it is locked in the other location
+expected_err = '.*(([Nn]o)|(Server)).*[lL]ock.*'
+
+  svntest.actions.run_and_verify_svn(None, None, expected_err,
  'commit', mu2_path, '-m', '')
 
 #--
@@ -1543,6 +1557,9 @@ def replace_and_propset_locked_path(sbox
   # Replace A/D/G and A/D/G/rho, propset on A/D/G/rho.
   svntest.actions.run_and_verify_svn(None, None, [],
  'rm', G_path)
+  # Recreate path for single-db
+  if not os.path.exists(G_path):
+os.mkdir(G_path)
   svntest.actions.run_and_verify_svn(None, None, [],
  'add', G_path)
   svntest.main.file_append(rho_path, This is the new file 'rho'.\n)




svn commit: r980547 - in /subversion/trunk/subversion/svnrdump: dumpfile_parser.c load_editor.c load_editor.h svnrdump.c

2010-07-29 Thread artagnon
Author: artagnon
Date: Thu Jul 29 19:30:39 2010
New Revision: 980547

URL: http://svn.apache.org/viewvc?rev=980547view=rev
Log:
svnrdump: Redesign the API and workflow to use for loading

Get a generalized commit editor along with related data, and then
drive it with using the callback parser functions that get fired while
parsing the diff using svn_repos_parse_dumpstream.

* subversion/svnrdump/dumpfile_parser.c

  (new_revision_record, uuid_record, new_node_record,
  set_revision_property, set_node_property, delete_node_property,
  remove_node_props, set_fulltext, apply_textdelta, close_node,
  close_revision): Add new no-op functions to set in the
  svn_repos_parse_fns2_t.

  (new_revision_record, new_node_record): Add a small debugging aid:
  when these functions are called, print a message to stderr to
  indicate parsing progress.

  (apply_txdelta): Do just enough to perform like a no-op without
  crashing: set the handler/ handler_baton,

  (apply_window): Add some WIP code inside an #if 0 block and another
  no-op one outside. This is used by apply_textdelta to set the
  svn_txdelta_window_handler_t.

  (build_dumpfile_parser): Fill in information about the new callback
  functions into the svn_repos_parse_fns2_t. Do some memory
  allocations for various batons. This is still a heavy WIP, as most
  of the information in the batons isn't used. Also, don't actually
  call svn_repos_parse_dumpstream2; this function only builds the
  parser to use. Related to this, change the API to exclude the stream
  argument.

* subversion/svnrdump/load_editor.c

  (drive_load_editor): Change API to take the editor/ edit_baton (to
  be fetched from get_load_editor) and stream to use with the
  dumpstream parser. Also add calls to build_dumpfile_parser and
  svn_repos_parse_dumpstream2 appropriately.

  (get_load_editor): Change the API to remove stream. The commit
  editor needs to know nothing about the stream from which the
  dumpfile will be parsed. Setup necessary batons and do the
  appropriate memory allocations to actually make a successful call to
  svn_ra_get_commit_editor3. Set the various arguments to return
  appropriately.

* subversion/svnrdump/load_editor.h

  (apply_baton): New baton to be used by txdelta applier.

  (parse_baton): New baton to be used by some of the parse functions,
  mainly to fetch data to put into other more specific batons.

  (node_baton, revision_baton): Two new batons to be used by various
  parse functions.

  (commit_dir_baton): The directory baton to be used by the load
  editor; taken from commit.c. ### It looks very similar to the
  directory baton we use in dump_editor: can we use the same baton?

  (build_dumpfile_parser, drive_load_editor, get_load_editor): Track
  API changes.

* subversion/svnrdump/svnrdump.c

  (load_revisions): Track the API and workflow changes.

Modified:
subversion/trunk/subversion/svnrdump/dumpfile_parser.c
subversion/trunk/subversion/svnrdump/load_editor.c
subversion/trunk/subversion/svnrdump/load_editor.h
subversion/trunk/subversion/svnrdump/svnrdump.c

Modified: subversion/trunk/subversion/svnrdump/dumpfile_parser.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dumpfile_parser.c?rev=980547r1=980546r2=980547view=diff
==
--- subversion/trunk/subversion/svnrdump/dumpfile_parser.c (original)
+++ subversion/trunk/subversion/svnrdump/dumpfile_parser.c Thu Jul 29 19:30:39 
2010
@@ -6,21 +6,160 @@
 
 #include load_editor.h
 
+static svn_error_t *
+new_revision_record(void **revision_baton,
+   apr_hash_t *headers,
+   void *parse_baton,
+   apr_pool_t *pool)
+{
+  struct revision_baton *rb;
+  rb = apr_pcalloc(pool, sizeof(*rb));
+  rb-pb = parse_baton;
+
+  fprintf(stderr, new_revision_record called\n);
+
+  *revision_baton = rb;
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+uuid_record(const char *uuid,
+void *parse_baton,
+apr_pool_t *pool)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+new_node_record(void **node_baton,
+apr_hash_t *headers,
+void *revision_baton,
+apr_pool_t *pool)
+{
+  struct node_baton *nb;
+  nb = apr_pcalloc(pool, sizeof(*nb));
+  nb-rb = revision_baton;
+
+  fprintf(stderr, new_node_record called\n);
+
+  *node_baton = nb;
+  return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+set_revision_property(void *baton,
+  const char *name,
+  const svn_string_t *value)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+set_node_property(void *baton,
+  const char *name,
+  const svn_string_t *value)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+delete_node_property(void *baton,
+ const char *name)
+{
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+remove_node_props(void 

svn commit: r980551 [10/10] - in /subversion/branches/issue-2779-dev: ./ build/generator/ notes/tree-conflicts/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/

2010-07-29 Thread cmpilato
Modified: 
subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py?rev=980551r1=980550r2=980551view=diff
==
--- subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py 
(original)
+++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py 
Thu Jul 29 19:38:44 2010
@@ -805,35 +805,92 @@ def bad_intermediate_urls(sbox):
   bad intermediate urls in use
   sbox.build()
   wc_dir = sbox.wc_dir
+  url = sbox.repo_url
+
+  A = os.path.join(wc_dir, 'A')
+  A_Z = os.path.join(wc_dir, 'A', 'Z')
+  url_A_C = url + '/A/C'
+  url_A_C_A = url + '/A/C/A'
+  url_A_C_A_Z = url + '/A/C/A/Z'
 
   # We'll be switching our working copy to (a modified) A/C in the Greek tree.
 
   # First, make an extra subdirectory in C to match one in the root, plus
   # another one inside of that.
-  C_url = sbox.repo_url + '/A/C'
-  C_A_url = sbox.repo_url + '/A/C/A'
-  C_A_Z_url = sbox.repo_url + '/A/C/A/Z'
   svntest.actions.run_and_verify_svn(None,
  ['\n', 'Committed revision 2.\n'], [],
  'mkdir', '-m', 'log msg',
- C_A_url, C_A_Z_url)
+ url_A_C_A, url_A_C_A_Z)
 
   # Now, we'll drop a conflicting path under the root.
-  A_path = os.path.join(wc_dir, 'A')
-  A_Z_path = os.path.join(A_path, 'Z')
-  svntest.main.file_append(A_Z_path, 'Look, Mom, no ... switch success.')
+  svntest.main.file_append(A_Z, 'Look, Mom, a ... tree conflict.')
+
+  #svntest.factory.make(sbox, 
+  #  svn switch url/A/C wc_dir
+  #  # svn info A
+  #  # check that we can recover from the tree conflict
+  #  rm A/Z
+  #  svn up
+  #  )
+  #exit(0)
+
+  # svn switch url/A/C wc_dir
+  expected_output = svntest.wc.State(wc_dir, {
+'A/mu'  : Item(status='D '),
+'A/Z'   : Item(status='  ', treeconflict='C'),
+'A/C'   : Item(status='D '),
+'A/B'   : Item(status='D '),
+'A/D'   : Item(status='D '),
+'iota'  : Item(status='D '),
+  })
 
-  # This switch should fail for reasons of obstruction.
-  exit_code, out, err = svntest.main.run_svn(1, 'switch',
- C_url, wc_dir)
-  if not err:
-raise svntest.Failure
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.remove('iota', 'A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha',
+'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi',
+'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi',
+'A/D/gamma', 'A/mu', 'A/C')
+  expected_disk.add({
+'A/Z'   : Item(contents=Look, Mom, a ... tree conflict.),
+  })
 
-  # However, the URL for A should now reflect A/C/A, not something else.
+  expected_status = actions.get_virginal_state(wc_dir, 2)
+  expected_status.remove('iota', 'A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha',
+'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi',
+'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi',
+'A/D/gamma', 'A/mu', 'A/C')
+  expected_status.add({
+'A/Z'   : Item(status='? ', treeconflict='C'),
+  })
+
+  actions.run_and_verify_switch(wc_dir, wc_dir, url_A_C, expected_output,
+expected_disk, expected_status, None, None, None, None, None, False)
+
+  
+  # However, the URL for wc/A should now reflect ^/A/C/A, not something else.
   expected_infos = [
   { 'URL' : '.*/A/C/A$' },
 ]
-  svntest.actions.run_and_verify_info(expected_infos, A_path)
+  svntest.actions.run_and_verify_info(expected_infos, A)
+
+
+  # check that we can recover from the tree conflict
+  # rm A/Z
+  os.remove(A_Z)
+
+  # svn up
+  expected_output = svntest.wc.State(wc_dir, {
+'A/Z'   : Item(status='A '),
+  })
+
+  expected_disk.tweak('A/Z', contents=None)
+
+  expected_status.tweak(status='  ', wc_rev='2')
+  expected_status.tweak('A/Z', treeconflict=None)
+
+  actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
+expected_status, None, None, None, None, None, False, wc_dir)
+
+
 
 
 #--
@@ -1283,40 +1340,40 @@ def forced_switch_failures(sbox):
   #
   ## Add a directory to obstruct a file.
   #mkdir A/B/F/pi
-  #
+  #  
   ## Add a file to obstruct a directory.
   #echo The file 'H'  A/C/H
-  #
+  #  
   ## Test three cases where forced switch should cause a tree conflict
-  #
+  #  
   ## 1) A forced switch that tries to add a file when an unversioned
   ##directory of the same name already exists.  (Currently fails)
   #svn switch --force url/A/D A/C
-  #
+  #  
   ## 2) A forced switch that tries to add a dir when a file of the same
   ##

svn commit: r980569 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/patch.c svn/notify.c

2010-07-29 Thread dannas
Author: dannas
Date: Thu Jul 29 20:59:08 2010
New Revision: 980569

URL: http://svn.apache.org/viewvc?rev=980569view=rev
Log:
Show the property name when printing property hunk notifications.

At the same time use '##' in the property hunk headers for already 
applied hunks.

The notifications will be on this form:
  '## -1,6 +1,7 ## (svn:executable)'

* subversion/svn/notify.c
  (notify): Add prop_name to the output for property hunks. 

* subversion/include/svn_wc.h
  (svn_wc_notify_t): Remove 'is_prop_hunk' field.

* subversion/libsvn_client/patch.c
  (send_patch_notification): Set the prop_name for property hunk 
notifications.

Suggested by: stsp

Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/svn/notify.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=980569r1=980568r2=980569view=diff
==
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Thu Jul 29 20:59:08 2010
@@ -1266,10 +1266,6 @@ typedef struct svn_wc_notify_t {
* @since New in 1.7 */
   int hunk_fuzz;
 
-  /** If @c action relates to hunks, specifies whether the hunk is a
-   * property hunk or not. */
-  svn_boolean_t is_prop_hunk;
-
   /* NOTE: Add new fields at the end to preserve binary compatibility.
  Also, if you add fields here, you have to update svn_wc_create_notify
  and svn_wc_dup_notify. */

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=980569r1=980568r2=980569view=diff
==
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Thu Jul 29 20:59:08 2010
@@ -1519,8 +1519,7 @@ send_patch_notification(const patch_targ
 svn_diff_hunk_get_modified_length(hi-hunk);
   notify-hunk_matched_line = hi-matched_line;
   notify-hunk_fuzz = hi-fuzz;
-  /* ### Should is_prop_hunk be a field in hunk_info_t? */
-  notify-is_prop_hunk = FALSE;
+  notify-prop_name = NULL;
 
   (*ctx-notify_func2)(ctx-notify_baton2, notify, pool);
 }
@@ -1563,8 +1562,7 @@ send_patch_notification(const patch_targ
 svn_diff_hunk_get_modified_length(hi-hunk);
   notify-hunk_matched_line = hi-matched_line;
   notify-hunk_fuzz = hi-fuzz;
-  /* ### Should is_prop_hunk be a field in hunk_info_t? */
-  notify-is_prop_hunk = TRUE;
+  notify-prop_name = apr_pstrdup(pool, prop_target-name);
 
   (*ctx-notify_func2)(ctx-notify_baton2, notify, pool);
 }

Modified: subversion/trunk/subversion/svn/notify.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=980569r1=980568r2=980569view=diff
==
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Thu Jul 29 20:59:08 2010
@@ -310,60 +310,96 @@ notify(void *baton, const svn_wc_notify_
   minus = -;
 }
 
-  /* ### APR_INT64_T_FMT isn't translator-friendly */
+  /* ### We're creating the localized strings without
+   * ### APR_INT64_T_FMT since it isn't translator-friendly */
   if (n-hunk_fuzz)
 {
-  if (n-is_prop_hunk)
-s = _( applied hunk ## -%lu,%lu +%lu,%lu ## 
-  with offset %s);
+
+  if (n-prop_name)
+{
+  s = _( applied hunk ## -%lu,%lu +%lu,%lu ## 
+with offset %s);
+
+  err = svn_cmdline_printf(pool,
+   apr_pstrcat(pool, s,
+   %APR_UINT64_T_FMT
+and fuzz %d (%s)\n,
+   NULL),
+   n-hunk_original_start,
+   n-hunk_original_length,
+   n-hunk_modified_start,
+   n-hunk_modified_length,
+   minus, off, n-hunk_fuzz,
+   n-prop_name);
+}
   else
-s = _( applied hunk @@ -%lu,%lu +%lu,%lu @@ 
-  with offset %s);
+{
+  s = _( applied hunk @@ -%lu,%lu +%lu,%lu @@ 
+with 

svn commit: r980602 - /subversion/trunk/subversion/libsvn_wc/adm_crawler.c

2010-07-29 Thread rhuijben
Author: rhuijben
Date: Thu Jul 29 22:52:14 2010
New Revision: 980602

URL: http://svn.apache.org/viewvc?rev=980602view=rev
Log:
Following up on r920592 and r980069, fix the missing calculations in
the working copy crawler. These regression were in most cases invisible
from our test suite because the wc-database reported these cases as
obstructions. In single-db mode this is no longer the case, so the
problems started to show up.

* subversion/libsvn_wc/adm_crawler.c
  (report_revisions_and_depths): Only report a node as missing if we miss
the administrative area or if it is impossible to restore this node.
In single-db mode never report nodes as missing.
  (svn_wc_crawl_revisions5): Re-enable missing detection. Move code before
the actual reporting to allow easier error handling. Use equivalent
test as used in report_revisions_and_depths.

Modified:
subversion/trunk/subversion/libsvn_wc/adm_crawler.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=980602r1=980601r2=980602view=diff
==
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Thu Jul 29 22:52:14 2010
@@ -419,14 +419,19 @@ report_revisions_and_depths(svn_wc__db_t
  db, this_abspath,
  iterpool, iterpool));
 
-  if (restore_files
-   wrk_status != svn_wc__db_status_added
 #ifndef SVN_WC__SINGLE_DB
-   wrk_status != svn_wc__db_status_obstructed_add
-   wrk_status != svn_wc__db_status_obstructed_delete
+  if (wrk_status == svn_wc__db_status_obstructed
+  || wrk_status == svn_wc__db_status_obstructed_add
+  || wrk_status == svn_wc__db_status_obstructed_delete)
+missing = TRUE;
+  else
 #endif
-   wrk_status != svn_wc__db_status_deleted)
-  
+  if (restore_files
+   wrk_status != svn_wc__db_status_added
+   wrk_status != svn_wc__db_status_deleted
+   wrk_status != svn_wc__db_status_excluded
+   wrk_status != svn_wc__db_status_not_present
+   wrk_status != svn_wc__db_status_absent)
 {
   svn_node_kind_t dirent_kind;
 
@@ -448,9 +453,6 @@ report_revisions_and_depths(svn_wc__db_t
 }
 }
 #ifndef SVN_WC__SINGLE_DB
-  else
-missing = TRUE;
-
   /* If a node is still missing from disk here, we have no way to
  recreate it locally, so report as missing and move along.
  Again, don't bother if we're reporting everything, because the
@@ -761,6 +763,7 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   const char *repos_relpath=NULL, *repos_root=NULL;
   svn_depth_t target_depth = svn_depth_unknown;
   svn_wc__db_lock_t *target_lock = NULL;
+  svn_node_kind_t disk_kind;
   svn_boolean_t explicit_rev;
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
@@ -888,45 +891,69 @@ svn_wc_crawl_revisions5(svn_wc_context_t
   if (target_depth == svn_depth_unknown)
 target_depth = svn_depth_infinity;
 
-  /* The first call to the reporter merely informs it that the
- top-level directory being updated is at BASE_REV.  Its PATH
- argument is ignored. */
-  SVN_ERR(reporter-set_path(report_baton, , target_rev, target_depth,
- start_empty, NULL, scratch_pool));
+  SVN_ERR(svn_io_check_path(local_abspath, disk_kind, scratch_pool));
 
-  /* ### status can NEVER be deleted. should examine why this was
- ### ever here. we may have remapped into wc-ng incorrectly.  */
-  if (status != svn_wc__db_status_deleted)
+  /* Determine if there is a missing node that should be restored */
+  if (disk_kind == svn_node_none)
 {
-  apr_finfo_t info;
-  err = svn_io_stat(info, local_abspath, APR_FINFO_MIN, scratch_pool);
-  if (err)
+  svn_wc__db_status_t wrk_status;
+  err = svn_wc__db_read_info(wrk_status, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ db, local_abspath,
+ scratch_pool, scratch_pool);
+
+
+  if (err  err-apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
 {
-  if (APR_STATUS_IS_ENOENT(err-apr_err))
-missing = TRUE;
   svn_error_clear(err);
-  err = NULL;
+  wrk_status = svn_wc__db_status_not_present;
 }
-}
+  else
+SVN_ERR(err);
 
-  if (missing  restore_files)
-{
-  svn_boolean_t restored;
+  if (wrk_status == svn_wc__db_status_added)

svn commit: r980612 - /subversion/branches/issue-2779-dev/subversion/include/svn_ra.h

2010-07-29 Thread cmpilato
Author: cmpilato
Date: Fri Jul 30 00:30:01 2010
New Revision: 980612

URL: http://svn.apache.org/viewvc?rev=980612view=rev
Log:
On the 'issue-2779-dev' branch:  Fix some header comments.

* subversion/include/svn_ra.h
  s/svn_ra_open3/svn_ra_open4/ where relevant.

Modified:
subversion/branches/issue-2779-dev/subversion/include/svn_ra.h

Modified: subversion/branches/issue-2779-dev/subversion/include/svn_ra.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/include/svn_ra.h?rev=980612r1=980611r2=980612view=diff
==
--- subversion/branches/issue-2779-dev/subversion/include/svn_ra.h (original)
+++ subversion/branches/issue-2779-dev/subversion/include/svn_ra.h Fri Jul 30 
00:30:01 2010
@@ -65,7 +65,7 @@ svn_ra_version(void);
  * @a close_baton as appropriate.
  *
  * @a path is relative to the root of the session, defined by the
- * @a repos_URL passed to svn_ra_open3() vtable call.
+ * @a repos_URL passed to svn_ra_open4() vtable call.
  *
  * @a name is the name of the property to fetch. If the property is present,
  * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
@@ -294,7 +294,7 @@ typedef struct svn_ra_reporter3_t
* implementor should assume the directory has no entries or props.
*
* This will *override* any previous set_path() calls made on parent
-   * paths.  @a path is relative to the URL specified in svn_ra_open3().
+   * paths.  @a path is relative to the URL specified in svn_ra_open4().
*
* If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
*
@@ -445,7 +445,7 @@ typedef struct svn_ra_reporter_t
 /** A collection of callbacks implemented by libsvn_client which allows
  * an RA layer to pull information from the client application, or
  * possibly store information.  libsvn_client passes this vtable to
- * svn_ra_open3().
+ * svn_ra_open4().
  *
  * Each routine takes a @a callback_baton originally provided with the
  * vtable.




svn commit: r980617 - /subversion/branches/issue-2779-dev/subversion/libsvn_ra/deprecated.c

2010-07-29 Thread cmpilato
Author: cmpilato
Date: Fri Jul 30 00:37:34 2010
New Revision: 980617

URL: http://svn.apache.org/viewvc?rev=980617view=rev
Log:
On the 'issue-2779-dev' branch: Uh, do what the docstring says you'll do?

* subversion/libsvn_ra/deprecated.c
  (svn_ra_open3): Just pass NULL to svn_ra_open4()'s 'corrected_url'
parameter and return.

Modified:
subversion/branches/issue-2779-dev/subversion/libsvn_ra/deprecated.c

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra/deprecated.c?rev=980617r1=980616r2=980617view=diff
==
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra/deprecated.c 
(original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra/deprecated.c Fri 
Jul 30 00:37:34 2010
@@ -157,16 +157,8 @@ svn_error_t *svn_ra_open3(svn_ra_session
   apr_hash_t *config,
   apr_pool_t *pool)
 {
-  const char *corrected_url;
-
-  SVN_ERR(svn_ra_open4(session_p, corrected_url, repos_URL, uuid,
-   callbacks, callback_baton, config, pool));
-  if (corrected_url)
-return svn_error_createf(SVN_ERR_RA_SESSION_URL_MISMATCH, NULL,
- _(The repository has been moved to '%s'; 
-   consider relocating.), corrected_url);
-
-  return SVN_NO_ERROR;
+  return svn_ra_open4(session_p, NULL, repos_URL, uuid,
+  callbacks, callback_baton, config, pool);
 }
 
 svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,





svn commit: r980620 - in /subversion/branches/issue-2779-dev: ./ subversion/include/ subversion/libsvn_client/ subversion/libsvn_wc/ subversion/svn/ subversion/svnrdump/

2010-07-29 Thread cmpilato
Author: cmpilato
Date: Fri Jul 30 00:43:02 2010
New Revision: 980620

URL: http://svn.apache.org/viewvc?rev=980620view=rev
Log:
Sync with trunk changes. (Merged /subversion/trunk:r980543-980617)

Modified:
subversion/branches/issue-2779-dev/   (props changed)
subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c
subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c
subversion/branches/issue-2779-dev/subversion/svn/notify.c
subversion/branches/issue-2779-dev/subversion/svnrdump/dumpfile_parser.c
subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.c
subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.h
subversion/branches/issue-2779-dev/subversion/svnrdump/svnrdump.c

Propchange: subversion/branches/issue-2779-dev/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 30 00:43:02 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-980542
+/subversion/trunk:965496-980617

Modified: subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/include/svn_wc.h?rev=980620r1=980619r2=980620view=diff
==
--- subversion/branches/issue-2779-dev/subversion/include/svn_wc.h (original)
+++ subversion/branches/issue-2779-dev/subversion/include/svn_wc.h Fri Jul 30 
00:43:02 2010
@@ -1271,10 +1271,6 @@ typedef struct svn_wc_notify_t {
* @since New in 1.7 */
   int hunk_fuzz;
 
-  /** If @c action relates to hunks, specifies whether the hunk is a
-   * property hunk or not. */
-  svn_boolean_t is_prop_hunk;
-
   /* NOTE: Add new fields at the end to preserve binary compatibility.
  Also, if you add fields here, you have to update svn_wc_create_notify
  and svn_wc_dup_notify. */

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c?rev=980620r1=980619r2=980620view=diff
==
--- subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c 
(original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_client/patch.c Fri Jul 
30 00:43:02 2010
@@ -1519,8 +1519,7 @@ send_patch_notification(const patch_targ
 svn_diff_hunk_get_modified_length(hi-hunk);
   notify-hunk_matched_line = hi-matched_line;
   notify-hunk_fuzz = hi-fuzz;
-  /* ### Should is_prop_hunk be a field in hunk_info_t? */
-  notify-is_prop_hunk = FALSE;
+  notify-prop_name = NULL;
 
   (*ctx-notify_func2)(ctx-notify_baton2, notify, pool);
 }
@@ -1563,8 +1562,7 @@ send_patch_notification(const patch_targ
 svn_diff_hunk_get_modified_length(hi-hunk);
   notify-hunk_matched_line = hi-matched_line;
   notify-hunk_fuzz = hi-fuzz;
-  /* ### Should is_prop_hunk be a field in hunk_info_t? */
-  notify-is_prop_hunk = TRUE;
+  notify-prop_name = apr_pstrdup(pool, prop_target-name);
 
   (*ctx-notify_func2)(ctx-notify_baton2, notify, pool);
 }

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c?rev=980620r1=980619r2=980620view=diff
==
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c 
(original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c Fri 
Jul 30 00:43:02 2010
@@ -419,14 +419,19 @@ report_revisions_and_depths(svn_wc__db_t
  db, this_abspath,
  iterpool, iterpool));
 
-  if (restore_files
-   wrk_status != svn_wc__db_status_added
 #ifndef SVN_WC__SINGLE_DB
-   wrk_status != svn_wc__db_status_obstructed_add
-   wrk_status != svn_wc__db_status_obstructed_delete
+  if (wrk_status == svn_wc__db_status_obstructed
+  || wrk_status == svn_wc__db_status_obstructed_add
+  || wrk_status == svn_wc__db_status_obstructed_delete)
+missing = TRUE;
+  else
 #endif
-   wrk_status != svn_wc__db_status_deleted)
-  
+  if (restore_files
+   wrk_status != svn_wc__db_status_added
+   wrk_status != svn_wc__db_status_deleted
+   wrk_status !=