Checkout Tools
  • last updated 2 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
  1. … 3 more files in changeset.
Whitespace changes only. No functional change.

* subversion/svn/info-cmd.c

(find_print_what, print_info_item): Reindent blocks from last commit.

'info': Support multiple items in --show-item, as tab-separated values (TSV).

Suggested by: brane

Thread:

.

https://mail-archives.apache.org/mod_mbox/subversion-dev/201911.mbox/%3Cf6dc88d3-8227-4f22-768c-2cf6ce70fcb7%40apache.org%3E

Date: Thu, 7 Nov 2019 17:28:35 +0100

From: Branko Čibej <brane@apache.org>

To: dev@subversion.apache.org

Subject: svn status tabbed output [was: Re: svn status should not show unmodified files in changelists]

Message-ID: <f6dc88d3-8227-4f22-768c-2cf6ce70fcb7@apache.org>

* subversion/svn/info-cmd.c

(print_info_baton_t::print_what): Rename to..

(print_info_baton_t::print_whats): .. this.

(find_print_what): Rename argument and parse it as a list.

(print_info_item): Track changes to the baton.

(svn_cl__info): Track changes to the baton.

* subversion/svn/svn.c

(svn_cl__options."show_item"): Update docstring.

* subversion/tests/cmdline/info_tests.py

(info_item_simple): Extend existing test case to unit test this feature.

Blocks that haven't been reindented in this commit will be reindented in the

next commit.

  1. … 3 more files in changeset.
Add 'changelist' option to 'svn info --show-item'.

* subversion/svn/info-cmd.c

(info_item_t,

info_item_map): Add 'changelist' item.

(print_info_item): Print it.

* subversion/svn/svn.c

(svn_cl__options): Document it.

  1. … 1 more file in changeset.
Consolidate file size formatting for 'svn info' and 'svn list'.

* subversion/svn/cl.h

(svn_cl__size_unit_t): Renamed and extended from svn_cl__unit_base_t.

(svn_cl__opt_state_t): New field 'file_size_unit' replaces the

'human_readable' flag. All users updated.

(svn_cl__format_file_size): Renamed from svn_cl__get_unit_file_size.

* subversion/svn/filesize.c

(get_base2_unit_file_size, get_base10_unit_file_size): Tweak some comments.

(svn_cl__format_file_size): Renamed from svn_cl__get_unit_file_size.

Also handle formatting for XML and for normal output.

* subversion/svn/info-cmd.c

(print_info_baton_t): 'file_size_unit' replaces the 'human_readable' flag.

(print_info_xml): Use svn_cl__format_file_size() in XML mode.

(print_info): Use only svn_cl__format_file_size() for file sizes.

(print_info_item): Likewise.

(svn_cl__info): Allow unit-based file size output with --show-item.

* subversion/svn/list-cmd.c

(print_baton): 'file_size_unit' replaces the 'human_readable' flag.

(print_dirent): Use only svn_cl__format_file_size() for file sizes.

(print_dirent_xml): Use svn_cl__format_file_size() in XML mode.

(svn_cl__list): Update for changes to svn_cl__opt_state_t.

* subversion/svn/svn.c

(sub_main): Handle the new file_size_unit field in svn_cl__opt_state_t.

* subversion/tests/cmdline/info_tests.py

(info_item_size_repos): Add two new test modes.

  1. … 5 more files in changeset.
Combine base-2 and base-10 unit file size conversion into a single API,

with a common implementation for the identical bits.

* subversion/svn/cl.h

(svn_cl__unit_base_t): New enumeration.

(svn_cl__get_base2_unit_file_size,

svn_cl__get_base10_unit_file_size): Removed. Replaced by ...

(svn_cl__get_unit_file_size): ... this new function.

* subversion/svn/filesize.c

(filesize_order_t): New common struct.

(get_order_index, format_size): New; refactored common code.

(get_base2_unit_file_size): Reworked from svn_cl__get_base2_unit_file_size.

(get_base10_unit_file_size): Reworked from svn_cl__get_base10_unit_file_size.

(svn_cl__get_unit_file_size): Implement.

