New code should use the two-pool paradigm pool names.  So, let's do it
for the index.* functions that don't do it yet, have only a single POOL,
shouldn't have two and don't have the signature defined by the cache
interface.

IOW, just rename a bunch of pool parameters and update the doc strings
accordingly.

* subversion/libsvn_fs_fs/index.h
  (svn_fs_fs__l2p_proto_index_open): The POOL is the RESULT_POOL. 
  (svn_fs_fs__l2p_proto_index_add_revision,
   svn_fs_fs__l2p_proto_index_add_entry,
   svn_fs_fs__l2p_index_append): The POOL is a SCRATCH_POOL; there is no
                                 result to be allocated.
  (svn_fs_fs__p2l_proto_index_open): The POOL is the RESULT_POOL. 
  (svn_fs_fs__p2l_proto_index_add_entry,
   svn_fs_fs__p2l_proto_index_next_offset,
   svn_fs_fs__p2l_index_append,
   svn_fs_fs__p2l_entry_lookup,
   svn_fs_fs__item_offset,
   svn_fs_fs__p2l_get_max_offset): The POOL is a SCRATCH_POOL; there is
                                   no result to be allocated.

* subversion/libsvn_fs_fs/index.c
  (packed_stream_open): The POOL is the RESULT_POOL.
  (write_entry_to_proto_index,
   encode_l2p_page): The POOL is a SCRATCH_POOL.
  (svn_fs_fs__l2p_proto_index_open,
   svn_fs_fs__l2p_proto_index_add_revision,
   svn_fs_fs__l2p_proto_index_add_entry,
   svn_fs_fs__l2p_index_append): Mirror header / API changes.
  (get_l2p_page_info,
   get_l2p_page_table): The result is a pre-allocated struct.
                        The POOL is just a SCRATCH_POOL.
  (get_l2p_page): The only allocations done here are for the result.
  (l2p_index_lookup,
   l2p_proto_index_lookup): The result is pre-allocated.
                            The POOL is just a SCRATCH_POOL.
  (get_l2p_header): All allocations are for the result.
  (svn_fs_fs__item_offset,
   svn_fs_fs__p2l_proto_index_open,
   svn_fs_fs__p2l_proto_index_add_entry,
   svn_fs_fs__p2l_proto_index_next_offset,
   svn_fs_fs__p2l_index_append): Mirror header / API changes.
  (get_p2l_page_info): The result is a pre-allocated struct.
                       The POOL is just a SCRATCH_POOL.
  (get_p2l_page): All allocations are for the result.
  (get_p2l_keys,
   p2l_get_max_offset): The result is pre-allocated.
                        The POOL is just a SCRATCH_POOL.
  (svn_fs_fs__p2l_get_max_offset): Mirror header / API change.
  (calc_fnv1): The result is written to a pre-allocated struct.
               The POOL is just a SCRATCH_POOL.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1626871 13f79535-47bb-0310-9956-ffa450edef68
Remove unused parameter.

* subversion/libsvn_fs_fs/index.c
  (read_entry): POOL parameter is not used -> remove it.
  (get_p2l_page): Update caller.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1626873 13f79535-47bb-0310-9956-ffa450edef68
Switch FSFS index.c internal functions to using two pools.

Even though the callers will eventually pass the same pool to both
parameters, this still gives better readability / documentation and
is consistent with what we do elsewhere in this module.

* subversion/libsvn_fs_fs/index.c
  (get_l2p_header_body): Have two pool parameters now.  Writing to the
                         cache needs only a temporary pool.
  (get_l2p_page_info): Update caller.
  (get_l2p_header): Add SCRATCH_POOL parameter as we can now pass it
                    through to a sub-function.
  (svn_fs_fs__l2p_get_max_ids): Update caller.
  (get_p2l_header): Have two pool parameters now.  Writing to the cache
                    needs only a temporary pool.
  (get_p2l_page_info): Update caller.
  (get_p2l_entry_from_cached_page): Have two pool parameters now.  Only
                                    the returned object needs to be
                                    allocated in the RESULT_POOL.
  (p2l_entry_lookup_func,
   p2l_get_max_offset): Update callers.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1626886 13f79535-47bb-0310-9956-ffa450edef68
* buildcheck.sh: Look for libtoolize rather than libtool, add some
   more candidate names.

* autogen.sh: Add more candidate names to match buildcheck.sh.

