Checkout Tools
  • last updated 7 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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.
* subversion/svn/list-cmd.c

(svn_cl__list): Do not allow --human-readable with --xml.

Make the option compatibility error messages from 'svn list' consistent

with those from 'svn info'.

* subversion/svn/list-cmd.c (svn_cl__list): Update error messages.

Follow up to r1847384, changing the 'svn ls -vH' output to:

- fix a bug where the size is between 1000 and 1023 units; and,

- use the locale-specific decimal separator.

* subversion/svn/list-cmd.c: Include <assert.h> for assert(),

<math.h> for fabs() and <stdio.h> for sprintf().

(get_human_readable_size):

- Update the part of the docstring about negative sizes.

- Scale to the next higher magnitude when the adjusted size is

between 1000 and 1023 units.

- Use standard sprintf() to format the displayed number, because

APR's formatter does not use locale information.

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

Fix a comment to avoid confusing wishful thinking and reality.

Make the 'svn list -v' output more human-friendly.

This change introduces two new mini-features:

- The -H, --human-readable option, which makes 'svn list -v' display

file sizes in base-2 units;

- Automatic adjustment of the width of the 'author' field in the

verbose output, within a set of limits, so that long author names

are truncated less often.

In --human-readable form, the 'size' field is narrower, so the initial

and maximum widths of the 'author' field are adjusted to maintain

the same overall width of the 'svn list -v' output.

* subversion/svn/cl.h (svn_cl__opt_state_t): Add flag 'human_readable'.

* subversion/svn/svn.c

(svn_cl__options): New option; -H, --human-readable.

(svn_cl__cmd_table): Add the -H option to the 'list' command description.

(sub_main): Handle the -H option.

* subversion/svn/list-cmd.c

(struct print_baton): Add fields 'human_readable', 'author_width'

and 'max_author_width; and moved 'ctx' to the start of the struct.

(initial_author_width, initial_human_readable_author_width,

maximum_author_width, maximum_human_readable_author_width,

normal_size_width, human_readable_size_width): New static constants.

(get_human_readable_size): New.

(print_dirent): Auto-adjust the width of the author field and select

plain or human-friendly display for the size field.

(svn_cl__list): Initialize the new fields in the print_baton structure.

  1. … 2 more files in changeset.
Work-around for our common Windows CLI limitations with 'svn ls --search'.

Since we currently can't pass typical glob patterns like "*.txt", we will

instead implicitly add '*' to the beginning and the end of all search

patterns. As a result, we will do sub-string matches similar to 'svn log'.

Note that this effects the Windows CLI client only and any other client as

well as the bindings retain their "full pattern match" semantics.

The latest discussion on that issue can be found here:

https://lists.apache.org/thread.html/828defe6827fad3d4d8cea338ca4de5962060534a2a9275c82184d4e@%3Cdev.subversion.apache.org%3E

From: Johan Corveleyn <j...@gmail.com>

Subject: list --search matching and Windows *-expansion

Date: 2017-12-18 15:20

List: dev@subversion.apache.org

* subversion/svn/list-cmd.c

(svn_cl__list): Under Windows, expand the pattern to effectively perform

a sub-string search - like we do for 'svn log --search'.

* subversion/svn/svn.c

(svn_cl__cmd_table): Under Windows, mention that we will match sub-strings

instead of whole path segments.

* subversion/tests/cmdline/basic_tests.py

(filtered_ls): Disable under Windows because sub-string matching produces

a super-set of the expected results.

  1. … 2 more files in changeset.
Change the svn_*_list APIs to use NULL as the "don't filter by pattern"

parameter instead of an empty pattern list.

Suggested by: Patrick Steinhardt (patrick.steinhardt at elegosoft.com)

* subversion/include/svn_repos.h

(svn_repos_list): Document the new PATTERN options behavior.

* subversion/libsvn_repos/list.c

(matches_any): Implement the new behavior.

(svn_repos_list): Empty lists will almost always be created by dumb

scripts. It's probably a good idea to explicitly

not waste any resources in the degenerate case.

