Checkout Tools
  • last updated 25 mins ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 873319 is being indexed.

Follow up r33240 with a fix for the canonicalization of UNC server names.

This should handle the Windows buildbot test failures.

* subversion/libsvn_subr/path.c

(svn_path_canonicalize): Fix decision on when a path is UNC or not.

* subversion/tests/libsvn_subr/path-test.c


test_is_canonical): Add some basic test cases.

  1. … 1 more file in changeset.
On Windows, convert the disc letter of file:// URIs and the server name of

UNC paths to lower case during canonicalization. This is in line with the

approach chosen to fix issue #2475.

* subversion/libsvn_subr/path.c

(svn_path_canonicalize): Convert drive letter if file:// URIs and server

name in UNC paths to lower case. Adds small optimization for checking

empty hostname paths.

* subversion/tests/libsvn_subr/path-test.c


test_is_canonical): Add extra test cases for file:// URIs and UNC paths.

  1. … 1 more file in changeset.
Fix issue #2475: scheme and domain name in urls should be handled case


During canonicalization of urls, the scheme and domain name are now converted to

lower case. This is more practical than doing expensive url comparisons where we

use a simple strcmp right now.

As the entries files can now contain non-canonical urls, these will be

canonicalized during wc upgrade.

* subversion/libsvn_subr/path.c

(global): Include apr_uri.h

(svn_path_canonicalize): Convert the scheme and hostname part of a uri to lower


* subversion/include/svn_path.h

(svn_path_canonicalize): Add comment.

* subversion/libsvn_wc/wc.h

(SVN_WC__VERSION): Add comment on changes between wc format 9 and 10.

(SVN_WC__CHANGED_CANONICAL_URLS): Add new tag for wc format 10.

* subversion/libsvn_wc/entries.c

(read_url): New function that reads an url from an entries files and takes into

account the changed canonicalization in wc format 10.

(read_entry): Add argument entries_format for use when reading urls.

(read_entries): Read the format from the entries file.

* subversion/tests/libsvn_subr/path-test.c


test_is_canonical): Add some extra testcases for case insensitive scheme and


* subversion/tests/cmdline/

(change_case_of_hostname): Utility function, changes case of hostname

of an uri.


path_copy_in_repo_2475): New tests.

(test_list): Run the new tests, both pass.

  1. … 5 more files in changeset.
Canonicalise URIs which have an empty hostname part correctly.

This fixes the crash described in #2116 ('svn log file:///'

results in a failed assertion).

* subversion/libsvn_subr/path.c

(svn_path_canonicalize): We used to strip the trailing slash

of URIs with no hostname, e.g. http:// got canonicalised to http:/

Don't do that!

* subversion/tests/libsvn_subr/path-test.c

(test_canonicalize): Add some test cases for the above.

* subversion/libsvn_ra_local/split_url.c

(svn_ra_local__split_URL): Treat file:// equivalent to file:///.

This function used to complain about a missing hostname when

just passed "file://". But "file://" is the canonical version

of "file:///", which is equivalent to "file://localhost/".

skip_uri_scheme() (in subversion/libsvn_subr/path.c) and

therefore svn_path_is_url() have been considering "file://"

a valid URL since r14445.

Review by: danielsh

  1. … 2 more files in changeset.
* subversion/libsvn_subr/path-test.c


Add two testcases for trailing slashes.

Fix a bug which caused filenames with a single character before the

extension to not split correctly.

* subversion/libsvn_subr/path.c

(svn_path_splitext): Fix an off-by-one error.

* subversion/tests/libsvn_subr/path-test.c

(test_splitext): Update test to cover the bug fixed here.

Found by: MsShu

  1. … 1 more file in changeset.
Remove assertions and other debugging code ifdef'd with

NDEBUG if debugging is not enabled at compile time.

So far, this code was always compiled in, even in releases.

In path handling functions, assert that paths supplied

are canonical when debugging is enabled. This isn't new,

some functions already did so before this change, but now

