[PATCH] Fix pinning when copying root-relative externals

17 views
Skip to first unread message

Patrick Steinhardt

unread,
May 14, 2018, 6:03:24 AM5/14/18
to tortois...@googlegroups.com
Hi,

Copying externals with pinning doesn't work correctly when the
external has a root-relative path with a trailing slash (e.g.
"^/trunk/"), the resulting external is simply not pinned at all.
The cause here is that you cannot reliably pass root-relative
parsed by `svn_wc_parse_externals_description3` to
`svn_client_copy7` in case where `canonicalize_url` is TRUE. As
the documentation of that function states:

If, however, the url member makes use of the recognized
(SVN-specific) relative URL syntax for svn:externals,
"canonicalization" is an ill-defined concept which may even
result in munging the relative URL syntax beyond recognition.

So what happens is that Subversion will canonicalize "^/trunk/"
to "^/trunk", which will cause the external-matching in
`pin_externals_prop` to fail.

The solution here is to disallow canonicalization of the URL,
which fixes pinning of such externals. Note though that this also
impacts the UI: where it would've previously shown the
canonicalized version of the external, the user now sees the
non-canonicalized version. The same holds true for URLs, as well.

The alternative would be to store two sets of externals, one
canonicalized version for displaying in the UI and one for
passing into Subversion functions. As that is rather cumbersome,
I settled for the easier fix. Let me know if you can think of a
better version.


The issue was discovered in version 1.9.7.


Regards
Patrick
externals.patch
signature.asc

Julian Foad

unread,
May 14, 2018, 8:54:40 AM5/14/18
to Svn dev, TortoiseSVN-dev on behalf of ps
I'm forwarding this issue, found in TortoiseSVN, to the core Svn dev
list because it looks to me like it might be relevant to core Svn. I
haven't looked closer.

- Julian
externals.patch
Reply all
Reply to author
Forward
0 new messages