Julian Foad wrote:
> Branko Čibej wrote:
>> way to report the actual format (from the wc-db) through libsvn-wc to
>> the client?
>  
> Ah yes, there is no API for that, [...]

These exist on the branch currently ("*_supported_*" are new on the branch):

- At libsvn_client (public):
    svn_client_version()  // e.g. svn_version_t("1.15.0-dev")
    svn_client_supported_wc_version()  // e.g. svn_version_t("1.8.0")

- In libsvn_wc (internal declarations):
    SVN_WC__VERSION  // e.g. "32" for svn 1.15-dev
    SVN_WC__SUPPORTED_VERSION  // e.g. "31" for svn 1.8 through 1.14

- Conversion between WC format number and svn_version_t:
    svn_wc__format_from_version()  // exposed in svn_wc_private.h
    svn_wc__version_string_from_format()  // internal only

I suggest:

- Keep the SVN_WC__* constants internal, as they are.

- Expose *both* conversion functions equally as private APIs. No reason
not to, and I think the new --wc-format option in the test suite is
going to need them. (I could wait and see if it does; I'm writing it
now.) One already is in svn_wc_private.h. The other says:

   * ### It's not ideal to encode this sort of knowledge in this low-level
   * library.  On the other hand, it doesn't need to be updated often and
   * should be easily found when it does need to be updated.  */

which applies equally to both and is fine for private APIs.

- Expose the min and max WC format numbers privately in
svn_wc_private.h. It seems perverse not to, when higher level APIs
exist. Code outside libsvn_wc, such as wc tests, will need or want
these. (I can wait and see if it does. I'm writing it soon.)

  svn_wc__format()  // e.g. "32" for svn 1.15-dev
  svn_wc__supported_format()  // e.g. "31" for svn 1.8 through 1.14

There is no libsvn_client API for getting the WC format number directly.
I suppose it makes sense that client-level code is written with
reference to client-level version numbers.

- Julian



Reply via email to