svn commit: r1084335 - in /subversion/trunk/subversion: svnsync/ tests/cmdline/ tests/cmdline/svnrdump_tests_data/ tests/cmdline/svnsync_tests_data/

2011-03-22 Thread cmpilato
Author: cmpilato
Date: Tue Mar 22 20:08:57 2011
New Revision: 1084335

URL: http://svn.apache.org/viewvc?rev=1084335&view=rev
Log:
Add a command line option (--source-prop-encoding) to the svnsync
init, sync, and copy-revprops subcommands that allows the user to
specify the character encoding of translatable properties from the
source repository. This is needed to allow svnsync to sync some older
Subversion repositories that have properties that were not encoded in
UTF-8.

As discussed at:

  http://thread.gmane.org/gmane.comp.version-control.subversion.user/100020
Message-ID: loom.20100909t000542...@post.gmane.org
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/122518
Message-ID: aanlktimyfxpkos9okcd3tv8tdjznhb6y0awbxnt+r...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/122550
Message-ID: aanlktik11jljxnnqgbunzwenyjj5_yutut0wksbey...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/124731
Message-ID: aanlktikjd3bwbigqwkjdeakub49-wjawszj8iyzae...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/125057
Message-ID: aanlktin48eyejig4tyvptovelygr1rfxk-_tkjhwo...@mail.gmail.com
  http://thread.gmane.org/gmane.comp.version-control.subversion.devel/125783
Message-ID: AANLkTimjj48xt4s=zOqC6GxoPPEdLpfSB9YmBY=7b...@mail.gmail.com

Most of the work is just to pass the value of the --source-prop-encoding
option through to the functions that need it, the foremost of which is
subversion/svnsync/sync.c:normalize_string().

* subversion/svnsync/main.c
  (svnsync__opt) Add svnsync_opt_source_encoding.
  (svnsync_cmd_table): Add svnsync_opt_source_encoding to the list of
acceptable options for the init, sync, and copy-revprops subcommands.
  (svnsync_options): Add a description of the --source-prop-encoding option.
  (opt_baton_t, subcommand_baton_t): Add the SOURCE_PROP_ENCODING field.
  (copy_revprops): Add the SOURCE_PROP_ENCODING parameter.  Pass it
through to svnsync_normalize_revprops().
  (make_subcommand_baton): Set the SOURCE_PROP_ENCODING field of the
resulting subcommand_baton_t object to the value of
SOURCE_PROP_ENCODING from the opt_baton_t object.
  (do_initialize, do_synchronize, do_copy_revprops,
   replay_rev_started, replay_rev_finished): Pass SOURCE_PROP_ENCODING
to svnsync_* functions and copy_revprops().
  (main): Handle the case when the command line option is
--source-prop-encoding. Set the SOURCE_PROP_ENCODING field of the
opt_baton_t object to either OPT_ARG or NULL.

* subversion/svnsync/sync.c
  (normalize_string): Add the SOURCE_PROP_ENCODING parameter.  Always
call svn_subst_translate_string2().  Switch to the "two pools"
(result/scratch) pattern.
  (svnsync_normalize_revprops): Add the SOURCE_PROP_ENCODING
parameter.  Pass the value through to normalize_string().
  (edit_baton_t): Add the SOURCE_PROP_ENCODING field.
  (change_file_prop, change_dir_prop): Pass SOURCE_PROP_ENCODING from
the edit baton to normalize_string().
  (svnsync_get_sync_editor): Add the SOURCE_PROP_ENCODING parameter.

* subversion/svnsync/sync.h
  (svnsync_normalize_revprops): Add the SOURCE_PROP_ENCODING
parameter. Update the documentation of the function.
  (svnsync_get_sync_editor): Add the SOURCE_PROP_ENCODING
parameter. Update the documentation of the function.

* subversion/tests/cmdline/svnrdump_tests.py
  (copy_bad_line_endings2_dump): New test case.
  (test_list): Add copy_bad_line_endings2_dump.

