[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Fwd: [PATCH] Fix pinning when copying root-relative externals

From: Julian Foad <julianfoad_at_apache.org>
Date: Mon, 14 May 2018 13:54:36 +0100

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

-------- Forwarded Message --------
Subject: [PATCH] Fix pinning when copying root-relative externals
Date: Mon, 14 May 2018 12:03:20 +0200
From: TortoiseSVN-dev on behalf of ps <tortoisesvn-dev_at_googlegroups.com>
To: tortoisesvn-dev_at_googlegroups.com

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

Received on 2018-05-14 14:54:41 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.