On Thu, Oct 22, 2009 at 18:21, Hyrum K. Wright
<hyrum_wright_at_mail.utexas.edu> wrote:
> I went to the trouble to read the format number so that it would fit within
> our existing "oops, I've got a format number higher than I know what to do
> with" paradigm. I realize we could just set it to 99 or something equally
> as bogus, but that felt too hacky and grabbing the format number is a single
> function call.
>
> But frankly, whatever performance difference that exists shouldn't matter
> very much anyway, since this is an error condition, and that condition isn't
> likely to be hit. (What I *would* like, though, would be a way to say
> "you're part of the wc-ng working copy rooted at /bar/gruff/foo". Oh well.)
You can do that, no problem. Have is_inside_wc_ng() raise that
specific error, rather than returning a version number. It knows the
root of the wc-ng tree.
And since it is raising an error, it doesn't even have to get into the
format number game. It has two options: raise an error, or return 0
for "not a wc". Simpler, *and* you get what you want.
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2410494
Received on 2009-10-23 03:56:53 CEST