it is consistent, and together with the above change,

doing this now actually makes sense.

* subversion/libsvn_subr/path.c

(is_canonical): Document, extend a little, and rewrite partly

for obviousness. This function has been around for much longer

than svn_path_is_canonical, and tries to provide the same

functionality, but does not quite match up. Confine its use

to functions that don't have a pool around.

(svn_path_join, svn_path_join_many, svn_path_add_component,

svn_path_remove_component, svn_path_dirname, svn_path_basename,

svn_path_is_empty, svn_path_compare_paths, svn_path_is_child,

svn_path_decompose, svn_path_is_single_path_component,

svn_path_split_if_file): When debugging is enabled, assert that

paths supplied are canonical, using svn_path_is_canonical if possible,

otherwise using is_canonical. The API requires all paths supplied to

be canonical. Some of these functions have already done the same

assertion with is_canonical before, but for a few the assertion was

commented out because the call to strlen involved was considered

expensive This is debugging code, it's not supposed to

perform well, it's a safety net.

* subversion/tests/libsvn_subr/path-test.c

(test_is_single_path_component): Don't use a non-canonical path

in test set, the API being tested here does not support this.

This was only working because the assertion in the function

being tested was commented out.

* Compile with -DNDEBUG if debugging is off.

  1. … 2 more files in changeset.
Add a C test for svn_path_is_canonical.

* subversion/tests/libsvn_subr/path-test.c

(test_is_canonical): New.

(test_funcs): Run it.

Add some testcases for svn_path* functions.

Note that one of the testcases shows that our use of svn_path functions on both

urls and dir entries is neither well documented nor correct. Solving issue

#1711 should fix this.

* subversion/tests/libsvn_subr/path-test.c

(test_path_is_ancestor): Add some new testcases.

(test_get_longest_ancestor): ... And here too.

Make the code in skip_uri_scheme() a little clearer and add some more

tests for svn_path_is_url() which uses skip_uri_scheme().

* libsvn_subr/path.c


Add a note that a scheme may not contain a / character.

Have the for loop return early if a / is found before a :.

* tests/libsvn_subr/path-test.c


Add some more corner cases to check svn_path_is_url().

  1. … 1 more file in changeset.
New public svn_path_compose() to mirror svn_path_decompose(), it takes

an apr_array_header_t and returns a path.

* subversion/include/svn_path.h


New function.

* subversion/libsvn_subr/path.c


Implement the new function.

* subversion/tests/libsvn_subr/path-test.c


New function that checks that

path == svn_path_compose(svn_path_decompose(path))


Add test_compose to this array.

* subversion/bindings/swig/core.i

Tell swig to ignore svn_path_compose() and not to wrap it.

  1. … 3 more files in changeset.
* subversion/tests/libsvn_subr/path-test.c:

Wrap a line to fit within 80 characters.

Channeling Erik Hülsmann, remove all trailing whitespace within our source


for extsn in c h cpp java py pl rb; do

sed -i -e 's/[ \t]*$//' `find . -name "*.$extsn" | xargs grep '[ \t]$' -l`


Inspired by: ehu

  1. … 449 more files in changeset.
Follow up r24755: Fix VS.NET build issue.

* subversion/tests/libsvn_subr/path-test.c

(test_compare_paths): replace "foo\xe0bar" with "foo\xe0""bar" to avoid

a "too big for character" build error.

Finish issue #2641 - svnadmin dump path ordering bug.

Fix an issue with svn_path_compare_paths()'s ordering logic triggered

by just the wrong combination of paths which use extended ASCII

(high-bit-set) characters.

* subversion/libsvn_subr/path.c

(svn_path_compare_paths): Use an unsigned character comparison

instead of a signed one.

* subversion/tests/libsvn_subr/path-test.c

(test_compare_paths): Extend this test with data that triggers the

problem case.

  1. … 1 more file in changeset.
Teach svn_path_splitext() to handle dotfiles correctly.

* subversion/libsvn_subr/path.c

