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

[PATCH] Fix for 1003, and URL stability

From: Bill Tutt <rassilon_at_lyra.org>
Date: 2002-11-24 03:17:31 CET

For a long time now libsvn_fs/tree.c could not correctly resolve out the
laziness inherent in our O(1) copy model. That is no longer true. This
patch allows mod_dav_svn to report the correct "NodeRevision first
visible on this path at revision number X". This is accomplished by the
following changes:
* Record non-root bubble up changes in the changes table.
* svn_fs_node_created_rev now reports the "first visible on this path"
created revision number.
* svn_fs_dir_entries() now includes the new created_rev in the
svn_fs_dirent_t structure.
* svn_fs_revisions_changed() now stops immediately if cross_copy_history
is false.

There are a couple of follow on tweaks that make the code more efficient
(by making the expensive lazy detection optional to open_path callers),
but I'd like to get this first chunk of changes in first.

All of the C FS tests (including the three new ones) pass as of 3870
with this patch applied.

* include/svn_fs.h
  (svn_fs_dirent_t) Add created_rev that sees through lazy copies and
is set to the first revision that a lazily copied node revision
appeared on the requested path.
* libsvn_fs/tree.c
  (add_change): Move earlier in the file, so that more functions can
       call it.
  (parent_path_t): Add members last_branch_id, in_lazy_land, and
last_path.
  (make_parent_path): Add new parameters for new parent_path_t
       members.
  (get_id_path): Move earlier in the file, so that more functions can
       call it.
  (is_child_lazily_copied): New function see through the laziness
       of the tree.
  (open_path): Keep track of last_branch_id so that it can be used in
       parent_paths.
  (choose_copy_id): Replace usage of svn_fs_compare_ids with a check
       that is more restrictive then svn_fs_check_related.
  (make_path_mutable): Ensure bubble up changes make it into the
       changes table by calling add_change.
  (txn_body_node_created_rev): Make use of information stored in
       open_path's parent_path to return the correct created revision.
  (txn_body_dir_entries): Fixup the DAG directory entries with the
       correct created revision.
  (revision_changed_args): Remove id and fs, and replace it with
       path and root so txn_body_revisions_changed can call open_path.
  (txn_body_revisions_changed): Make use of information from open_path
       to correctly stop immediately if cross_copy_history is false
       and the path in question only exists because of a copy.
  (svn_fs_revisions_changed): Update with respect to
       revision_changed_args changes.
* tests/libsvn_fs/fs-test.c:
  (branch_test): Add validation code.
  (lazy_copies_created_rev): New test case for svn_fs_node_created_rev
       that tests the new ability of created_rev to differ based on
       copies.
  (lazy_copies_dir_entries): New test case for svn_fs_dir_entries
       that tests the new ability of created_rev to differ based on
       copies.
  (lazy_copies_rev_changed): New test case for new !cross_copy_history
       behavior in svn_fs_revisions_changed.
  (test_funcs): Add new test cases: lazy_copies_created_rev,
       lazy_copies_dir_entries, lazy_copies_rev_changed.

Bill

----
Do you want a dangerous fugitive staying in your flat?
No.
Well, don't upset him and he'll be a nice fugitive staying in your flat.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sun Nov 24 03:18:26 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.