* subversion/svn/info-cmd.c (print_info): Use svn_cl__get_unit_file_size().

* subversion/svn/list-cmd.c (print_dirent): Likewise.

  1. … 3 more files in changeset.
Teach 'svn info' to show human-readable file sizes.

* subversion/svn/cl.h (svn_cl__get_base2_unit_file_size): New prototype.

* subversion/svn/filesize.c: New file.

(svn_cl__get_base2_unit_file_size): Implement. Moved here from list-cmd.c.

* subversion/svn/list-cmd.c: Remove unused includes.

(get_human_readable_size): Remove. Implementation moved to filesize.c.

(print_dirent): Use svn_cl__get_base2_unit_file_size().

* subversion/svn/info-cmd.c

(print_info_baton_t): New member 'human_readable'.

(print_info): Optionally print human-readable file sizes.

(svn_cl__info): Handle option --human-readable.

* subversion/svn/svn.c (svn_cl__cmd_table): Add -H to 'svn info'.

  1. … 4 more files in changeset.
Show in-repository sizes of files with 'svn info'.

The file size is only displayed if the target of 'svn info' is a file URL.

With --show-item=repo-size, an error is returned if the target is a single

local path. However, if there are multiple local targets (e.g., in recursive

mode), nothing at all will be printed, since there are no valid results.

* subversion/libsvn_client/info.c

(DIRENT_FIELDS): Add SVN_DIRENT_SIZE to the mask, otherwise recursive

queries do not return file sizes, which is inconsistent with the

non-recursive or single-target case.

* subversion/svn/info-cmd.c

(info_item_t): Add new enumeration, info_item_repos_size.

(info_item_map): Map "repos-size" to info_item_repos_size.

(print_info_xml): If the file size is available, add a "size"

attribute to the <entry/> node.

(print_info): Print the file size if it's available.

(print_info_item): Handle info_item_repos_size.

* subversion/svn/svn.c (svn_cl__options): Describe --show-item=repos-size.

* subversion/tests/cmdline/info_tests.py

(info_item_size_wc_recursive,

info_item_size_repos,

info_item_size_repos_recursive) New test cases.

(info_item_failures): Test the size-of-WC-target failure mode.

  1. … 3 more files in changeset.
Move all experimental APIs to the private namespace.

Part of issue SVN-4775 "Add x- prefix to experimental APIs".

* subversion/include/svn_client.h

(svn_client__layout_func_t): Renamed from 'svn_client_layout_func_t'.

(svn_client__layout_list): Renamed from 'svn_client_layout_list'.

(svn_client_shelf_*): Rename to 'svn_client__shelf_*'.

* subversion/include/private/svn_client_private.h

(svn_client__shelf_diff): Track the renames.

* subversion/libsvn_client/diff.c

(diff_shelf): Track the renames.

* subversion/libsvn_client/layout.c

(client_layout_baton_t,

svn_client__layout_list): Track the renames.

* subversion/libsvn_client/shelf.c

Track the renames.

* subversion/libsvn_client/status.c

(shelf_status): Track the renames.

* subversion/svn/info-cmd.c

Track the renames.

* subversion/svn/shelf-cmd.c

Track the renames.

  1. … 7 more files in changeset.
'svn info --x-viewspec': Expose both output backends.

* subversion/svn/cl.h

(svn_cl__opt_state_t::viewspec): Change from boolean to three-valued enum.

* subversion/svn/svn.c