* subversion/tests/cmdline/svnsync_tests.py
  (run_sync): Add the SOURCE_PROP_ENCODING parameter. Build up the
command line arguments to `svnsync synchronize`.
  (run_copy_revprops): Add the SOURCE_PROP_ENCODING parameter. Build
up the command line arguments to `svnsync copy-revprops`.
  (run_init): Add the SOURCE_PROP_ENCODING parameter. Build up the
command line arguments to `svnsync initialize`.
  (setup_and_sync): Add the SOURCE_PROP_ENCODING parameter. Pass the
value through to run_init(), run_sync(), and run_copy_revprops().
  (run_test): Add the SOURCE_PROP_ENCODING parameter. Pass the value
through to setup_and_sync().
  (copy_bad_line_endings2, copy_bad_encoding, identity_copy): New test
cases.
  (test_list): Add reference to new test cases.

* subversion/tests/cmdline/svnrdump_tests_data/copy-bad-line-endings2.dump,
* 
subversion/tests/cmdline/svnrdump_tests_data/copy-bad-line-endings2.expected.dump,
* subversion/tests/cmdline/svnsync_tests_data/copy-bad-encoding.dump,
* subversion/tests/cmdline/svnsync_tests_data/copy-bad-encoding.expected.dump,
* subversion/tests/cmdline/svnsync_tests_data/copy-bad-line-endings2.dump,
* 
subversion/tests/cmdline/svnsync_tests_data/copy-bad-line-endings2.expected.dump
  Data files for new tests.

Patch by: Danny Trebbien 

Added:

subversion/trunk/subversion/tests/cmdline/svnrdump_tests_data/copy-bad-line-endings2.dump

subversion/trunk/su

svn commit: r1084330 - /subversion/trunk/subversion/svnsync/main.c

2011-03-22 Thread cmpilato
Author: cmpilato
Date: Tue Mar 22 20:00:22 2011
New Revision: 1084330

URL: http://svn.apache.org/viewvc?rev=1084330&view=rev
Log:
* subversion/tests/svnsync/main.c
  (copy_revprops): Document the 'quiet' parameter.

Patch by: Danny Trebbien 


Modified:
subversion/trunk/subversion/svnsync/main.c

