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

Re: PATCH: $Header$ handling + existing BUG of $HeadURL$ now also in $Header$?

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-07-22 19:56:58 CEST

C.A.T.Magic wrote:
> but there is also a negative side to using $Header$ in SVN:
> because $Header$ alsways contains the full repository path,
> it is also containing the 'TAG' path.
> $Header: /Tags/foo-20040501/test.txt,v 5 2004/07/22 16:39:38 cat Exp $
> $Header: /Tags/foo-20040608/test.txt,v 8 2004/07/22 16:39:38 cat Exp $
>
> this means that you get different file content for _all_ files,
> dependent on the tag you used to checkout the file,
> even if the rest of the file is identical.

That's a feature, not a bug. If you export from a tag, any keywords which
reflect the path in the repository must display the current location in the
repository, regardless of whether the file has changed from wherever it was
copied from (TRUNK is not special in this regard).

> In CVS the path and version always remains the same if the file is
> unmodified.

And that's *loss* of information.

>
>
> does this patch ensure that svn switch visits ALL files containing
> $Header$ and update them correctly?

You misunderstand how keywords work in general. The client code only interprets
a keyword at the point in time the file is changed (either through an update,
checkout, or export). There is no code that walks through the WC and re-expands
keywords based on some external event _if the file itself hasn't been changed_.

> #>cat file.txt
> $HeadURL: file:///Repos/file.txt $
>
> #>svn switch file:///Repos/TAG/file.txt file.txt
>
> #>cat file.txt
> $HeadURL: file:///Repos/file.txt $
>
> ^^^^ but this should now be Repos/TAG/ !

'switch' does not imply 'update' here; the file hasn't changed between TRUNK and
TAG, so the client does not update the file (i.e. re-expand the keywords).

>
> #>del file.txt
> #>svn update file.txt
> #>type file.txt
> $HeadURL: file:///Repos/TAG/file.txt $
>
> ^^^^ only works if file is deleted first.

Now you have forced the client to regenerate the keyword (by deleting the file).
  'svn up' is not sufficient on it's own to regenerate keywords; whether it
should be is a matter of debate. I'm incline to think it should, but that might
entail much more client-side activity than would seems fruitful.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 22 19:56:53 2004

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.