(svn_cl__options."x-viewspec": Update arity and docstring.

(viewspec_from_word): New.

(sub_main): Parse new argument.

* subversion/svn/info-cmd.c

(cl_layout_list): Update signature. Add docstring.

(svn_cl__info): Percolate new argument.

  1. … 2 more files in changeset.
* subversion/svn/info-cmd.c

Define SVN_EXPERIMENTAL at top of file to suppress warnings where we

knowingly call experimental APIs.

Add 'schedule' and 'depth' items to 'svn info --show-item'.

* subversion/svn/info-cmd.c

(info_item_t,

info_item_map,

print_info_item): Add schedule and depth items.

* subversion/svn/svn.c

(svn_cl__options): Document them.

* tools/client-side/svn-viewspec.py

Accidentally add a debug print.

[This change reverted in r1827187.]

  1. … 2 more files in changeset.
* subversion/svn/info-cmd.c

(output_svn_viewspec_py): Omit the revision header line as well when

omitting revnums.

Viewspec: make the output of revision numbers optional.

There is no UI for this yet.

* subversion/svn/info-cmd.c

(layout_list_baton_t): Add a 'with_revs' field.

(output_svn_command_line,

output_svn_viewspec_py): Only output revnums if requested.

(cl_layout_list): Request revnums.

* subversion/svn/info-cmd.c

(output_svn_viewspec_py): Only report revisions that are changed.

Viewspec: support output in a new 'svn-viewspec.py' format 2.

This does not yet provide a way to select the svn command-line format,

or svn-viewspec.py format 1, although the code to do is still present.

* subversion/svn/info-cmd.c

(layout_list_baton_t): Add a format selector.

(depth_to_viewspec_py): Support 'excluded'.

(output_svn_viewspec_py): Support 'excluded' and revisions and switched.

(cl_layout_list): Set the format number to 2.

Viewspec: support output in 'svn-viewspec.py' format 1.

This does not yet provide a way to select the svn command-line format,

although the code to do is still present.

* subversion/svn/info-cmd.c

(output_svn_command_line): Rename from 'layout_func'.

(depth_to_viewspec_py,

output_svn_viewspec_py): New.

(cl_layout_list): Call it.

Viewspec: Format the output in columns for easier human reading.

* subversion/svn/info-cmd.c

(layout_func): Format the output in columns. Deduplicate.

(cl_layout_list,

svn_cl__info): Tweak source formatting.

Viewspec: Add an experimental viewspec output command.

Part of issue SVN-4753 "SVN viewspec feature".

This reports the current layout of the working copy, in terms of switched

URLs, mixed revisions, and mixed depths.

The current CLI command is:

svn info --viewspec [PATH]

The current output is in the form of a series of 'svn' commands which can

be used as command-line input to recreate the layout, although the behaviour

when doing so is not optimal.

Patch by: rhuijben

(tweaked by me)

* subversion/include/svn_client.h

(svn_client_layout_func_t,

svn_client_layout_list): New.

* subversion/libsvn_client/layout.c

New file.

* subversion/svn/cl.h

(svn_cl__opt_state_t): Add a 'viewspec' option.

* subversion/svn/info-cmd.c

(layout_list_baton_t,

layout_func,

cl_layout_list): New.

(svn_cl__info): Call it.

* subversion/svn/svn.c

(svn_cl__longopt_t,

svn_cl__options): Add a 'viewspec' option.

(svn_cl__cmd_table): Let the 'info' command take the option.

(sub_main): Parse the option.

  1. … 4 more files in changeset.
'svn info --show-item': Don't print trailing whitespace after revision

numbers that comprise 8 digits or less.

* subversion/svn/info-cmd.c

(print_info_item_revision): As above.

* subversion/tests/cmdline/info_tests.py

(info_item_simple): Change the expectation from unanchored regexp

match to string equality, to catch the above bug.

  1. … 1 more file in changeset.
* subversion/svn/info-cmd.c

(print_info): Use the new libsvn_client APIs to determine whether a node is

the victim of a text, prop, or tree conflict.

Replace calls to svn_client_conflict_from_wc_description2_t() with calls

to svn_client_conflict_get(). These calls are equivalent, except that the

latter needs a client context and a local abspath. The abspath is taken from

svn_wc_conflict_description2_t for now, since that's where our info/status

APIs put it. The context can be passed down from callers.

* subversion/svn/info-cmd.c

(print_info_baton_t): Add 'ctx' client context member.

(print_info_xml, print_info): Use svn_client_conflict_get().

(svn_cl__info): Wire up 'ctx' in baton.

* subversion/svn/status.c

(print_status): Use svn_client_conflict_get().

  1. … 1 more file in changeset.
Start representing multiple conflicts on a path in svn_client_conflict_t.

Add a private libsvn_wc API to obtain all conflicts at a path and use this

API in libsvn_client to store information about all conflicts in

svn_client_conflict_t.

* subversion/include/private/svn_wc_private.h

(svn_wc__read_conflict_descriptions2_t): Declare.

* subversion/include/svn_client.h

(svn_client_conflict_get, svn_client_conflict_from_wc_description2_t):

Change return value to svn_error_t * and add output argument 'conflict'.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_t): Add 'prop_conflicts', and replace desc2 with

