stsp, julianfoad


r1414304 | julianfoad | 2012-11-27 12:21:47 -0600 (Tue, 27 Nov 2012)

Fix issue #4225, "Add '--include-externals' option to svn list".

* subversion/include/svn_client.h
  (svn_client_list_func2_t): New type used to notify externals information.
  (svn_client_list_func_t): Deprecate type.
  (svn_client_list3): New function, which has a new argument
  (svn_client_list2): Deprecate it.

* subversion/libsvn_client/client.h
  (svn_client__list_internal): New function.
  (svn_client__list_externals): New function.

* subversion/libsvn_client/deprecated.c
  (list_func_wrapper_baton): New struct to deprecate svn_client_list2().
  (list_func_wrapper, wrap_list_func): Helper functions to deprecate
  (svn_client_list2): Call svn_client_list3 with include_externals set to
    FALSE, and use svn_client_list_func2_t as callback implemented by

* subversion/libsvn_client/externals.c
  (list_external_items): New static function that walks through all the
    externals under list target recursively and list them using
  (svn_client__list_externals): New function to parse externals description
    and list it using list_external_items().

* subversion/libsvn_client/list.c
  (get_dir_contents): Populate the hash table 'externals'. Use
    svn_client_list_func2_t instead of svn_client_list_func_t to report file
    and directory entries. Use external_parent_url and external_target when
    external items are being listed.
  (svn_client__list_internal): New function. Same as svn_client_list3(), it
    accepts few additional parameters that carries external information.
    If include_externals is set, process all the externals which are populated
    by get_dir_contents() using svn_client__list_externals().
  (svn_client_list3): New function, thin wrapper around

* subversion/svn/list-cmd.c
  (print_baton): Add few structure members to keep track of last seen external
  (print_dirent): Implement svn_client_list_func2_t to control the output when
    used with externals.
  (print_dirent_xml): Implement svn_client_list_func2_t. Enclose the external
    items in the element <external parent_url=.. target= ..><..></external>
  (svn_cl__list): Call svn_client_list3(). Handle if there are any errors
    during externals processing.

* subversion/svn/main.c
  (svn_cl__cmd_table): Enable include_externals for 'list' and give a short
    description about the option.

* subversion/tests/cmdline/
  (include_externals): Rename it to 'commit_include_externals'.
  (list_include_externals): New test.
  (test_list): Add a reference to the new test. Rename 'include_externals' to

Patch by: Vijayaguru G <vijay{_AT_}>
Review by: stsp, julianfoad