Checkout
Julian Foad
committed
on 30 Apr 18
Fix pattern-matching of the top level path in a listing with search.

svn list -v PATH --search=PATTERN

The output for the top level PATH… Show more
Fix pattern-matching of the top level path in a listing with search.

 svn list -v PATH --search=PATTERN

The output for the top level PATH will now be included when a

PATTERN matches the last component of its path-within-repository,

or the empty string for the repository root path. This is consistent with

matching all other paths in the listing.

Until now, and since the feature was introduced in r1767186, the top

level path was reported only when a pattern matched the entire

path-within-repository, starting with "/", of PATH's *parent* directory.

For example,

 svn ls -v ^/subversion/trunk/README --search=PATTERN

reported the top-level path only if PATTERN matched

"/subversion/trunk".

Note that "-v" is specified in these examples because otherwise "svn"

omits the top-level path when it is a directory.

* subversion/libsvn_client/list.c

 (list_internal): Match the basename, not the dirname, of the top level

   path.

* subversion/libsvn_repos/list.c

 (svn_repos_list): Same.

* subversion/tests/cmdline/basic_tests.py

 (filtered_ls): Extend to test both server- and client-side code paths.

 (filtered_ls_top_level_path): New test.

 (test_list): Run it.

* subversion/tests/libsvn_repos/repos-test.c

 (test_list): Expect the top level path also to match.

Show less