[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Optimize svn up/svn switch with internal diff3

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2006-06-23 01:28:15 CEST

Currently we dry-run-merge and later real-merge during 'svn up'/'svn
switch'. This is to support interactive merge tools. However, most
setups seem to use our internal merge, which doesn't need this
behaviour.

The patch below optimizes the common case while maintaining the same
performance in the fallback scenario.

I intend to extend the patch later with a config option to disable the
interactive merge behaviour even for external diff tools (ie GNU
diff3).

bye,

Erik.

Log:
[[[
Optimize svn up/svn switch when using our internal diff3.

* subversion/libsvn_wc/update_editor.c
  (merge_file): Only do delayed merge iff we use an extenal diff3.
]]]
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c (revision 20223)
+++ subversion/libsvn_wc/update_editor.c (working copy)
@@ -2070,7 +2070,8 @@
               newrev_str = apr_psprintf(pool, ".r%ld",
                                         new_revision);

- /* Merge the changes from the old-textbase (TXTB) to
+ /* When using external diff:
+ Merge the changes from the old-textbase (TXTB) to
                  new-textbase (TMP_TXTB) into the file we're
                  updating (BASE_NAME). Either the merge will
                  happen smoothly, or a conflict will result.
@@ -2078,12 +2079,13 @@
                  and keyword translation, and diff3 will insert
                  conflict markers for us. It also deals with binary
                  files appropriately. */
- SVN_ERR(svn_wc__loggy_merge(&log_accum, adm_access,
- base_name, txtb, tmp_txtb,
- oldrev_str, newrev_str, ".mine",
- pool));
+ if (diff3_cmd)
+ SVN_ERR(svn_wc__loggy_merge(&log_accum, adm_access,
+ base_name, txtb, tmp_txtb,
+ oldrev_str, newrev_str, ".mine",
+ pool));

- /* Run a dry-run of the merge to see if a conflict will
+ /* Run (a dry-run of) the merge to see if a conflict will
                  occur. This is needed so we can report back to the
                  client as the changes come in. */
               base = svn_wc_adm_access_path(adm_access);
@@ -2091,12 +2093,14 @@
               /* ### FIXME: We force use of the internal diff3 here
                      because we don't want to run a graphical external
                      diff3 twice. See issue 1914. */
+ /* Dry-run iff resorting to external diff for real merge */
               SVN_ERR(svn_wc_merge2(svn_path_join(base, txtb, pool),
                                               svn_path_join(base,
base_name, pool),
                                     adm_access,
                                     oldrev_str, newrev_str, ".mine",
- TRUE, &merge_outcome, NULL, NULL,
+ diff3_cmd != NULL, /* dry run */
+ &merge_outcome, NULL, NULL,
                                     pool));

             } /* end: working file exists and has mods */
                           svn_path_join(base, tmp_txtb, pool),

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 23 01:28:43 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.