MantisBT - CMake
View Issue Details
0010200CMakeModulespublic2010-01-29 03:512016-06-10 14:31
Marcel Loose 
Marcel Loose 
normalminoralways
closedmoved 
CMake-2-8 
 
0010200: FindSubversion: Subversion_WC_INFO macro should not do SEND_ERROR
IMHO the macro Subversion_WC_INFO in FindSubversion.cmake should not do
a SEND_ERROR, when the 'svn info' command fails. This makes the macro
useless if you want to be able to use it both on SVN working copies and
SVN exported trees. Either make this behaviour configurable, or change
it to STATUS (or WARNING, but that's not supported for CMake < 2.8)

See this thread http://www.mail-archive.com/cmake@cmake.org/msg26749.html [^]
on the mailing list, where Erik Johansson posted his proposed change.
FindSubversion
? SubversionIsWc.cmake (1,661) 2011-04-20 06:36
https://public.kitware.com/Bug/file/3827/SubversionIsWc.cmake
Issue History
2010-01-29 03:51Marcel LooseNew Issue
2010-08-31 16:59David ColeNote Added: 0022040
2010-09-13 09:03Marcel LooseAssigned To => Marcel Loose
2010-09-13 09:03Marcel LooseStatusnew => assigned
2010-09-13 10:51Marcel LooseNote Added: 0022210
2010-09-13 11:10David ColeNote Added: 0022212
2010-09-28 09:04Marcel LooseNote Added: 0022371
2010-09-28 10:29David ColeNote Added: 0022372
2011-04-20 06:36Johannes WienkeFile Added: SubversionIsWc.cmake
2011-04-20 06:37Johannes WienkeNote Added: 0026231
2011-04-20 07:12Marcel LooseNote Added: 0026232
2011-06-24 12:41Aaron C. MeadowsNote Added: 0026965
2011-06-24 14:53Aaron C. MeadowsTag Attached: FindSubversion
2012-08-28 06:05Marcel LooseStatusassigned => backlog
2016-06-10 14:27Kitware RobotNote Added: 0041647
2016-06-10 14:27Kitware RobotStatusbacklog => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0022040)
David Cole   
2010-08-31 16:59   
We will not be addressing this for the upcoming CMake 2.8.3 release.

(Unless the existing module maintainer responds, or a new one comes forward to take up the mantle...)
(0022210)
Marcel Loose   
2010-09-13 10:51   
I'm a bit hesitant to apply the patch suggested by Erik Johansson. My main objection is the fact that the option ERROR_QUIET not only suppresses the error message, but also ignores it. Two effects influenced by one option: not good.

Maybe we should just forget about this ERROR_QUIET option and change the SEND_ERROR into a WARNING?

Besides that, Subversion_WC_LOG(<dir>) will also fail when the <dir> is not a working copy, just like Subversion_WC_INFO.
(0022212)
David Cole   
2010-09-13 11:10   
I think we should leave this one alone.

I liked your suggestion, Marcel, in this part of that email thread:
http://www.mail-archive.com/cmake@cmake.org/msg26808.html [^]

Leave the existing functionality alone: if a Subversion_WC_* macro is invoked on a non-working-copy directory, then it *should* be an error.

However, adding the ability to detect whether a directory *is* an svn working copy would be absolutely brilliant. (If 'svn info' succeeds, then it is a working copy... otherwise not -- you don't have to look for existence of ".svn" or anything...)

I think we should add a function called "Subversion_IS_WC" that returns true if the directory is a working copy, false otherwise.

And leave the existing functions as is.
(0022371)
Marcel Loose   
2010-09-28 09:04   
Using 'svn info' to check whether a directory is a working copy or not puts the Subversion_WC_INFO in a somewhat strange position.

On the one hand you argue that invoking any Subversion_WC_* macro on a non-working copy directory should be treated as an error. On the other hand you suggest to use Subversion_WC_INFO -- well, actually 'svn info' -- to check whether it's a working copy or not.

Of course I could implement a Subversion_IS_WC macro that would simply execute 'svn info' and return its result. However, if all I'm really interested in is the WC_INFO stuff, then I'd have to call Subversion_WC_INFO next, which would execute 'svn info' a second time; a bit of a waste.
(0022372)
David Cole   
2010-09-28 10:29   
I am of the strong opinion that any Subversion_WC_* function should produce an error if called on a non-working-copy directory.

Please preserve the error so that projects expecting a working copy will produce an error if given directories that are not working copies.

Other than that, I don't really care about any further implementation details.

Feel free to fix this as you see fit.
(0026231)
Johannes Wienke   
2011-04-20 06:37   
Just in case someone is still interested, I've attached an implementation of Subversion_IS_WC.
(0026232)
Marcel Loose   
2011-04-20 07:12   
Thanks Johannes. I will have a closer look at it when I have time, but currently I'm very busy.
(0026965)
Aaron C. Meadows   
2011-06-24 12:41   
I'm coming late to this discussion, but why not have Subversion_WC_INFO set the variable ${prefix}_FOUND or ${prefix}_NOT_FOUND based on if this is a WC? That would allow all of the state to be externally visible and handled by the caller however they like, and also follows a well established CMake method of doing things.
(0041647)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.