Author: stefan2
Date: Thu Nov 29 23:19:53 2012
New Revision: 1415451

URL: http://svn.apache.org/viewvc?rev=1415451&view=rev
Log:
On the fsfs-format7 branch:  A bit of refactoring.  fs_fs.c has become
huge and should be split into functional groups.  The goal is to make
format 7 extensions more localized and to open the door towards a low-
level API that allows various dev tools to directly access FSFS repo
data.

This is the step in that process.  More to come as format7 implementation
progresses.  The 3 new c/h file pairs are

- util.*       for path names, basic file I/O and parsing utilities 
- revprops.*   for code for reading, writing, caching, packing and
               upgrading revprops
- low_level.*  functions to read and write the low-level data structs
               (fragments): revision header, changes list, node revs
               and representation headers

* subversion/libsvn_fs_fs/util.h
  (RECOVERABLE_RETRY_COUNT,
   is_packed_rev,
   is_packed_revprop,
   path_format,
   path_uuid,
   path_txn_current,
   path_txn_current_lock,
   path_lock,
   path_revprop_generation,
   path_rev_packed,
   path_rev_shard,
   path_rev,
   path_revprops_shard,
   path_revprops_pack_shard,
   path_revprops,
   path_txn_dir,
   path_txn_sha1,
   path_txn_changes,
   path_txn_props,
   path_txn_next_ids,
   path_min_unpacked_rev,
   path_txn_proto_rev,
   path_txn_proto_rev_lock,
   path_txn_node_rev,
   path_txn_node_props,
   path_txn_node_children,
   path_node_origin,
   check_file_buffer_numeric,
   read_min_unpacked_rev,
   update_min_unpacked_rev,
   try_stringbuf_from_file,
   read_content,
   read_number_from_stream,
   move_into_place): lib-locally declare functions previously
   private in fs_fs.c

* subversion/libsvn_fs_fs/util.c
  (is_packed_rev,
   is_packed_revprop,
   path_format,
   path_uuid,
   path_txn_current,
   path_txn_current_lock,
   path_lock,
   path_revprop_generation,
   path_rev_packed,
   path_rev_shard,
   path_rev,
   path_revprops_shard,
   path_revprops_pack_shard,
   path_revprops,
   path_txn_dir,
   path_txn_sha1,
   path_txn_changes,
   path_txn_props,
   path_txn_next_ids,
   path_min_unpacked_rev,
   path_txn_proto_rev,
   path_txn_proto_rev_lock,
   path_txn_node_rev,
   path_txn_node_props,
   path_txn_node_children,
   path_node_origin,
   check_file_buffer_numeric,
   read_min_unpacked_rev,
   update_min_unpacked_rev,
   try_stringbuf_from_file,
   read_content,
   read_number_from_stream,
   move_into_place): move their implementation here

* subversion/libsvn_fs_fs/revprops.h 
  (write_revprop_generation_file,
   cleanup_revprop_namespace,
   upgrade_pack_revprops,
   get_revision_proplist,
   set_revision_proplist,
   packed_revprop_available,
   copy_revprops,
   pack_revprops_shard,
   delete_revprops_shard): lib-locally declare functions previously
   private in fs_fs.c

* subversion/libsvn_fs_fs/revprops.c 
  (REVPROP_CHANGE_TIMEOUT,
   ATOMIC_REVPROP_GENERATION,
   ATOMIC_REVPROP_TIMEOUT,
   ATOMIC_REVPROP_NAMESPACE): move declarations from fs_fs.c here
  (read_revprop_generation_file,
   ensure_revprop_namespace,
   ensure_revprop_generation,
   ensure_revprop_timeout,
   log_revprop_cache_init_warning,
   has_revprop_cache,
   revprop_generation_fixup,
   read_revprop_generation,
   begin_revprop_change,
   end_revprop_change,
   parse_revprop,
   read_non_packed_revprop,
   get_revprop_packname,
   parse_packed_revprops,
   read_pack_revprop,
   write_non_packed_revprop,
   switch_to_new_revprop,
   serialize_revprops_header,
   repack_revprops,
   repack_stream_open,
   write_packed_revprop): move these static functions from fs_fs.c here
  (write_revprop_generation_file,
   cleanup_revprop_namespace,
   upgrade_pack_revprops,
   get_revision_proplist,
   set_revision_proplist,
   packed_revprop_available,
   copy_revprops,
   pack_revprops_shard,
   delete_revprops_shard): move their implementation here