three pointers legacy_text_conflict, legacy_prop_conflict, and

legacy_tree_conflict.

(add_legacy_desc_to_conflict, get_conflict_desc2_t): New helper functions.

(conflict_get_internal): New helper function derived from the former

svn_client_conflict_get() function.

(svn_client_conflict_get, svn_client_conflict_from_wc_description2_t):

Re-implement as wrappers around conflict_get_internal().

(svn_client_conflict_get_kind, svn_client_conflict_get_operation,

svn_client_conflict_get_incoming_change,

svn_client_conflict_get_local_change,

svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_get_incoming_new_repos_location,

svn_client_conflict_tree_get_victim_node_kind,

svn_client_conflict_prop_get_propname,

svn_client_conflict_prop_get_propvals,

svn_client_conflict_prop_get_reject_abspath,

svn_client_conflict_text_get_mime_type,

svn_client_conflict_text_get_contents): Use get_conflict_desc2_t() helper.

* subversion/libsvn_wc/conflicts.c

(svn_wc__read_conflict_descriptions2_t): Implement as wrapper around the

svn_wc__read_conflicts() function.

* subversion/svn/conflict-callbacks.c

(svn_cl__conflict_func_interactive): Update this caller of

svn_client_conflict_from_wc_description2_t().

* subversion/svn/info-cmd.c

(print_info_xml, print_info): Update these callers of

svn_client_conflict_from_wc_description2_t().

* subversion/svn/status.c

(print_status): Update this caller of

svn_client_conflict_from_wc_description2_t().

  1. … 6 more files in changeset.
Fix another shadowed local variable introduced in r1687498.

* subversion/svn/info-cmd.c

(print_info): Don't shadow 'desc'.

Found by: philip

Introduce svn_client_conflict_t and start making use of it in the resolver.

Right now, this new opaque type simply wraps the old struct. This is required

to keep the current resolver implementation working for now.

The plan is to develop new resolver functionality using the new type and

eventually phase out the old struct entirely.

* subversion/include/svn_client.h

(svn_client_conflict_t, svn_client_conflict_get,

svn_client_conflict_from_wc_description2_t): Declare.

(svn_client_conflict_get_kind,

svn_client_conflict_get_local_abspath,

svn_client_conflict_get_operation,

svn_client_conflict_get_incoming_change,

svn_client_conflict_get_local_change,

svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_get_incoming_new_repos_location,

svn_client_conflict_tree_get_victim_node_kind,

svn_client_conflict_prop_get_propname,

svn_client_conflict_text_get_mime_type,

svn_client_conflict_text_get_contents): Expect svn_client_conflict_t.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_t, svn_client_conflict_get,

svn_client_conflict_from_wc_description2_t): Implement.

(svn_client_conflict_get_kind,

svn_client_conflict_get_local_abspath,

svn_client_conflict_get_operation,

svn_client_conflict_get_incoming_change,

svn_client_conflict_get_local_change,

svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_get_incoming_new_repos_location,

svn_client_conflict_tree_get_victim_node_kind,

svn_client_conflict_prop_get_propname,

svn_client_conflict_text_get_mime_type,

svn_client_conflict_text_get_contents): Use svn_client_conflict_t.

* subversion/svn/cl-conflicts.h

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

svn_cl__append_conflict_info_xml): Expect svn_client_conflict_t.

* subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_prop_conflict_description,

svn_cl__get_human_readable_tree_conflict_description,

append_tree_conflict_info_xml,

svn_cl__append_conflict_info_xml): Expect svn_client_conflict_t.

* subversion/svn/conflict-callbacks.c

(show_diff, show_conflicts, handle_text_conflict, handle_prop_conflict,

handle_tree_conflict, conflict_func_interactive): Use svn_client_conflict_t.

