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

-- 
You received this message because you are subscribed to the Google Groups 
"TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tortoisesvn-dev/20180514100320.GB4512%40ncase.
For more options, visit https://groups.google.com/d/optout.
Index: src/SVN/SVNExternals.cpp
===================================================================
--- src/SVN/SVNExternals.cpp    (revision 28126)
+++ src/SVN/SVNExternals.cpp    (working copy)
@@ -266,7 +266,7 @@
                             ( &parsedExternals
                             , path.GetSVNApiPath(pool)
                             , extvalue.c_str()
-                            , TRUE
+                            , FALSE
                             , pool));
 
     if (svnError.GetCode() == 0)

Attachment: signature.asc
Description: PGP signature

Reply via email to