* subversion/include/svn_ra.h

(svn_ra_list): Document the new PATTERN options behavior.

* subversion/libsvn_ra_svn/protocol

(3.1.1. Main Command Set): The patterns list in the list command is

now optional.

* subversion/libsvn_subr/log.c

(svn_log__list): Make the logging cope with NULL pattern lists.

* subversion/svnserve/serve.c

(list): Receive NULL for PATTERNS, if no list was received.

* subversion/libsvn_ra_svn/client.c

(ra_svn_list): Omit the pattern list entirely, if patterns is NULL.

* subversion/include/svn_client.h

(svn_client_list4): Document the new PATTERN options behavior.

(svn_client_list3): Update docstring.

* subversion/libsvn_client/deprecated.c

(svn_client_list3): Update implementation.

* subversion/libsvn_client/list.c

(match_patterns): Implement the new behavior.

(list_internal): Update docstring.

* subversion/svn/list-cmd.c

(svn_cl__list): If no patterns were specified, pass NULL to the API.

* subversion/svnbench/null-list-cmd.c

(svn_cl__null_list): Same.

  1. … 11 more files in changeset.
Add support for the "--search" option to the 'list' command down to the

svn_client level. Provide a simple test for it.

* subversion/include/svn_client.h

(svn_client_list4): Rev API, adding the PATTERNS parameter.

(svn_client_list3): Deprecate.

* subversion/libsvn_client/deprecated.c

(svn_client_list3): Implement the deprecated API in terms of the new one.

* subversion/libsvn_client/list.c

(match_patterns): New utility function handling the pattern matching.

(get_dir_contents,

list_internal): Add PATTERNS parameter and filter outout accordingly.

(list_external_items,

list_externals): Add PATTERNS parameter and pass it along.

(svn_client_list4): Bump signature and pass parameters on.

* subversion/svn/list-cmd.c

(svn_cl__list): Gather the --search patterns and pass them to the rev'ed

client API.

* subversion/svn/svn.c

(svn_cl__cmd_table): Enabled the '--search' option for 'list'.

* subversion/tests/cmdline/list_tests.py

(list_filtered): New test.

(test_list): Register the new test.

  1. … 5 more files in changeset.
Make 'svn ls -v file:///my/repos/tags' and 'svn ls --xml file:///my/repos/tags'

about 20 times faster on tags directories containing far too many tags

(like 8000), by simply avoiding a lot of unneeded work. (Removes 95% of the

time from profile runs). The same code is also used by svnserve, and I think

serf/mod_dav should be faster as well.

This patch simply makes the code just ask for the dirent fields that

it really cares about, thereby skipping the request for 'has_props'

which takes 95% of the time, because it fetches all properties on

all the created tags (which are stored in many different revision, thereby

getting very bad caching behavior).

Measurements on a repository that contains a repository with an

empty /trunk dir, copied as /trunk@1 to /tags/T00001 ... /tags/T08000/

each as their own revision.

The results appear to vary by the number of tags (and probably some cache

size), but for 8000 revisions this changes the processing time on a

ramdrive from 1 minute 11 to just 3 seconds.

I think we need a separate patch which allows filesystem implementations

to answer 'has props' in a cheaper way, that doesn't trash the entire

memory cache.

* subversion/svn/list-cmd.c

(print_dirent_fields,

print_dirent_fields_verbose,

print_dirent_xml_fields): New constant variables.

(svn_cl__list): Only request the required fields.

* subversion/svn/list-cmd.c

(svn_cl__list): Resolve potentially uninitialized variable usage problem.

Use SVN_VA_NULL instead of plain NULL in variable-arguments lists in all

remaining cases, as far as I can discover, following r1536307 (introducing

SVN_VA_NULL) and r1543394 (warning about missing or inappropriate sentinels for

some Subersion functions).

[Lots of implementation files]: Replace NULL with SVN_VA_NULL in function

calls with variable argument lists.

  1. … 37 more files in changeset.
