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

Re: TSVNCache questions

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-11-21 21:46:24 CET

Robert Roessler wrote:

> To quote someone who is well-known around here, "Look again"... :)

Ok, lets:

if (I->at(I->size()-1)=='*')
{
        stdstring str = I->substr(0, I->size()-1);
        if (_tcsnicmp(str.c_str(), path, str.size())==0)
                return TRUE;
        if (str.size() && (str.at(str.size()-1) == '\\') &&
        (_tcsnicmp(str.c_str(), path, str.size()-1)==0))
                return TRUE;
}
else if (_tcsicmp(I->c_str(), path)==0)
        return TRUE;
else if (I->size() && (I->at(I->size()-1) == '\\') &&
        (_tcsnicmp(I->c_str(), path, I->size()-1)==0))
        return TRUE;

> AFAICT (and it's not *my* code), the compare at line 274 is exactly
> equivalent to the compare at line 269 (part of the referred-to "if
> complex" at line 264) - for Include patterns path\* and path\ .
>
> Once the prefix substring str has been pulled from the front of the
> particular Include entry, it no longer contains the trailing * ... which
> makes the 'n' compares at line 269 and line 274 equivalent.

But you're forgetting that we're comparing against the paths we get e.g.
from the shell.
Example:

path = "c:\usr\Test\file" // the path we're asked to check
*I = "c:\usr\Test*" // line in the include paths

First check (str is now "c:\usr\Test"):
if (_tcsnicmp(str.c_str(), path, str.size())==0)

This compares:
"c:\usr\Test" against "c:\usr\Test", because only the first 11 chars are
compared. And it evaluates to 'equal'. Which means: even if 'path' is
much longer than the string in your include path, as long as the first
part of the string matches, it's 'equal'.

Second check (if no * is at the end of the include path):
if (_tcsicmp(I->c_str(), path)==0)

this will evaluate to 'not equal' since 'path' is longer than *I (the
include path).

> I actually am still interested in *why* I can't realize all that extra
> efficiency of ONLY processing ONE directory tree on my entire system for
> TSVN overlays... ;)

Because some people only want to see that their working copy is
versioned and don't care to see the overlays inside it (yes, I know, I
don't understand those people either, but that's what was requested).

> Finally, given the difficulties with documenting and/or implementing
> TSVNCache's current approach to Include/Exclude logic, perhaps Apache's
> solution might be of interest: allow the user to supply the test
> ordering semantics vis-a-vis the Order directive from htaccess files?

Given the fact that a normal user doesn't understand such an ordering, I
think we should keep it that way.

And given the fact that with your help ( :) ) I realized that
programming is harder than it looks, I'm going to ask my boss for a raise :)

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Wed Nov 21 21:46:38 2007

This is an archived mail posted to the TortoiseSVN Users mailing list.

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