(svn_path_splitext): Effectively ignore the first period in a file's

basename when checking for an extension.

* subversion/tests/libsvn_subr/path-test.c

(test_funcs): No longer expect test_splitext() to fail.

  1. … 1 more file in changeset.
* subversion/tests/libsvn_subr/path-test.c

(test_splitext): Fix and grow the dotfile splitext tests.

Test how svn_path_splitext() handles dotfiles, too.

In IRC, eh, maxb and I agreed that the file ".foo" has no extension,

and the file ".foo.txt" has an extension of "txt". However, this is

not how Python's os.path.splitext() handles said files, and so is not

the way I originally wrote svn_path_splitext(). So, expect this test

to fail now until I fix svn_path_splitext().

* subversion/tests/libsvn_subr/path-test.c

(test_splitext): Test the handling of dotfiles, too.

(test_funcs): Expect test_splitext() to fail now.

Recover some path tests reverted in r23907.

* subversion/tests/libsvn_subr/path-test.c

(test_is_root): add testcases for checking root of windows-like path names.

Make it clear that svn_path_is_root only accepts directories, not uri's.

* subversion/include/svn_path.h

* subversion/libsvn_subr/path.c

(svn_path_is_root): renamed this function ...

(svn_dirent_is_root): ... to this, thereby removing ambiguity on the type

of paths that are accepted. Also rename the path parameter to dirent.

(is_canonical): replace svn_path_is_root with svn_dirent_is_root.

Replace svn_path_is_root with svn_dirent_is_root in all these places:

* subversion/libsvn_client/commit.c


* subversion/libsvn_client/merge.c


* subversion/libsvn_repos/repos.c


* subversion/libsvn_subr/target.c


* subversion/libsvn_subr/lock.c


* subversion/libsvn_wc/update_editor.c


* subversion/tests/libsvn_subr/path-test.c


  1. … 8 more files in changeset.
Reverted the windows path handling code added to fix issue #1711 and #2556.

It seems that most path functions are used to handle both uri's and local

directories. While that's no problem on posix platforms, on windows an uri

'c:hi/test' should be handled different than the directory 'c:hi/test'.

More info on the dev mailing list archive:

Reverted revs: r23761, r23757, r22553, r22544, r22542, r22458, r22381,

r22349, r21621, r21591 and r21369.

* subversion/libsvn_subr/path.c: remove all windows-path handling specific

modifications to the existing path functions.

(svn_path_is_root): kept this function for now, as it's already used to

fix issue elsewhere.

* subversion/include/svn_path.h:

(svn_path_is_absolute): removed function

* subversion/tests/libsvn_subr/path-test.c: remove all windows-path handling

specific tests for the path functions.

* subversion/tests/cmdline/

(update_wc_on_windows_drive): test is now failing, mark as XFail

* subversion/tests/cmdline/

(verify_windows_paths_in_repos): test is now passing

* subversion/tests/cmdline/

(windows_paths_in_repos): test is now passing

  1. … 5 more files in changeset.
Fix for issue #2739: avoid aborting when committing in a working copy on the

root of a drive, don't try to lock the parent folder of '/'.

* subversion/libsvn_subr/path.c

(get_path_ancestor_length): make '/' the shared common part of '/folder1' and


* subversion/tests/libsvn_subr/path-test.c

(test_get_longest_ancestor): add test case for above scenario

  1. … 1 more file in changeset.
Follow-up to r23303 : more unit tests for svn_path_splitext.

* subversion/tests/libsvn_subr/path-test.c

(test_splitext): add extra test cases

Follow-up to r23303, fixing some minor stuff found in a review of that

commit by Peter Lundblad <>.

* subversion/include/svn_path.h

(svn_path_dirname): Fix some typos.

* subversion/libsvn_subr/path.c

(svn_path_splitext): Add an early out when NULL is passed for both

path_root and path_ext. Also, simplify the last-slash search to

look only after the last period.