* subversion/libsvn_fs_fs/low_level.h 
  (HEADER_ID,
   HEADER_TYPE,
   HEADER_COUNT,
   HEADER_PROPS,
   HEADER_TEXT,
   HEADER_CPATH,
   HEADER_PRED,
   HEADER_COPYFROM,
   HEADER_COPYROOT,
   HEADER_FRESHTXNRT,
   HEADER_MINFO_HERE,
   HEADER_MINFO_CNT,
   ACTION_MODIFY,
   ACTION_ADD,
   ACTION_DELETE,
   ACTION_REPLACE,
   ACTION_RESET,
   FLAG_TRUE,
   FLAG_FALSE,
   KIND_FILE,
   KIND_DIR,
   REP_PLAIN,
   REP_DELTA,
   FSFS_MAX_PATH_LEN): make those constats public
  (rep_args_t): rename from rep_args and publish
  (svn_fs_fs__write_noderev,
   svn_fs_fs__read_noderev): moved here from fs_fs.c
  (parse_revision_trailer,
   unparse_revision_trailer,
   read_header_block,
   read_rep_offsets_body,
   read_rep_offsets,
   representation_string,
   read_rep_line,
   write_rep_line,
   read_all_changes,
   write_change_entry,
   write_changed_path_info): lib-locally declare functions previously
   private in fs_fs.c

* subversion/libsvn_fs_fs/low_level.c 
  (MAX_CHANGE_LINE_LEN): move constant here
  (read_change): move static function from fs_fs.c here
  (parse_revision_trailer,
   unparse_revision_trailer,
   read_header_block,
   read_rep_offsets_body,
   read_rep_offsets,
   svn_fs_fs__write_noderev,
   svn_fs_fs__read_noderev,
   representation_string,
   read_rep_line,
   write_rep_line,
   read_all_changes,
   write_change_entry,
   write_changed_path_info): move their implementation here

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__youngest_rev,
   svn_fs_fs__get_proplist): moved to low_level.h
  (svn_fs_fs__ensure_revision_exists): declare new API

* subversion/libsvn_fs_fs/fs_fs.c
  (): remove many constants and functions
  (svn_fs_fs__ensure_revision_exists): renamed from svn_fs_fs__revision_exists
  (rep_state_t): renamed and typedef'ed from rep_state
  (create_rep_state_body,
   create_rep_state,
   rep_read_baton,
   get_window_key,
   get_cached_window,
   set_cached_window,
   get_cached_combined_window,
   set_cached_combined_window,
   build_rep_list,
   read_delta_window,
   read_plain_window,
   get_combined_window,
   get_contents,
   delta_read_baton,
   svn_fs_fs__get_file_delta_stream,
   svn_fs_fs__add_change,
   recover_find_max_ids,
   verify_walker): update callers and signatures
  (write_final_changed_path_info): reduce as most of this is now in
   write_changed_path_info
  (recover_read_from_file_baton,
   read_handler_recover): switch to streamy API

* subversion/libsvn_fs_fs/fs.c
  (): include revprops.h

* subversion/libsvn_fs_fs/rep-cache.c
  (rep_has_been_born,
   svn_fs_fs__walk_rep_reference): update callers are rename

Added:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c
      - copied, changed from r1413382, 
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/revprops.c
      - copied, changed from r1413382, 
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/revprops.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.c
      - copied, changed from r1414758, 
subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/util.h
Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c?rev=1415451&r1=1415450&r2=1415451&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c Thu Nov 29 
23:19:53 2012
@@ -38,6 +38,7 @@
 #include "tree.h"
 #include "lock.h"
 #include "id.h"
+#include "revprops.h"
 #include "rep-cache.h"
 #include "svn_private_config.h"
 #include "private/svn_fs_util.h"


Reply via email to