(svn_cl__conflict_func_interactive): Convert svn_wc_conflict_description2_t

to svn_client_conflict_t and use that.

* subversion/svn/info-cmd.c

(print_info_xml, print_info): Convert svn_wc_conflict_description2_t to

svn_client_conflict_t and use that.

* subversion/svn/status.c

(print_status): Convert svn_wc_conflict_description2_t to

svn_client_conflict_t and use that.

  1. … 6 more files in changeset.
Replace macros svn_client_conflict_get_src_left_version() and

svn_client_conflict_get_src_right_version() with a new set of

functions returning the same information. Replace some use of

the svn_wc_conflict_version_t structure with a few individual

parameters and variables.

* subversion/include/svn_client.h

(svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_get_incoming_new_repos_location): Declare.

(svn_client_conflict_get_src_left_version,

svn_client_conflict_get_src_right_version): Delete.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_get_repos_info,

svn_client_conflict_get_incoming_old_repos_location,

svn_client_conflict_get_incoming_new_repos_location): Implement.

* subversion/svn/cl-conflicts.c

(svn_cl__get_human_readable_tree_conflict_description,

add_conflict_version_xml, append_tree_conflict_info_xml): Update callers.

* subversion/svn/cl.h

(svn_cl__node_description): Expect several input parameters instead of

a single svn_wc_conflict_version_t struct. Otherwise, callers would now

have to create a temporary struct containing the same information.

* subversion/svn/conflict-callbacks.c

(handle_tree_conflict): Update caller.

* subversion/svn/info-cmd.c

(print_info): Update caller.

* subversion/svn/util.c

(svn_cl__node_description): Use several input parameters instead of struct.

  1. … 6 more files in changeset.
Follow-up to r1687290: Fix more test fallout.

* subversion/svn/info-cmd.c

(print_info) Don't use svn_client_conflict_text_get_contents() with non-text

conflicts.

Replace conflicted file content accessor macros with a single function.

The accessors svn_client_conflict_get_base_abspath(),

svn_client_conflict_get_my_abspath(), and

svn_client_conflict_get_their_abspath() are replaced by a new function

called svn_client_conflict_text_get_contents(). For now, this function

returns the same outputs (absolute paths) but this may change in future.

* subversion/include/svn_client.h

(svn_client_conflict_text_get_contents): Declare.

(svn_client_conflict_get_base_abspath, svn_client_conflict_get_my_abspath,

svn_client_conflict_get_their_abspath): Remove.

* subversion/libsvn_client/resolved.c

(svn_client_conflict_text_get_contents): Implement. This implementation

is not complete yet since the WC base content it could return is not

always available in the svn_wc_conflict_description2_t struct.

* subversion/svn/cl-conflicts.c

(svn_cl__append_conflict_info_xml): Update caller.

* subversion/svn/conflict-callbacks.c

(show_diff, show_conflicts, handle_text_conflict,

conflict_func_interactive): Update callers.

* subversion/svn/info-cmd.c

(print_info): Update caller.

  1. … 4 more files in changeset.
Stop exposing the property reject file path in the API and in 'svn info'.

Make 'svn info' show the names of conflicted properties instead.

* subversion/include/svn_client.h

(svn_client_conflict_get_prop_reject_abspath): Remove, now unused.

* subversion/svn/info-cmd.c

(print_info): Show a list of conflicted property names instead of

the path to the property reject file.

* subversion/tests/cmdline/merge_tree_conflict_tests.py

(merge_conflict_details): Adjust expected info output.

* subversion/tests/cmdline/move_tests.py

(move_conflict_details): Adjust expected info output.

* subversion/tests/cmdline/prop_tests.py

(dir_prop_conflict_details): Adjust expected info output.

* subversion/tests/cmdline/update_tests.py

(update_conflict_details): Adjust expected info output.

  1. … 5 more files in changeset.
Follow-up to r1686880:

* subversion/svn/info-cmd.c

(print_info): Fix a couple of test failures introduced by r1686880. Avoid

calling a now tree-conflict-specific function on non-tree conflicts.