* subversion/tests/libsvn_subr/path-test.c

(test_splitext): Test calls to svn_path_splitext() where NULL is

provided for each of the path_root and path_ext return parameters.

  1. … 2 more files in changeset.
Introduce a new svn_path_splitext() function, our version of Python's

os.path.splitext(). I'll be using this for MIME-type autodetection stuff.

* subversion/include/svn_path.h,

* subversion/libsvn_subr/path.c

(svn_path_splitext): New.

* subversion/tests/libsvn_subr/path-test.c

(test_splitext): New test of the svn_path_splitext() function.

(test_funcs): Add a reference to the new test_splitext() function.

  1. … 2 more files in changeset.
Final fixes to make the path functions support Windows and UNC paths on

Windows and Cygwin.

* subversion/libsvn_subr/path.c

(svn_path_join): add separator only when needed.

(svn_path_join_many): reimplement to avoid calls to svn_path_is_root, add

separator only when needed.

(svn_path_remove_component): can't remove components from root paths.

(get_path_ancestor_length): fix handling of UNC paths and some special

cases of Windows paths.

* subversion/tests/libsvn_subr/path-test.c

(test_funcs): mark test_get_longest_ancestor, test_remove_component and

test_join as PASSing.

  1. … 1 more file in changeset.
Fix some path functions to support windows and UNC paths (again), both on

Win32 and Cygwin.

* subversion/libsvn_subr/path.c

(svn_path_dirname): don't try to split a root path in segments. Add support

for Windows paths on Cygwin.

(svn_path_basename): fix to support Windows paths on Cywgin.

(svn_path_is_child): fix some special cases involving UNC paths. Add support

for Windows paths on Cygwin.

(previous_segment, svn_path_basename, svn_path_is_ancestor,

svn_path_canonicalize): fix to support Windows paths on Cywgin.

* subversion/tests/libsvn_subr/path-test.c

(test_path_is_child): add new testcase

(test_funcs): mark test_path_is_child, test_path_split and test_dirname as

passing again.

  1. … 1 more file in changeset.
Improve the performance of svn_path_is_root by replacing the call to

apr_filepath_root with a custom implementation. Because the new

implementation doesn't require a pool, it's removed from the signature

and all callers are updated.

* subversion/libsvn_subr/path.c

(svn_path_is_root): new custom implementation, remove pool from signature.

(is_canonical, svn_path_join, svn_path_join_many,

previous_segment, svn_path_basename, get_path_ancestor_length,

svn_path_is_child): remove the pool from the call to svn_path_is_root.

* subversion/include/svn_path.h

(svn_path_is_root): remove the pool parameter from the function signature

* subversion/libsvn_client/commit.c

(svn_client_commit4): remove the pool from the call to svn_path_is_root.

* subversion/libsvn_subr/target.c

(svn_path_condense_targets): remove the pool from the call to


* subversion/libsvn_wc/lock.c

(svn_wc_adm_open_anchor): remove the pool from the call to svn_path_is_root.

* subversion/libsvn_wc/update_editor.c

(check_wc_root): remove the pool from the call to svn_path_is_root.

* subversion/tests/libsvn_subr/path-test.c

(test_remove_component): remove the pool from the call to svn_path_is_root.

  1. … 6 more files in changeset.
Remove or change tests on non-canonical UNC paths.

* subversion/tests/libsvn_subr/path-test.c

(test_path_split, test_dirname,

test_remove_component, test_is_absolute,

test_path_is_ancestor, test_get_longest_ancestor):

do not test a non-canonical path, neither accept a non-canonical

path as result.

All tests for handling X: or X:/ paths on Windows should also work on Cygwin.

* subversion/tests/libsvn_subr/path-test.c

(test_path_is_child, test_path_split, test_join,

test_basename, test_dirname, test_canonicalize,

test_remove_component, test_is_root, test_is_absolute,

test_path_is_ancestor, test_compare_paths,

test_get_longest_ancestor): combine the Windows and Cygwin tests.