Patch by: Helmut Grohne <helmut{_AT_}subdivi.de>
          me


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627276 13f79535-47bb-0310-9956-ffa450edef68
* buildcheck.sh: Add comment.
* autogen.sh: Add comment.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627325 13f79535-47bb-0310-9956-ffa450edef68
Tweak ra_serf report xml generation code a tiny bit to use the shorter
'<element />' notation for elements that are always just markers for
enabling a feature instead of '<element></element>'.

This simplifies and shortens the requests a tiny bit and returns a few of
those requests to their easier to process neon form.

* subversion/libsvn_ra_serf/blame.c
  (create_file_revs_body): Use short form for merge info flag.

* subversion/libsvn_ra_serf/commit.c
  (create_checkout_body): Use short form for element.

* subversion/libsvn_ra_serf/get_lock.c
  (create_getlock_body): Use short form for element.

* subversion/libsvn_ra_serf/lock.c
  (create_lock_body): Use short form for two elements.

* subversion/libsvn_ra_serf/log.c
  (create_log_body): Use short form for quite a few elements.

* subversion/libsvn_ra_serf/merge.c
  (create_merge_body): Use short form for quite a few elements.

* subversion/libsvn_ra_serf/ra_serf.h
  (svn_ra_serf__add_empty_tag_buckets): New function.

* subversion/libsvn_ra_serf/xml.c
  (svn_ra_serf__add_empty_tag_buckets): New function.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627333 13f79535-47bb-0310-9956-ffa450edef68
Use the information from the EXTERNALS storage to drive the
relocation of externals, instead of the svn:externals property.

* subversion/libsvn_client/relocate.c
  (relocate_externals): Remove function. Fold into caller.
  (svn_client_relocate2): Read EXTERNALS instead of getting and parsing
    svn:externals.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627338 13f79535-47bb-0310-9956-ffa450edef68
A stylistic follow-up to r1627333.

* subversion/libsvn_ra_serf/blame.c
  (create_file_revs_body): Use SVN_VA_NULL rather than plain NULL.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627483 13f79535-47bb-0310-9956-ffa450edef68
Switch FSFS index API functions that could actually use two different pool
parameters to the two-pool paradigm.

Although almost all current callers will pass the same (temporary) pool to
both parameters, this patch improves consistency, readability and
documentation.

* subversion/libsvn_fs_fs/index.h
  (svn_fs_fs__p2l_index_lookup,
   svn_fs_fs__p2l_entry_lookup,
   svn_fs_fs__l2p_get_max_ids): Accept two pools instead of one.

* subversion/libsvn_fs_fs/index.c
  (p2l_index_lookup): The POOL parameter is actually a SCRATCH_POOL. All
                      results are flat data stored in the pre-allocated
                      *ENTRIES result.
  (svn_fs_fs__l2p_get_max_ids,
   svn_fs_fs__p2l_index_lookup): Only the result array needs to be allocated
                                 in the RESULT_POOL. It contains flat data
                                 and no pointers.
  (svn_fs_fs__p2l_entry_lookup): Use the SCRATCH_POOL with function calls
                                 only require a temporary pool.

* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__check_rep,
   block_read): Update caller by passing the same pool to both parameters.
                That pool is already for temporaries only.

* subversion/libsvn_fs_fs/pack.c
  (pack_range,
   append_revision): Same.
  (pack_log_addressed): Update caller, actually providing different pools.

* subversion/libsvn_fs_fs/verify.c
  (compare_l2p_to_p2l_index): Same.
  (compare_p2l_to_l2p_index,
   compare_p2l_to_rev): Update caller by passing the same temporary pool
                        to both parameters.

* subversion/svnfsfs/dump-index-cmd.c
  (dump_index): Same.

* subversion/svnfsfs/stats-cmd.c
  (read_log_rev_or_packfile): Same.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627497 13f79535-47bb-0310-9956-ffa450edef68
As per convention, iteration pools shall be named "iterpool".

* subversion/libsvn_fs_fs/index.c
  (svn_fs_fs__p2l_index_append): s/iter_pool/iterpool/g.

* subversion/libsvn_fs_x/index.c
  (svn_fs_x__p2l_index_create): Same.

* tools/dev/fsfs-access-map.c
  (parse_file): Same.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627498 13f79535-47bb-0310-9956-ffa450edef68
As per convention, sub-pools shall be named "subpool".