* **/**

Run tools/dev/remove-trailing-whitespace.sh to remove all trailing whitespace

before we branch 1.8, like we did before creating previous branches.

No functional changes.

  1. … 199 more files in changeset.
Rename the 'pool' argument to 'scratch_pool'.

* subversion/include/svn_client.h:

(svn_client_list_func2_t): Rename the argument to scratch_pool.

* subversion/svn/list-cmd.c

(print_dirent, print_dirent_xml): Rename the argument to scratch_pool.

Patch by: Vijayaguru G <vijay{_AT_}collab.net>

  1. … 1 more file in changeset.
Remove some unnecessary code duplication.

* subversion/svn/list-cmd.c

(svn_cl__list): Remove the error composition from the if/else block both

paths use it.

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

include_externals.

(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().

(svn_client_list2): Call svn_client_list3 with include_externals set to

FALSE, and use svn_client_list_func2_t as callback implemented by

list_func_wrapper().

* 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_list3().

(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

svn_client__list_internal().

* subversion/svn/list-cmd.c

(print_baton): Add few structure members to keep track of last seen external

information.

(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/externals_tests.py

(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

'commit_include_externals'.

Patch by: Vijayaguru G <vijay{_AT_}collab.net>

Review by: stsp

julianfoad

  1. … 7 more files in changeset.
Remove the unused code since verbose option is not valid in XML listing mode.

* subversion/svn/list-cmd.c

(print_dirent_xml): Remove the unused code.

Patch by: Vijayaguru G <vijay{_AT_}collab.net>

Minor client-side speedup of svn ls.

* subversion/svn/list-cmd.c

(print_dirent): fetch localized strings only once.

Reintegrate integrate-string-improvements branch into /trunk.
  1. … 83 more files in changeset.
Revert several attempts to fix non-canonical paths in the command-line

client. Additional canonicalization had been added in an attempt to fix

issue #3609, "Assertion in svn_path_is_canonical, svn_path_join with 'file:'

URL". However, the cause was actually a problem with the URL

canonicalization function itself; see r1068476 and possibly other fixes.

As well as removing some long-standing canonicalizations, this reverts the

main changes in the following commits, but does not remove the tests that

these added: r1030010 (svn info), r1033028 (svn cat), r1033045 (svn list),

r1033411 (svn_cl__opt_parse_path).

* subversion/svn/cl.h,

subversion/svn/util.c

(svn_cl__opt_parse_path): Remove.

* subversion/svn/cat-cmd.c

(svn_cl__cat): s/svn_cl__opt_parse_path/svn_opt_parse_path/.

* subversion/svn/list-cmd.c

(svn_cl__list): Same.

* subversion/svn/checkout-cmd.c

(svn_cl__checkout): Don't canonicalize the output of svn_opt_parse_path().

* subversion/svn/info-cmd.c

(svn_cl__info): Same.

* subversion/svn/switch-cmd.c

(svn_cl__switch): Don't canonicalize the switch URL.

  1. … 6 more files in changeset.
Rename the 'svn_error_return' macro to 'svn_error_trace'.

See email thread "[RFC] Rename 'svn_error_return' to 'svn_error_trace'?" on

2011-06-23, <http://svn.haxx.se/dev/archive-2011-06/0708.shtml>.

* subversion/include/svn_error.h

(svn_error_return): Rename to svn_error_trace.

(SVN_ERR, svn_error_purge_tracing): Track the rename.

* [everywhere]: Track the rename.

  1. … 120 more files in changeset.
Fix issue #3702 'Unable to perform case-only rename on windows' by adding a

new flag to svn_client_args_to_target_array (revving it in the process), so

it can perform specialized case-canonicalization behavior for supporting

case-only renames.

* subversion/tests/cmdline/copy_tests.py

(case_only_rename): Remove XFail marker. Fix issue description according

to the changed summary of issue #3702.

* subversion/include/svn_client.h

(svn_client_args_to_target_array): Deprecate, succeeded by ...

(svn_client_args_to_target_array2): ... new function, carrying a new

argument KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION.

* subversion/libsvn_client/cmdline.c

(svn_client_args_to_target_array2): Make use of new flag

KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION to undo truepath-conversion of

the last of 2 targets if they both have the same 'truepath'.

* subversion/libsvn_client/deprecated.c

(svn_client_args_to_target_array): Implement deprecated wrapper.

* subversion/tests/libsvn_client/client-test.c

(test_args_to_target_array): Adjust caller, passing FALSE for

KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION.

[in subversion/svn]

* add-cmd.c, blame-cmd.c, cat-cmd.c, changelist-cmd.c, checkout-cmd.c,

cleanup-cmd.c, commit-cmd.c, copy-cmd.c, delete-cmd.c, diff-cmd.c,

export-cmd.c, import-cmd.c, info-cmd.c, list-cmd.c, lock-cmd.c, log-cmd.c,

merge-cmd.c, mergeinfo-cmd.c, mkdir-cmd.c, patch-cmd.c, propdel-cmd.c,

propedit-cmd.c, propget-cmd.c, proplist-cmd.c, propset-cmd.c,

relocate-cmd.c, resolve-cmd.c, resolved-cmd.c, revert-cmd.c, status-cmd.c,

switch-cmd.c, unlock-cmd.c, update-cmd.c, upgrade-cmd.c:

Adjust callers, passing FALSE for KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION.

* move-cmd.c: Adjust caller, passing TRUE for

KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION.

* cl.h

(svn_cl__args_to_target_array_print_reserved): Add new parameter

KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION.

* util.c

(svn_cl__args_to_target_array_print_reserved): Add new parameter

KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION, passing it to

svn_client_args_to_target_array2.

  1. … 41 more files in changeset.
* subversion/svn/list-cmd.c

(svn_cl__list): If one of the targets is a non-existent URL or

wc-entry, don't bail out. Just warn and move on to the next

target. Also return a non-zero error code and print an error message

at the end in those situations.

* subversion/tests/cmdline/basic_tests.py

(ls_non_existent_wc_target, ls_non_existent_url_target,

ls_multiple_wc_targets, ls_multiple_url_targets): New tests.

(test_list): Add reference to new tests.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

  1. … 1 more file in changeset.
Add a wrapper function svn_cl__opt_parse_path() for svn_opt_parse_path(),

that canonicalizes the resulting dirent/URL.

Make use of new function in "ls" and "cat" commands.

* subversion/svn/cl.h,

subversion/svn/util.c

(svn_cl__opt_parse_path): New function.

* subversion/svn/list-cmd.c (svn_cl__list),

subversion/svn/cat-cmd.c (svn_cl__cat):

Use svn_cl__opt_parse_path() instead of svn_opt_parse_path() followed

by canonicalizing.

Suggested by: julianfoad

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

  1. … 3 more files in changeset.
[issue 3609] Assertion failed errors when the url has encoded characters.

Canonicalize paths before passing them to svn_client_list2.

* subversion/svn/list-cmd.c

(svn_cl__list): Canonicalize url or dirent before passing over to API.

* subversion/tests/cmdline/basic_tests.py

(ls_url_special_characters): New test

(test_list): Add new test.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

  1. … 1 more file in changeset.
Test out my new and fancy ASF commit priviledges by changing the copyright

wording in our license headers to reflect ownership by the ASF.

* NOTICE:

Change terminology to ASF, and update a link.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the ASF, and update the project website.

* everywhere:

Change license text to reflect ASF ownership.

  1. … 891 more files in changeset.
Relicense Subversion under the Apache License, Version 2.0.

* NOTICE: New.

* LICENSE: New.

* COPYING,

subversion/LICENSE: Remove.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the SVN Corp, and that it contains contributions from

many people, as referenced in NOTICE.

* subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS:

Relicense the SVN parts under Apache 2.0.

* everywhere:

Change copyright notices in file headers to reflect the Apache 2.0 license.

  1. … 882 more files in changeset.
* subversion/svn/list-cmd.c

(print_dirent, print_dirent_xml): Squish a few path/dirent/uri deprecation

warnings.