Modified: subversion/trunk/subversion/svnsync/main.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/main.c?rev=1084330&r1=1084329&r2=1084330&view=diff
==
--- subversion/trunk/subversion/svnsync/main.c (original)
+++ subversion/trunk/subversion/svnsync/main.c Tue Mar 22 20:00:22 2011
@@ -614,6 +614,9 @@ log_properties_normalized(int normalized
  * If SYNC is TRUE, then properties on the destination revision that
  * do not exist on the source revision will be removed.
  *
+ * If QUIET is FALSE, then log_properties_copied() is called to log that
+ * properties were copied for revision REV.
+ *
  * Make sure the values of svn:* revision properties use only LF (\n)
  * lineending style, correcting their values as necessary. The number
  * of properties that were normalized is returned in *NORMALIZED_COUNT.




svn commit: r1084312 - /subversion/trunk/subversion/libsvn_client/patch.c

2011-03-22 Thread dannas
Author: dannas
Date: Tue Mar 22 19:34:36 2011
New Revision: 1084312

URL: http://svn.apache.org/viewvc?rev=1084312&view=rev
Log:
Remove a tiny bit of code duplication.

* subversion/libsvn_client/patch.c
  (reject_hunk): Print the hunk headers in one statement and use
variables for what varies.

Suggested by: stsp

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

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1084312&r1=1084311&r2=1084312&view=diff
==
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Tue Mar 22 19:34:36 2011
@@ -1308,6 +1308,9 @@ reject_hunk(patch_target_t *target, targ
   const char *hunk_header;
   apr_size_t len;
   svn_boolean_t eof;
+  static const char * const text_atat = "@@";
+  static const char * const prop_atat = "##";
+  const char *atat;
   apr_pool_t *iterpool;
 
   if (prop_name)
@@ -1320,23 +1323,21 @@ reject_hunk(patch_target_t *target, targ
   len = strlen(prop_header);
 
   SVN_ERR(svn_stream_write(content_info->reject, prop_header, &len));
-
-  /* ### What about just setting a variable to either "@@" or "##",
-   * ### and merging with the else clause below? */
-  hunk_header = apr_psprintf(pool, "## -%lu,%lu +%lu,%lu ##%s",
- svn_diff_hunk_get_original_start(hunk),
- svn_diff_hunk_get_original_length(hunk),
- svn_diff_hunk_get_modified_start(hunk),
- svn_diff_hunk_get_modified_length(hunk),
- APR_EOL_STR);
+  atat = prop_atat;
 }
   else
-hunk_header = apr_psprintf(pool, "@@ -%lu,%lu +%lu,%lu @@%s",
-   svn_diff_hunk_get_original_start(hunk),
-   svn_diff_hunk_get_original_length(hunk),
-   svn_diff_hunk_get_modified_start(hunk),
-   svn_diff_hunk_get_modified_length(hunk),
-   APR_EOL_STR);
+{
+  atat = text_atat;
+}
+
+  hunk_header = apr_psprintf(pool, "%s -%lu,%lu +%lu,%lu %s%s",
+ atat,
+ svn_diff_hunk_get_original_start(hunk),
+ svn_diff_hunk_get_original_length(hunk),
+ svn_diff_hunk_get_modified_start(hunk),
+ svn_diff_hunk_get_modified_length(hunk),
+ atat,
+ APR_EOL_STR);
   len = strlen(hunk_header);
   SVN_ERR(svn_stream_write(content_info->reject, hunk_header, &len));
 




svn commit: r1084284 - /subversion/trunk/subversion/tests/cmdline/svnsync_tests.py

2011-03-22 Thread cmpilato
Author: cmpilato
Date: Tue Mar 22 18:29:15 2011
New Revision: 1084284

URL: http://svn.apache.org/viewvc?rev=1084284&view=rev
Log:
* subversion/tests/cmdline/svnsync_tests.py
  (delete_svn_props): Docstring tweak only.

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

Modified: subversion/trunk/subversion/tests/cmdline/svnsync_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnsync_tests.py?rev=1084284&r1=1084283&r2=1084284&view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnsync_tests.py Tue Mar 22 
18:29:15 2011
@@ -797,7 +797,7 @@ def copy_bad_line_endings(sbox):
 #--
 
 def delete_svn_props(sbox):
-  "copy with svn:prop deletions"
+  "copy with svn:* prop deletions"
   run_test(sbox, "delete-svn-props.dump")
 
 @Issue(3438)




svn commit: r1084283 - /subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py

2011-03-22 Thread cmpilato
Author: cmpilato
Date: Tue Mar 22 18:27:26 2011
New Revision: 1084283

URL: http://svn.apache.org/viewvc?rev=1084283&view=rev
Log:
* subversion/tests/cmdline/svnrdump_tests.py
  (copy_bad_line_endings_dump): Minor docstring tweak.

Patch by: Danny Trebbien 


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

Modified: subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py?rev=1084283&r1=1084282&r2=1084283&view=diff
==
--- subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py Tue Mar 22 
18:27:26 2011
@@ -305,7 +305,7 @@ def url_encoding_load(sbox):
   run_load_test(sbox, "url-encoding-bug.dump")
 
 def copy_bad_line_endings_dump(sbox):
-  "dump: inconsistent line endings in svn:props"
+  "dump: inconsistent line endings in svn:* props"
   run_dump_test(sbox, "copy-bad-line-endings.dump",
 expected_dumpfile_name="copy-bad-line-endings.expected.dump",
 bypass_prop_validation=True)




svn commit: r1084278 - /subversion/trunk/notes/wc_node_walkers.txt

2011-03-22 Thread cmpilato
Author: cmpilato
Date: Tue Mar 22 18:11:59 2011
New Revision: 1084278

URL: http://svn.apache.org/viewvc?rev=1084278&view=rev
Log:
* notes/wc_node_walkers.txt
  Describe another node-walk instance.

Modified:
subversion/trunk/notes/wc_node_walkers.txt

Modified: subversion/trunk/notes/wc_node_walkers.txt
URL: 
http://svn.apache.org/viewvc/subversion/trunk/notes/wc_node_walkers.txt?rev=1084278&r1=1084277&r2=1084278&view=diff
==
--- subversion/trunk/notes/wc_node_walkers.txt (original)
+++ subversion/trunk/notes/wc_node_walkers.txt Tue Mar 22 18:11:59 2011
@@ -28,11 +28,17 @@ subversion/libsvn_client/changelist.c
 subversion/libsvn_client/info.c
 
crawl_entries() - Crawl a tree (up to specified depth) driving an
- svn_info_receiver_t callback.
+ svn_info_receiver_t callback.  The current implementation not
+ only uses the svn_wc__node_walk_children() interface, but the
+ callback it drives peeks back into the WC database many, many
+ times per node.
 
 subversion/libsvn_client/merge.c
 
-   get_mergeinfo_paths() -  ??
+   get_mergeinfo_paths() - Crawl a tree (up to specified depth),
+ locating children of a given directory for which the parent's
+ mergeinfo cannot be naively inherited and storing info about
+ those children in an array.  No notification required.
 
 subversion/libsvn_client/prop_commands.c
 




svn commit: r1084199 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/commit_util.c libsvn_wc/node.c

2011-03-22 Thread rhuijben
Author: rhuijben
Date: Tue Mar 22 14:50:24 2011
New Revision: 1084199

URL: http://svn.apache.org/viewvc?rev=1084199&view=rev
Log:
Create an initial version of a commit status function in libsvn_wc's node api.
This allows reducing the number of database queries in the commit walker and
prepares this code for further refactoring.

This commit reduces the 'svn ci' time on an unmodified checkout
containing trunk, 1.5.x and 1.6.x by another 50% for me.

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_get_commit_status): New function.

* subversion/libsvn_client/commit_util.c
  (harvest_committables): Use svn_wc__node_get_commit_status on every node
instead of 4-8 separate call for each node to optimize the number of
read transactions.

* subversion/libsvn_wc/node.c
  (svn_wc__node_get_commit_status): New function.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_client/commit_util.c
subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1084199&r1=1084198&r2=1084199&view=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Tue Mar 22 
14:50:24 2011
@@ -886,6 +886,30 @@ svn_wc__has_local_mods(svn_boolean_t *is
void *cancel_baton,
apr_pool_t *scratch_pool);
 
+
+/* Gets information needed by the commit harvester.
+ *
+ * ### Currently this API is work in progress and is designed for just this
+ * ### caller. It is certainly possible (and likely) that this function and
+ * ### it's caller will eventually move into a wc and maybe wc_db api.
+ */
+svn_error_t *
+svn_wc__node_get_commit_status(svn_node_kind_t *kind,
+   svn_boolean_t *added,
+   svn_boolean_t *deleted,
+   svn_boolean_t *not_present,
+   svn_boolean_t *symlink,
+   svn_revnum_t *revision,
+   const char **repos_relpath,
+   svn_boolean_t *conflicted,
+   const char **changelist,
+   svn_boolean_t *props_mod,
+   svn_boolean_t *update_root,
+   svn_wc_context_t *wc_ctx,
+   const char *local_abspath,
+   apr_pool_t *result_pool,
+   apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1084199&r1=1084198&r2=1084199&view=diff
==
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Tue Mar 22 14:50:24 
2011
@@ -352,11 +352,16 @@ harvest_committables(apr_hash_t *committ
   const char *entry_lock_token;
   const char *cf_relpath = NULL;
   svn_revnum_t entry_rev, cf_rev = SVN_INVALID_REVNUM;
-  const svn_string_t *propval;
   svn_boolean_t matches_changelists;
   svn_boolean_t is_special;
   svn_boolean_t is_file_external;
   svn_boolean_t is_added;
+  svn_boolean_t is_deleted;
+  svn_boolean_t is_not_present;
+  svn_boolean_t is_symlink;
+  svn_boolean_t conflicted;
+  const char *node_changelist;
+  svn_boolean_t is_update_root;
   const char *node_copyfrom_relpath;
   svn_revnum_t node_copyfrom_rev;
   svn_wc_context_t *wc_ctx = ctx->wc_ctx;
@@ -378,8 +383,18 @@ harvest_committables(apr_hash_t *committ
   /* Return error on unknown path kinds.  We check both the entry and
  the node itself, since a path might have changed kind since its
  entry was written. */
-  SVN_ERR(svn_wc_read_kind(&db_kind, ctx->wc_ctx, local_abspath,
-   TRUE, scratch_pool));
+  SVN_ERR(svn_wc__node_get_commit_status(&db_kind, &is_added, &is_deleted,
+ &is_not_present, &is_symlink,
+ &entry_rev, &entry_relpath,
+ &conflicted,
+ &node_changelist,
+ &prop_mod, &is_update_root,
+ ctx->wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
+
+  if (!entry_relpath && repos_relpath)
+entry_relpath = repos_relpath;
+
   if ((db_kind != svn_node_file) && (db_kind != svn_node_dir))
 return

svn commit: r1084185 - /subversion/trunk/subversion/libsvn_client/commit_util.c

2011-03-22 Thread cmpilato
Author: cmpilato
Date: Tue Mar 22 14:01:56 2011
New Revision: 1084185

URL: http://svn.apache.org/viewvc?rev=1084185&view=rev
Log:
Follow-up to r1083896, restoring a bit of cancellation granularity
accidentally lost.

* subversion/libsvn_client/commit_util.c
  (harvest_committables): Check for cancellation while iterating over
locked-item URL lookups.

Modified:
subversion/trunk/subversion/libsvn_client/commit_util.c

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1084185&r1=1084184&r2=1084185&view=diff
==
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Tue Mar 22 14:01:56 
2011
@@ -814,6 +814,9 @@ harvest_committables(apr_hash_t *committ
   const char *item_url;
   apr_pool_t *token_pool = apr_hash_pool_get(lock_tokens);
 
+  if (ctx->cancel_func)
+SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+
   SVN_ERR(svn_wc__node_get_url(&item_url, ctx->wc_ctx, item_abspath,
token_pool, scratch_pool));
   if (item_url)




svn commit: r1084173 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

2011-03-22 Thread julianfoad
Author: julianfoad
Date: Tue Mar 22 13:35:24 2011
New Revision: 1084173

URL: http://svn.apache.org/viewvc?rev=1084173&view=rev
Log:
* subversion/libsvn_wc/wc-metadata.sql
  Fix the NODES table creation statements: add a semicolon after creating
the NODES_CURRENT view.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1084173&r1=1084172&r2=1084173&view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Tue Mar 22 13:35:24 
2011
@@ -492,7 +492,7 @@ CREATE VIEW NODES_CURRENT AS
   SELECT * FROM nodes AS n
 WHERE op_depth = (SELECT MAX(op_depth) FROM nodes AS n2
   WHERE n2.wc_id = n.wc_id
-AND n2.local_relpath = n.local_relpath)
+AND n2.local_relpath = n.local_relpath);
 
 /* Many queries have to filter the nodes table to pick only that version
of each node with the base (least "current") op_depth.  This view




svn commit: r1084167 - in /subversion/trunk/subversion: libsvn_fs_fs/revprops-db.sql libsvn_subr/internal_statements.sql libsvn_wc/wc-checks.sql libsvn_wc/wc-metadata.sql libsvn_wc/wc-queries.sql

2011-03-22 Thread julianfoad
Author: julianfoad
Date: Tue Mar 22 13:23:07 2011
New Revision: 1084167

URL: http://svn.apache.org/viewvc?rev=1084167&view=rev
Log:
Add svn:eol-style=native to all SQL files.

Modified:
subversion/trunk/subversion/libsvn_fs_fs/revprops-db.sql   (props changed)
subversion/trunk/subversion/libsvn_subr/internal_statements.sql   (props 
changed)
subversion/trunk/subversion/libsvn_wc/wc-checks.sql   (props changed)
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql   (props changed)
subversion/trunk/subversion/libsvn_wc/wc-queries.sql   (props changed)

Propchange: subversion/trunk/subversion/libsvn_fs_fs/revprops-db.sql
--
svn:eol-style = native

Propchange: subversion/trunk/subversion/libsvn_subr/internal_statements.sql
--
svn:eol-style = native

Propchange: subversion/trunk/subversion/libsvn_wc/wc-checks.sql
--
svn:eol-style = native

Propchange: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
--
svn:eol-style = native

Propchange: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
--
svn:eol-style = native




svn commit: r1084166 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

2011-03-22 Thread julianfoad
Author: julianfoad
Date: Tue Mar 22 13:21:26 2011
New Revision: 1084166

URL: http://svn.apache.org/viewvc?rev=1084166&view=rev
Log:
* subversion/libsvn_wc/wc-metadata.sql
  Remove CRs that were introduced recently, as they break the build.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1084166&r1=1084165&r2=1084166&view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Tue Mar 22 13:21:26 
2011
@@ -489,9 +489,9 @@ CREATE INDEX I_NODES_PARENT ON NODES (wc
current view.
  */
 CREATE VIEW NODES_CURRENT AS
-  SELECT * FROM nodes AS n
-WHERE op_depth = (SELECT MAX(op_depth) FROM nodes AS n2
-  WHERE n2.wc_id = n.wc_id 
+  SELECT * FROM nodes AS n
+WHERE op_depth = (SELECT MAX(op_depth) FROM nodes AS n2
+  WHERE n2.wc_id = n.wc_id
 AND n2.local_relpath = n.local_relpath)
 
 /* Many queries have to filter the nodes table to pick only that version




svn propchange: r1084099 - svn:log

2011-03-22 Thread cmpilato
Author: cmpilato
Revision: 1084099
Modified property: svn:log

Modified: svn:log at Tue Mar 22 13:03:12 2011
--
--- svn:log (original)
+++ svn:log Tue Mar 22 13:03:12 2011
@@ -1,5 +1,5 @@
-Remove obsolute '###' comment. The function does print git headers for
-renames - the problem is that the caller can't identify renames.
+Remove obsolete '###' comment.  The function does print git headers for
+renames -- the problem is that the caller can't identify renames.
 
 * subversion/libsvn_client/diff.c
   (print_git_diff_header): Remove '###' comment.



svn commit: r1084147 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

2011-03-22 Thread rhuijben
Author: rhuijben
Date: Tue Mar 22 12:37:57 2011
New Revision: 1084147

URL: http://svn.apache.org/viewvc?rev=1084147&view=rev
Log:
Rewrite view to use a subquery instead of a join, which should avoid creating
a temporary table containing every row in NODES when the view is used in a
query. It also removes several unused columns from the view's result.

Note that view changes aren't applied to existing working copies; only to new.

* subversion/libsvn_wc/wc-metadata.sql
  (NODES_CURRENT): Rewrite query to use a subquery per row instead of a join,
to allow SQLite to optimize a bit more over the table in the view.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-metadata.sql?rev=1084147&r1=1084146&r2=1084147&view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-metadata.sql Tue Mar 22 12:37:57 
2011
@@ -489,12 +489,10 @@ CREATE INDEX I_NODES_PARENT ON NODES (wc
current view.
  */
 CREATE VIEW NODES_CURRENT AS
-  SELECT * FROM nodes
-JOIN (SELECT wc_id, local_relpath, MAX(op_depth) AS op_depth FROM nodes
-  GROUP BY wc_id, local_relpath) AS filter
-ON nodes.wc_id = filter.wc_id
-  AND nodes.local_relpath = filter.local_relpath
-  AND nodes.op_depth = filter.op_depth;
+  SELECT * FROM nodes AS n
+WHERE op_depth = (SELECT MAX(op_depth) FROM nodes AS n2
+  WHERE n2.wc_id = n.wc_id 
+AND n2.local_relpath = n.local_relpath)
 
 /* Many queries have to filter the nodes table to pick only that version
of each node with the base (least "current") op_depth.  This view




svn commit: r1084145 - /subversion/trunk/subversion/libsvn_wc/wc-queries.sql

2011-03-22 Thread rhuijben
Author: rhuijben
Date: Tue Mar 22 12:17:28 2011
New Revision: 1084145

URL: http://svn.apache.org/viewvc?rev=1084145&view=rev
Log:
Update STMT_SELECT_WORKING_CHILDREN to not use the NODES_CURRENT view, as
SQLite creates a complete temporary table for that view before processing
the rest of the query. This reduces the time spend on 'svn ci' to about 10%
of what it was before this patch.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_WORKING_CHILDREN): Don't use NODES_CURRENT when we can avoid
that.

Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1084145&r1=1084144&r2=1084145&view=diff
==
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Tue Mar 22 12:17:28 
2011
@@ -173,12 +173,12 @@ WHERE wc_id = ?1 AND parent_relpath = ?2
directory (?1, ?2).  A given path is not included just because it is a
child of an underlying (replaced) directory, it has to be in the
working version of the directory. */
-SELECT local_relpath FROM nodes_current
+SELECT local_relpath FROM nodes
 WHERE wc_id = ?1 AND parent_relpath = ?2
-  AND (op_depth >= (SELECT MAX(op_depth) FROM nodes_current
+  AND (op_depth > (SELECT MAX(op_depth) FROM nodes
WHERE wc_id = ?1 AND local_relpath = ?2)
OR
-   (op_depth = (SELECT MAX(op_depth) FROM nodes_current
+   (op_depth = (SELECT MAX(op_depth) FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2)
 AND presence != 'base-deleted'))
 




svn propchange: r1084001 - svn:log

2011-03-22 Thread julianfoad
Author: julianfoad
Revision: 1084001
Modified property: svn:log

Modified: svn:log at Tue Mar 22 12:08:39 2011
--
--- svn:log (original)
+++ svn:log Tue Mar 22 12:08:39 2011
@@ -2,7 +2,7 @@ Simplify and correct a query to allow it
 instead of a huge join. I think it needs a bit more optimization, but I hope
 this improves commit performance a bit for now.
 
-The SQLite query analyzer shows that the same subquery is performed more then
+The SQLite query analyzer shows that the same subquery is performed more than
 once, so this can really use some further work.
 
 * subversion/libsvn_wc/wc-queries.sql



svn commit: r1084138 - in /subversion/trunk/subversion: libsvn_diff/parse-diff.c tests/libsvn_diff/parse-diff-test.c

2011-03-22 Thread dannas
Author: dannas
Date: Tue Mar 22 11:19:44 2011
New Revision: 1084138

URL: http://svn.apache.org/viewvc?rev=1084138&view=rev
Log:
Fix issue #3809 - 'svn patch' accepts invalid git diff headers.

* subversion/libsvn_diff/parse-diff.c
  (svn_diff_parse_next_patch): Disallow non-header lines in the header.

* subversion/tests/libsvn_diff/parse-diff-test.c
  (bad_git_diff_header): Remove sentence that says that the test is
failing.
  (test_funcs): Remove XFAIL marker.

Modified:
subversion/trunk/subversion/libsvn_diff/parse-diff.c
subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c

Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=1084138&r1=1084137&r2=1084138&view=diff
==
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Tue Mar 22 11:19:44 
2011
@@ -1286,6 +1286,7 @@ svn_diff_parse_next_patch(svn_patch_t **
 {
   apr_off_t pos, last_line;
   svn_boolean_t eof;
+  svn_boolean_t valid_header_line = FALSE;
   svn_boolean_t line_after_tree_header_read = FALSE;
   apr_pool_t *iterpool;
   enum parse_state state = state_start;
@@ -1323,6 +1324,8 @@ svn_diff_parse_next_patch(svn_patch_t **
iterpool));
 }
 
+  valid_header_line = FALSE;
+
   /* Run the state machine. */
   for (i = 0; i < (sizeof(transitions) / sizeof(transitions[0])); i++)
 {
@@ -1332,6 +1335,7 @@ svn_diff_parse_next_patch(svn_patch_t **
 {
   SVN_ERR(transitions[i].fn(&state, line->data, *patch,
 result_pool, iterpool));
+  valid_header_line = TRUE;
   break;
 }
 }
@@ -1352,7 +1356,19 @@ svn_diff_parse_next_patch(svn_patch_t **
   break;
 }
   else if (state == state_git_tree_seen)
-line_after_tree_header_read = TRUE;
+{
+  line_after_tree_header_read = TRUE;
+}
+  else if (! valid_header_line && state != state_start)
+{
+  /* We've encountered an invalid diff header. 
+   *
+   * Rewind to the start of the line just read - it may be a new
+   * header that begins there. */
+  SVN_ERR(svn_io_file_seek(patch_file->apr_file, APR_SET, &last_line,
+   scratch_pool));
+  state = state_start;
+}
 
 }
   while (! eof);

Modified: subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c?rev=1084138&r1=1084137&r2=1084138&view=diff
==
--- subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c Tue Mar 22 
11:19:44 2011
@@ -120,9 +120,8 @@ static const char *git_tree_and_text_uni
   ""NL;
 
   /* Only the last git diff header is valid. The other ones either misses a
-   * path element or has noise between lines that must be continous.  The
-   * test test_bad_git_diff_headers currently fails because the headers with
-   * random noise are tolerated.  See issue #3809. */
+   * path element or has noise between lines that must be continous. See
+   * issue #3809. */
 static const char *bad_git_diff_header =
   "Index: iota.copied"  NL
   "===" NL
@@ -925,7 +924,7 @@ struct svn_test_descriptor_t test_funcs[
 "test git unidiff parsing"),
 SVN_TEST_PASS2(test_parse_git_tree_and_text_diff,
"test git unidiff parsing of tree and text changes"),
-SVN_TEST_XFAIL2(test_bad_git_diff_headers,
+SVN_TEST_PASS2(test_bad_git_diff_headers,
 "test badly formatted git diff headers"),
 SVN_TEST_PASS2(test_parse_property_diff,
"test property unidiff parsing"),




svn commit: r1084099 - /subversion/trunk/subversion/libsvn_client/diff.c

2011-03-22 Thread dannas
Author: dannas
Date: Tue Mar 22 08:34:56 2011
New Revision: 1084099

URL: http://svn.apache.org/viewvc?rev=1084099&view=rev
Log:
Remove obsolute '###' comment. The function does print git headers for
renames - the problem is that the caller can't identify renames.

* subversion/libsvn_client/diff.c
  (print_git_diff_header): Remove '###' comment.

Modified:
subversion/trunk/subversion/libsvn_client/diff.c

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1084099&r1=1084098&r2=1084099&view=diff
==
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Tue Mar 22 08:34:56 2011
@@ -521,8 +521,6 @@ print_git_diff_header(svn_stream_t *os,
rev2, scratch_pool);
 }
 
-  /* ### Print git headers for renames, too, in the future. */
-
   return SVN_NO_ERROR;
 }