* subversion/libsvn_fs_base/fs.c
  (svn_fs_base__clean_logs): s/sub_pool/subpool/g.

* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__rep_chain_length): Same.

* subversion/libsvn_fs_x/cached_data.c
  (svn_fs_x__rep_chain_length): Same.

* tools/dev/fsfs-access-map.c
  (open_file): Same.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627502 13f79535-47bb-0310-9956-ffa450edef68
* tools/client-side/svn-vendor.py
  Remove stale references to svn-import.py (original name under which this
  script was submitted); reformat to <79 characters/line.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627828 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_x/cached_data.c
  (svn_fs_x__rep_chain_length): The sub-pool is actually an iteration pool
                                used in a non-standard way.  Rename and
                                document the usage.

Suggested by: rhuijben


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627946 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__rep_chain_length): Document the pool usage / cleanup strategy
                                 No functional change.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627947 13f79535-47bb-0310-9956-ffa450edef68
Make sure the svn_fs_t remains valid after calls to svn svn_fs_upgrade.

If we make the creation of cache instances contingent upon the initial
FS format, those instances will not be available after the FS upgrade.
And if those cache instances are mandatory with the new format, we may
segfault.

* subversion/libsvn_fs_fs/caching.c
  (svn_fs_fs__initialize_caches): Always create all cache instances that
                                  are mandatory for some FS format even if
                                  the current format would not need them.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627948 13f79535-47bb-0310-9956-ffa450edef68
Don't silently corrupt revisions that need a format upgrade due to a
background FS upgrade.  See here and the new test case for a detailed
reproduction:

https://mail-archives.apache.org/mod_mbox/subversion-dev/201409.mbox/%3CCABw-3Yfv_N4OcLWbCi-EDv6OphRst%3DZ77p14TxaX92ZcEyhxWw%40mail.gmail.com%3E

To fix this, we need to re-read the format info at the beginning of the
commit procedure.  Provide a private API function to do that.  Finally,
add the test case provided by Ivan.

Reported by: ivan

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__read_format_file): Declare new private API function.

* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__read_format_file): Implement it, mostly by taking code out
                                 of ...
  (svn_fs_fs__open): ... this.  Use the new function here instead.

* subversion/libsvn_fs_fs/transaction.c
  (commit_body):  The actual 1-line fix.

* subversion/tests/libsvn_fs/fs-test.c
  (upgrade_while_committing): New test case.
  (test_funcs): Register new test.



git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627949 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_fs_x/noderevs.c
  (binary_id_t): Remove outdated comment. No functional change.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627950 13f79535-47bb-0310-9956-ffa450edef68
* subversion/include/svn_fs.h
  (SVN_FS_CONFIG_FSFS_SHARD_SIZE): Document that this option is usually
                                   ignored. No functional change.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627958 13f79535-47bb-0310-9956-ffa450edef68
Address a very theoretical fringe case.  We implicitly assume that chars
are of uniform size on all systems, specificly that they are 8 bits wide.
So, make that assumption explicit.

One problem is that our data files and network streams specify lenght
values in multiples of chars while actually transmitting a specific number
of bits.  On systems with e.g. 32 bit chars, we can not expect or rely on
OS / libs to convert between 8 and 32 bits.

* subversion/include/private/svn_dep_compat.h
  (): Error out if chars are defined as something other than 8 bits.
      Allow for skipping that check by defining SVN_ALLOW_NON_8_BIT_CHARS.

* notes/knobs
  (SVN_ALLOW_NON_8_BIT_CHARS): Document this new compile time option.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627962 13f79535-47bb-0310-9956-ffa450edef68
Pin the FSFS f7 item type to a fixed-length data type.
Make sure we use that type consistently.

* subversion/libsvn_fs_fs/index.h
  (svn_fs_fs__p2l_entry_t): Fix the item type to 32 bits which is way
                            more than we'll ever need and which aligns
                            nicely with the rest of the struct.

* subversion/libsvn_fs_fs/index.c
  (read_entry): Remove unnecessary type conversion.

* subversion/libsvn_fs_fs/cached_data.c
  (dbg_log_access): Always use uint32 to hold item types.

* subversion/libsvn_fs_fs/transaction.c
  (write_container_rep,
   write_container_delta_rep,
   write_final_rev): Same.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1627966 13f79535-47bb-0310-9956-ffa450edef68