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

Re: svn commit: rev 1937 - trunk/subversion/include trunk/subversion/libsvn_wc trunk/subversion/svnlook trunk/subversion/mod_dav_svn trunk/subversion/tests/clients/cmdline trunk/subversion/tests/libsvn_repos trunk/subversion/libsvn_repos

From: Kevin Pilch-Bisson <kevin_at_pilch-bisson.net>
Date: 2002-05-14 22:11:35 CEST

Did this change work when building mod_dav_svn. With head I currently get

kapilch@darkcity:~/svn/shared [403]$ make subversion/mod_dav_svn/merge.lo
/bin/sh /home/kapilch/svn/shared/libtool --silent --mode=compile gcc
-DSOLARIS2=8 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -g -Wall
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthreads
-DNEON_ZLIB -Wpointer-arith -Wwrite-strings -Wshadow -DSVN_DEBUG -DAP_DEBUG
-I/home/kapilch/include -I../source/subversion/include -I.
-I/home/kapilch/include -I/home/kapilch/include -I/home/kapilch/include
-I/home/kapilch/httpd-2.0/srclib/apr-util/xml/expat/lib
-I/home/kapilch/include/neon -I/home/kapilch/include -o
subversion/mod_dav_svn/merge.lo -c ../source/subversion/mod_dav_svn/merge.c
../source/subversion/mod_dav_svn/merge.c: In function
`dav_svn__merge_response':
../source/subversion/mod_dav_svn/merge.c:433: warning: passing arg 4 of
`svn_repos_dir_delta' from incompatible pointer type
../source/subversion/mod_dav_svn/merge.c:433: warning: passing arg 5 of
`svn_repos_dir_delta' from incompatible pointer type
../source/subversion/mod_dav_svn/merge.c:433: warning: passing arg 6 of
`svn_repos_dir_delta' from incompatible pointer type
../source/subversion/mod_dav_svn/merge.c:433: warning: passing arg 7 of
`svn_repos_dir_delta' from incompatible pointer type
../source/subversion/mod_dav_svn/merge.c:433: warning: passing arg 12 of
`svn_repos_dir_delta' makes integer from pointer without a cast
../source/subversion/mod_dav_svn/merge.c:433: too few arguments to function
`svn_repos_dir_delta'
make: *** [subversion/mod_dav_svn/merge.lo] Error 1

Any ideas?

On Sun, May 12, 2002 at 11:57:08AM -0500, cmpilato@tigris.org wrote:
> Author: cmpilato
> Date: 2002-05-12 16:57 GMT
> New Revision: 1937
>
> Modified:
> trunk/subversion/include/svn_repos.h
> trunk/subversion/libsvn_repos/delta.c
> trunk/subversion/libsvn_repos/dump.c
> trunk/subversion/libsvn_repos/node_tree.c
> trunk/subversion/libsvn_repos/reporter.c
> trunk/subversion/libsvn_wc/update_editor.c
> trunk/subversion/mod_dav_svn/merge.c
> trunk/subversion/svnlook/main.c
> trunk/subversion/tests/clients/cmdline/update_tests.py
> trunk/subversion/tests/libsvn_repos/repos-test.c
> Log:
> Miscellaneous cleanups and stuff related to svn_repos_dir_delta.
>
> (cd subversion; svn ci -F ~/log_message.txt include/svn_repos.h libsvn_repos libsvn_wc svnlook mod_dav_svn subversion/tests)
>
> * subversion/include/svn_repos.h
> (svn_repos_dir_delta): Remove `src_revs' parameter.
>
> * subversion/libsvn_repos/delta.c
> (proplist_change_fn_t): Remove `source_rev_diffs' member.
> (delta_proplists): Fix some uses of `pool' that should have been `subpool'.
> (add_file_or_dir, replace_file_or_dir, delta_dirs): Renamed some
> variables for brevity.
> (get_path_revision): New.
> (get_revision_from_hash): Removed. Callers now use get_path_revision().
> (svn_repos_dir_delta): Remove `src_revs' parameter.
>
> * subversion/libsvn_repos/node_tree.c
> (open_file, open_directory): Code lineup.
>
> * subversion/libsvn_repos/dump.c
> (svn_repos_dump_fs): Update call to svn_repos_dir_delta().
>
> * subversion/libsvn_repos/reporter.c
> (svn_repos_report_baton_t): Remove `path_revs' member.
> (add_to_path_map, get_from_path_map): Code formatting change.
> (svn_repos_set_path, svn_repos_link_path): No longer use path_revs hash.
> (svn_repos_finish_report): Update call to svn_repos_dir_delta().
> (svn_repos_begin_report): No longer use path_revs hash.
>
> * subversion/libsvn_wc/update_editor.c
> (add_or_open_file): Oops. Rename `copyfrom_url' to `copyfrom_rev'.
>
> * subversion/svnlook/main.c
> (generate_delta_tree): Update call to svn_repos_dir_delta().
>
> * subversion/mod_dav_svn/merge.c
> (dav_svn__merge_response): Update call to svn_repos_dir_delta().
>
> * subversion/tests/libsvn_repos/repos-test.c
> (dir_deltas): Update call to svn_repos_dir_delta().
>
> * subversion/tests/clients/cmdline/update_tests.py
> (receive_overlapping_same_change): Make test description consistent
> with others in this file (and fix spelling along the way).
>
>
>
>
> Modified: trunk/subversion/include/svn_repos.h
> ==============================================================================
> --- trunk/subversion/include/svn_repos.h (original)
> +++ trunk/subversion/include/svn_repos.h Sun May 12 11:57:07 2002
> @@ -217,13 +217,6 @@
> will be called with the TGT_ROOT's revision number, else it will
> not be called at all.
>
> - SRC_REVS is a hash whose keys are character string paths, and whose
> - values are pointers to svn_revnum_t's, which describes the base
> - revisions of the items in the SRC_PARENT tree. This hash need only
> - contain the base revision for the top of that tree, and then those
> - paths that have a base revision that differs from that of their
> - parent directory.
> -
> If TEXT_DELTAS is FALSE, send a single NULL txdelta window to the
> window handler returned by EDITOR->apply_textdelta().
>
> @@ -252,7 +245,6 @@
> svn_repos_dir_delta (svn_fs_root_t *src_root,
> const char *src_parent_dir,
> const char *src_entry,
> - apr_hash_t *src_revs,
> svn_fs_root_t *tgt_root,
> const char *tgt_path,
> const svn_delta_edit_fns_t *editor,
>
> Modified: trunk/subversion/libsvn_wc/update_editor.c
> ==============================================================================
> --- trunk/subversion/libsvn_wc/update_editor.c (original)
> +++ trunk/subversion/libsvn_wc/update_editor.c Sun May 12 11:57:07 2002
> @@ -851,7 +851,7 @@
> add_or_open_file (const char *path,
> void *parent_baton,
> const char *copyfrom_path,
> - svn_revnum_t copyfrom_url,
> + svn_revnum_t copyfrom_rev,
> void **file_baton,
> svn_boolean_t adding, /* 0 if replacing */
> apr_pool_t *pool)
>
> Modified: trunk/subversion/svnlook/main.c
> ==============================================================================
> --- trunk/subversion/svnlook/main.c (original)
> +++ trunk/subversion/svnlook/main.c Sun May 12 11:57:07 2002
> @@ -128,13 +128,9 @@
> svn_fs_root_t *base_root;
> const svn_delta_edit_fns_t *editor;
> void *edit_baton;
> - apr_hash_t *src_revs = apr_hash_make (pool);
> apr_pool_t *edit_pool = svn_pool_create (pool);
> svn_fs_t *fs = svn_repos_fs (repos);
>
> - /* Get the current root. */
> - apr_hash_set (src_revs, "", APR_HASH_KEY_STRING, &base_rev);
> -
> /* Get the base root. */
> SVN_ERR (svn_fs_revision_root (&base_root, fs, base_rev, pool));
>
> @@ -143,7 +139,7 @@
> base_root, root, pool, edit_pool));
>
> /* Drive our editor. */
> - SVN_ERR (svn_repos_dir_delta (base_root, "", NULL, src_revs, root, "",
> + SVN_ERR (svn_repos_dir_delta (base_root, "", NULL, root, "",
> editor, edit_baton, FALSE, TRUE, FALSE, TRUE,
> edit_pool));
>
>
> Modified: trunk/subversion/mod_dav_svn/merge.c
> ==============================================================================
> --- trunk/subversion/mod_dav_svn/merge.c (original)
> +++ trunk/subversion/mod_dav_svn/merge.c Sun May 12 11:57:07 2002
> @@ -319,8 +319,6 @@
> const char *vcc;
> char revbuf[20]; /* long enough for SVN_REVNUM_T_FMT */
> svn_string_t *creationdate, *creator_displayname;
> - apr_hash_t *revs;
> - svn_revnum_t *rev_ptr;
> svn_delta_edit_fns_t *editor;
> merge_response_ctx mrc = { 0 };
>
> @@ -405,12 +403,6 @@
> ### we probably should say something about the dirs, so that we can
> ### pass back the new version URL */
>
> - /* ### hrm. needing this hash table feels wonky. */
> - revs = apr_hash_make(pool);
> - rev_ptr = apr_palloc(pool, sizeof(*rev_ptr));
> - *rev_ptr = new_rev - 1;
> - apr_hash_set(revs, "", APR_HASH_KEY_STRING, rev_ptr);
> -
> /* set up the editor for the delta process */
> editor = svn_delta_old_default_editor(pool);
> editor->open_root = mr_open_root;
> @@ -432,7 +424,6 @@
>
> serr = svn_repos_dir_delta(previous_root, "/",
> NULL, /* ### should fix */
> - revs,
> committed_root, "/",
> editor, &mrc,
> FALSE, /* don't bother with text-deltas */
>
> Modified: trunk/subversion/tests/clients/cmdline/update_tests.py
> ==============================================================================
> --- trunk/subversion/tests/clients/cmdline/update_tests.py (original)
> +++ trunk/subversion/tests/clients/cmdline/update_tests.py Sun May 12 11:57:07 2002
> @@ -469,7 +469,7 @@
> #----------------------------------------------------------------------
>
> def receive_overlapping_same_change(sbox):
> - "Make sure overlapping idental changes do not conflict."
> + "make sure overlapping identical changes do not conflict"
>
> ### (See http://subversion.tigris.org/issues/show_bug.cgi?id=682.)
> ###
>
> Modified: trunk/subversion/tests/libsvn_repos/repos-test.c
> ==============================================================================
> --- trunk/subversion/tests/libsvn_repos/repos-test.c (original)
> +++ trunk/subversion/tests/libsvn_repos/repos-test.c Sun May 12 11:57:07 2002
> @@ -301,15 +301,6 @@
> {
> for (j = 0; j < revision_count; j++)
> {
> - svn_revnum_t *revision;
> - apr_hash_t *rev_diffs;
> -
> - /* Initialize our source revisions hash. */
> - rev_diffs = apr_hash_make (subpool);
> - revision = apr_pcalloc (subpool, sizeof (svn_revnum_t));
> - *revision = i;
> - apr_hash_set (rev_diffs, "", APR_HASH_KEY_STRING, revision);
> -
> /* Prepare a txn that will receive the changes from
> svn_repos_dir_delta */
> SVN_ERR (svn_fs_begin_txn (&txn, fs, i, subpool));
> @@ -328,7 +319,6 @@
> SVN_ERR (svn_repos_dir_delta (txn_root,
> "",
> NULL,
> - rev_diffs,
> revision_root,
> "",
> editor,
>
> Modified: trunk/subversion/libsvn_repos/reporter.c
> ==============================================================================
> --- trunk/subversion/libsvn_repos/reporter.c (original)
> +++ trunk/subversion/libsvn_repos/reporter.c Sun May 12 11:57:07 2002
> @@ -67,10 +67,6 @@
> const svn_delta_edit_fns_t *update_editor;
> void *update_edit_baton;
>
> - /* This hash describes the mixed revisions in the transaction; it
> - maps pathnames (char *) to revision numbers (svn_revnum_t). */
> - apr_hash_t *path_revs;
> -
> /* This hash contains any `linked paths', and what they were linked
> from. */
> apr_hash_t *linked_paths;
> @@ -88,14 +84,14 @@
> const char *linkpath)
> {
> /* normalize 'root paths' to have a slash */
> - const char *norm_path = strcmp(path, "") ? path : "/";
> + const char *norm_path = strcmp (path, "") ? path : "/";
>
> /* if there is an actual linkpath given, it is the repos path, else
> our path maps to itself. */
> const char *repos_path = linkpath ? linkpath : norm_path;
>
> /* now, geez, put the path in the map already! */
> - apr_hash_set(hash, path, APR_HASH_KEY_STRING, (void *)repos_path);
> + apr_hash_set (hash, path, APR_HASH_KEY_STRING, (void *) repos_path);
> }
>
>
> @@ -110,36 +106,36 @@
>
> /* no hash means no map. that's easy enough. */
> if (! hash)
> - return apr_pstrdup(pool, path);
> + return apr_pstrdup (pool, path);
>
> - if ((repos_path = apr_hash_get(hash, path, APR_HASH_KEY_STRING)))
> + if ((repos_path = apr_hash_get (hash, path, APR_HASH_KEY_STRING)))
> {
> /* what luck! this path is a hash key! if there is a linkpath,
> use that, else return the path itself. */
> - return apr_pstrdup(pool, repos_path);
> + return apr_pstrdup (pool, repos_path);
> }
>
> /* bummer. PATH wasn't a key in path map, so we get to start
> hacking off components and looking for a parent from which to
> derive a repos_path. use a stringbuf for convenience. */
> - my_path = svn_stringbuf_create(path, pool);
> + my_path = svn_stringbuf_create (path, pool);
> do
> {
> - svn_path_remove_component(my_path);
> - if ((repos_path = apr_hash_get(hash, my_path->data, my_path->len)))
> + svn_path_remove_component (my_path);
> + if ((repos_path = apr_hash_get (hash, my_path->data, my_path->len)))
> {
> /* we found a mapping ... but of one of PATH's parents.
> soooo, we get to re-append the chunks of PATH that we
> broke off to the REPOS_PATH we found. */
> - return apr_pstrcat(pool, repos_path, "/",
> - path + my_path->len + 1, NULL);
> + return apr_pstrcat (pool, repos_path, "/",
> + path + my_path->len + 1, NULL);
> }
> }
> - while (! svn_path_is_empty(my_path));
> + while (! svn_path_is_empty (my_path));
>
> /* well, we simply never found anything worth mentioning the map.
> PATH is its own default finding, then. */
> - return apr_pstrdup(pool, path);
> + return apr_pstrdup (pool, path);
> }
>
>
> @@ -174,11 +170,6 @@
> rbaton->pool));
> SVN_ERR (svn_fs_txn_root (&(rbaton->txn_root), rbaton->txn,
> rbaton->pool));
> -
> - /* In our hash, map the root of the txn ("") to the initial base
> - revision. */
> - *rev_ptr = revision;
> - apr_hash_set (rbaton->path_revs, "", APR_HASH_KEY_STRING, rev_ptr);
> }
>
> else /* this is not the first call to set_path. */
> @@ -211,12 +202,6 @@
> /* Copy into our txn. */
> SVN_ERR (svn_fs_link (from_root, link_path,
> rbaton->txn_root, from_path, rbaton->pool));
> -
> - /* Remember this path in our hashtable. */
> - *rev_ptr = revision;
> - apr_hash_set (rbaton->path_revs, from_path, APR_HASH_KEY_STRING,
> - rev_ptr);
> -
> }
>
> return SVN_NO_ERROR;
> @@ -278,10 +263,6 @@
> rbaton->txn2_root, from_path, rbaton->pool));
> }
>
> - /* Remember this path in our hashtable of revision. It doesn't
> - matter that the path comes from a different repository location. */
> - *rev_ptr = revision;
> - apr_hash_set (rbaton->path_revs, from_path, APR_HASH_KEY_STRING, rev_ptr);
> /* Remove this path/link_path in our hashtable of linked paths. */
> if (! rbaton->linked_paths)
> rbaton->linked_paths = apr_hash_make (rbaton->pool);
> @@ -352,7 +333,6 @@
> SVN_ERR (svn_repos_dir_delta (rbaton->txn_root,
> rbaton->base_path,
> rbaton->target,
> - rbaton->path_revs,
> target_root,
> tgt_path,
> rbaton->update_editor,
> @@ -410,7 +390,6 @@
> rbaton->revnum_to_update_to = revnum;
> rbaton->update_editor = editor;
> rbaton->update_edit_baton = edit_baton;
> - rbaton->path_revs = apr_hash_make (pool);
> rbaton->repos = repos;
> rbaton->text_deltas = text_deltas;
> rbaton->recurse = recurse;
>
> Modified: trunk/subversion/libsvn_repos/node_tree.c
> ==============================================================================
> --- trunk/subversion/libsvn_repos/node_tree.c (original)
> +++ trunk/subversion/libsvn_repos/node_tree.c Sun May 12 11:57:07 2002
> @@ -207,9 +207,9 @@
>
> static svn_error_t *
> open_directory (svn_stringbuf_t *name,
> - void *parent_baton,
> - svn_revnum_t base_revision,
> - void **child_baton)
> + void *parent_baton,
> + svn_revnum_t base_revision,
> + void **child_baton)
> {
> struct dir_baton *pd = (struct dir_baton *) parent_baton;
> struct edit_baton *eb = (struct edit_baton *) pd->edit_baton;
> @@ -262,9 +262,9 @@
>
> static svn_error_t *
> open_file (svn_stringbuf_t *name,
> - void *parent_baton,
> - svn_revnum_t base_revision,
> - void **file_baton)
> + void *parent_baton,
> + svn_revnum_t base_revision,
> + void **file_baton)
> {
> struct dir_baton *pd = (struct dir_baton *) parent_baton;
> struct edit_baton *eb = (struct edit_baton *) pd->edit_baton;
>
> Modified: trunk/subversion/libsvn_repos/dump.c
> ==============================================================================
> --- trunk/subversion/libsvn_repos/dump.c (original)
> +++ trunk/subversion/libsvn_repos/dump.c Sun May 12 11:57:07 2002
> @@ -589,10 +589,7 @@
> const svn_delta_edit_fns_t *editor;
> void *dump_edit_baton, *edit_baton;
> svn_revnum_t i;
> - apr_hash_t *src_revs;
> -
> svn_fs_t *fs = svn_repos_fs (repos);
> -
> apr_pool_t *subpool = svn_pool_create (pool);
>
> /* Use default vals if necessary. */
> @@ -659,12 +656,7 @@
> /* Drive the editor. */
> SVN_ERR (svn_fs_revision_root (&from_root, fs, from_rev, subpool));
> SVN_ERR (svn_fs_revision_root (&to_root, fs, to_rev, subpool));
> -
> - src_revs = apr_hash_make (subpool);
> - apr_hash_set (src_revs, "", APR_HASH_KEY_STRING, &from_rev);
> -
> SVN_ERR (svn_repos_dir_delta (from_root, "/", NULL,
> - src_revs,
> to_root, "/",
> editor, edit_baton,
> FALSE, /* don't send text-deltas */
>
> Modified: trunk/subversion/libsvn_repos/delta.c
> ==============================================================================
> --- trunk/subversion/libsvn_repos/delta.c (original)
> +++ trunk/subversion/libsvn_repos/delta.c Sun May 12 11:57:08 2002
> @@ -43,7 +43,6 @@
> struct context {
> const svn_delta_edit_fns_t *editor;
> svn_fs_root_t *source_root;
> - apr_hash_t *source_rev_diffs;
> svn_fs_root_t *target_root;
> svn_boolean_t text_deltas;
> svn_boolean_t recurse;
> @@ -69,9 +68,9 @@
>
>
> /* Retrieving the base revision from the path/revision hash. */
> -static svn_revnum_t get_revision_from_hash (apr_hash_t *hash,
> - const char *path,
> - apr_pool_t *pool);
> +static svn_revnum_t get_path_revision (svn_fs_root_t *root,
> + const char *path,
> + apr_pool_t *pool);
>
>
> /* proplist_change_fn_t property changing functions. */
> @@ -155,7 +154,6 @@
> svn_repos_dir_delta (svn_fs_root_t *src_root,
> const char *src_parent_dir,
> const char *src_entry,
> - apr_hash_t *src_revs,
> svn_fs_root_t *tgt_root,
> const char *tgt_path,
> const svn_delta_edit_fns_t *editor,
> @@ -227,7 +225,6 @@
> reference to all the helper functions. */
> c.editor = editor;
> c.source_root = src_root;
> - c.source_rev_diffs = src_revs;
> c.target_root = tgt_root;
> c.text_deltas = text_deltas;
> c.recurse = recurse;
> @@ -255,7 +252,7 @@
> /* Call open_root to get our root_baton... */
> SVN_ERR (editor->open_root
> (edit_baton,
> - get_revision_from_hash (src_revs, src_parent_dir, pool),
> + get_path_revision (src_root, src_parent_dir, pool),
> &root_baton));
>
> /* Construct the full path of the source and target update items. */
> @@ -354,50 +351,32 @@
> /* Retrieving the base revision from the path/revision hash. */
>
>
> -/* Look through a HASH (with paths as keys, and pointers to revision
> - numbers as values) for the revision associated with the given PATH.
> - Perform all necessary memory allocations in POOL. */
> -static svn_revnum_t
> -get_revision_from_hash (apr_hash_t *hash, const char *path,
> - apr_pool_t *pool)
> -{
> - void *val;
> - svn_stringbuf_t *path_copy;
> - svn_revnum_t revision = SVN_INVALID_REVNUM;
> -
> - if (! hash)
> - return SVN_INVALID_REVNUM;
> -
> - /* See if this path has a revision assigned in the hash. */
> - val = apr_hash_get (hash, path, APR_HASH_KEY_STRING);
> - if (val)
> - {
> - revision = *((svn_revnum_t *) val);
> - if (SVN_IS_VALID_REVNUM(revision))
> - return revision;
> - }
> -
> - /* Make a copy of our path that we can hack on. */
> - path_copy = svn_stringbuf_create (path, pool);
> -
> - /* If we haven't found a valid revision yet, and our copy of the
> - path isn't empty, hack the last component off the path and see if
> - *that* has a revision entry in our hash. */
> - while ((! SVN_IS_VALID_REVNUM(revision))
> - && (! svn_path_is_empty (path_copy)))
> - {
> - svn_path_remove_component (path_copy);
> -
> - val = apr_hash_get (hash, path_copy->data, APR_HASH_KEY_STRING);
> - if (val)
> - revision = *((svn_revnum_t *) val);
> - }
> -
> +static svn_revnum_t
> +get_path_revision (svn_fs_root_t *root,
> + const char *path,
> + apr_pool_t *pool)
> +{
> + svn_revnum_t revision;
> +
> + /* Easy out -- if ROOT is a revision root, we can use the revision
> + that it's a root of. */
> + if (svn_fs_is_revision_root (root))
> + return svn_fs_revision_root_revision (root);
> +
> + /* Else, this must be a transaction root, so ask the filesystem in
> + what revision this path was created. */
> + if (svn_fs_node_created_rev (&revision, root, path, pool))
> + revision = SVN_INVALID_REVNUM;
> +
> + /* If we don't get back a valid revision, this path is mutable in
> + the transaction. We should probably examing the node on which it
> + is based, doable by querying for the node-id of the path, and
> + thing examining that node-id's predecessor. ### this predecessor
> + determination isn't exposed via the FS public API right now, so
> + for now, we'll just return the SVN_INVALID_REVNUM. */
> return revision;
> }
>
> -
> -
>
> /* proplist_change_fn_t property changing functions. */
>
> @@ -485,14 +464,14 @@
> cr_str, subpool));
>
> /* Transmit the committed-date. */
> - svn_fs_revision_prop (&committed_date, fs,
> - committed_rev, SVN_PROP_REVISION_DATE, pool);
> + svn_fs_revision_prop (&committed_date, fs, committed_rev,
> + SVN_PROP_REVISION_DATE, subpool);
> SVN_ERR (change_fn (c, object, SVN_PROP_ENTRY_COMMITTED_DATE,
> committed_date, subpool));
>
> /* Transmit the last-author. */
> - svn_fs_revision_prop (&last_author, fs,
> - committed_rev, SVN_PROP_REVISION_AUTHOR, pool);
> + svn_fs_revision_prop (&last_author, fs, committed_rev,
> + SVN_PROP_REVISION_AUTHOR, subpool);
> SVN_ERR (change_fn (c, object, SVN_PROP_ENTRY_LAST_AUTHOR,
> last_author, subpool));
> }
> @@ -503,30 +482,21 @@
> int changed;
>
> /* Is this deltification worth our time? */
> - SVN_ERR (svn_fs_props_changed (&changed,
> - c->target_root,
> - target_path,
> - c->source_root,
> - source_path,
> - subpool));
> + SVN_ERR (svn_fs_props_changed (&changed, c->target_root, target_path,
> + c->source_root, source_path, subpool));
> if (! changed)
> - {
> - svn_pool_destroy (subpool);
> - return SVN_NO_ERROR;
> - }
> + goto cleanup;
> }
>
> /* Get the source file's properties */
> if (source_path)
> - SVN_ERR (svn_fs_node_proplist
> - (&s_props, c->source_root, source_path,
> - subpool));
> + SVN_ERR (svn_fs_node_proplist (&s_props, c->source_root,
> + source_path, subpool));
>
> /* Get the target file's properties */
> if (target_path)
> - SVN_ERR (svn_fs_node_proplist
> - (&t_props, c->target_root, target_path,
> - subpool));
> + SVN_ERR (svn_fs_node_proplist (&t_props, c->target_root,
> + target_path, subpool));
>
> for (hi = apr_hash_first (subpool, t_props); hi; hi = apr_hash_next (hi))
> {
> @@ -541,8 +511,7 @@
> /* See if this property existed in the source. If so, and if
> the values in source and target differ, open the value in
> target with the one in source. */
> - if (s_props
> - && ((s_value = apr_hash_get (s_props, key, klen)) != 0))
> + if (s_props && ((s_value = apr_hash_get (s_props, key, klen)) != 0))
> {
> if (! svn_string_compare (s_value, val))
> SVN_ERR (change_fn (c, object, key, val, subpool));
> @@ -574,6 +543,7 @@
> }
> }
>
> + cleanup:
> /* Destroy local subpool. */
> svn_pool_destroy (subpool);
>
> @@ -710,7 +680,7 @@
> apr_pool_t *pool)
> {
> int is_dir;
> - svn_stringbuf_t *target_full_path;
> + svn_stringbuf_t *t_fullpath;
> svn_revnum_t copied_from_revision = SVN_INVALID_REVNUM;
> const char *copied_from_path = NULL;
> struct context *context = c;
> @@ -723,12 +693,11 @@
> abort();
>
> /* Get the target's full path */
> - target_full_path = svn_stringbuf_create (target_parent, pool);
> - svn_path_add_component_nts (target_full_path, target_entry);
> + t_fullpath = svn_stringbuf_create (target_parent, pool);
> + svn_path_add_component_nts (t_fullpath, target_entry);
>
> /* Is the target a file or a directory? */
> - SVN_ERR (svn_fs_is_dir (&is_dir, c->target_root,
> - target_full_path->data, pool));
> + SVN_ERR (svn_fs_is_dir (&is_dir, c->target_root, t_fullpath->data, pool));
>
> namebuf = svn_stringbuf_create (target_entry, pool);
>
> @@ -737,7 +706,7 @@
> SVN_ERR (svn_fs_copied_from (&copied_from_revision,
> &copied_from_path,
> c->target_root,
> - target_full_path->data,
> + t_fullpath->data,
> pool));
> }
>
> @@ -761,7 +730,7 @@
> (namebuf, dir_baton,
> copied_path_buf, copied_from_revision, &subdir_baton));
> SVN_ERR (delta_dirs (context, subdir_baton,
> - copied_from_path, target_full_path->data, pool));
> + copied_from_path, t_fullpath->data, pool));
> SVN_ERR (context->editor->close_directory (subdir_baton));
> }
> else
> @@ -772,7 +741,7 @@
> (namebuf, dir_baton,
> copied_path_buf, copied_from_revision, &file_baton));
> SVN_ERR (delta_files (context, file_baton,
> - copied_from_path, target_full_path->data, pool));
> + copied_from_path, t_fullpath->data, pool));
> SVN_ERR (context->editor->close_file (file_baton));
> }
>
> @@ -793,8 +762,8 @@
> apr_pool_t *pool)
> {
> int is_dir;
> - svn_stringbuf_t *source_full_path = 0;
> - svn_stringbuf_t *target_full_path = 0;
> + svn_stringbuf_t *s_fullpath = 0;
> + svn_stringbuf_t *t_fullpath = 0;
> svn_revnum_t base_revision = SVN_INVALID_REVNUM;
>
> /* ### change the delta interface */
> @@ -807,21 +776,19 @@
> abort();
>
> /* Get the target's full path */
> - target_full_path = svn_stringbuf_create (target_parent, pool);
> - svn_path_add_component_nts (target_full_path, target_entry);
> + t_fullpath = svn_stringbuf_create (target_parent, pool);
> + svn_path_add_component_nts (t_fullpath, target_entry);
>
> /* Is the target a file or a directory? */
> SVN_ERR (svn_fs_is_dir (&is_dir, c->target_root,
> - target_full_path->data, pool));
> + t_fullpath->data, pool));
>
> /* Get the source's full path */
> - source_full_path = svn_stringbuf_create (source_parent, pool);
> - svn_path_add_component_nts (source_full_path, source_entry);
> + s_fullpath = svn_stringbuf_create (source_parent, pool);
> + svn_path_add_component_nts (s_fullpath, source_entry);
>
> /* Get the base revision for the entry from the hash. */
> - base_revision = get_revision_from_hash (c->source_rev_diffs,
> - source_full_path->data,
> - pool);
> + base_revision = get_path_revision (c->source_root, s_fullpath->data, pool);
>
> namebuf = svn_stringbuf_create (target_entry, pool);
> if (is_dir)
> @@ -831,7 +798,7 @@
> SVN_ERR (c->editor->open_directory
> (namebuf, dir_baton, base_revision, &subdir_baton));
> SVN_ERR (delta_dirs (c, subdir_baton,
> - source_full_path->data, target_full_path->data,
> + s_fullpath->data, t_fullpath->data,
> pool));
> SVN_ERR (c->editor->close_directory (subdir_baton));
> }
> @@ -842,7 +809,7 @@
> SVN_ERR (c->editor->open_file
> (namebuf, dir_baton, base_revision, &file_baton));
> SVN_ERR (delta_files (c, file_baton,
> - source_full_path->data, target_full_path->data,
> + s_fullpath->data, t_fullpath->data,
> pool));
> SVN_ERR (c->editor->close_file (file_baton));
> }
> @@ -906,14 +873,14 @@
> const void *key;
> void *val;
> apr_ssize_t klen;
> - svn_stringbuf_t *target_fullpath =
> + svn_stringbuf_t *t_fullpath =
> svn_stringbuf_create (target_path, subpool);
>
> /* KEY is the entry name in target, VAL the dirent */
> apr_hash_this (hi, &key, &klen, &val);
> t_entry = val;
>
> - svn_path_add_component_nts (target_fullpath, t_entry->name);
> + svn_path_add_component_nts (t_fullpath, t_entry->name);
>
> /* Can we find something with the same name in the source
> entries hash? */
> @@ -922,9 +889,8 @@
> {
> int distance;
> int is_dir;
> - SVN_ERR (svn_fs_is_dir (&is_dir,
> - c->target_root, target_fullpath->data,
> - subpool));
> + SVN_ERR (svn_fs_is_dir (&is_dir, c->target_root,
> + t_fullpath->data, subpool));
>
> if (c->recurse || !is_dir)
> {
> @@ -948,19 +914,14 @@
> else if (distance == -1)
> {
> SVN_ERR (delete (c, dir_baton, t_entry->name, subpool));
> - SVN_ERR (add_file_or_dir
> - (c, dir_baton,
> - target_path, t_entry->name, subpool));
> + SVN_ERR (add_file_or_dir (c, dir_baton, target_path,
> + t_entry->name, subpool));
> }
> else
> {
> - SVN_ERR (replace_file_or_dir
> - (c, dir_baton,
> - source_path,
> - s_entry->name,
> - target_path,
> - t_entry->name,
> - subpool));
> + SVN_ERR (replace_file_or_dir (c, dir_baton, source_path,
> + s_entry->name, target_path,
> + t_entry->name, subpool));
> }
> }
>
> @@ -971,12 +932,12 @@
> {
> int is_dir;
> SVN_ERR (svn_fs_is_dir (&is_dir, c->target_root,
> - target_fullpath->data, subpool));
> + t_fullpath->data, subpool));
>
> - if (c->recurse || !is_dir)
> + if (c->recurse || (! is_dir))
> {
> - SVN_ERR (add_file_or_dir
> - (c, dir_baton, target_path, t_entry->name, subpool));
> + SVN_ERR (add_file_or_dir (c, dir_baton, target_path,
> + t_entry->name, subpool));
> }
> }
>
> @@ -994,25 +955,26 @@
> const void *key;
> void *val;
> apr_ssize_t klen;
> - svn_stringbuf_t *source_fullpath = svn_stringbuf_create (source_path,
> - subpool);
> + svn_stringbuf_t *s_fullpath =
> + svn_stringbuf_create (source_path, subpool);
> int is_dir;
>
> /* KEY is the entry name in source, VAL the dirent */
> apr_hash_this (hi, &key, &klen, &val);
> s_entry = val;
> - svn_path_add_component_nts (source_fullpath, s_entry->name);
> + svn_path_add_component_nts (s_fullpath, s_entry->name);
>
> /* Do we actually want to delete the dir if we're non-recursive? */
> - SVN_ERR (svn_fs_is_dir (&is_dir,
> - c->source_root,
> - source_fullpath->data,
> - subpool));
> + SVN_ERR (svn_fs_is_dir (&is_dir, c->source_root,
> + s_fullpath->data, subpool));
>
> - if (c->recurse || !is_dir)
> + if (c->recurse || (! is_dir))
> {
> SVN_ERR (delete (c, dir_baton, s_entry->name, subpool));
> }
> +
> + /* Clear out our subpool for the next iteration... */
> + svn_pool_clear (subpool);
> }
> }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • application/pgp-signature attachment: stored
Received on Tue May 14 22:16:24 2002

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.