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

Re: [BUG] Conflict with use-commit-times = yes + svn:keywords set

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-11-02 22:40:51 CET

Eric Gillespie wrote:

>>I'll look at my keywords-as-hash patch and see if I can tell if
>>I fixed that bug and produce a mini-patch which fixes it for
>>the next 1.1.x release.
>
>
> That would be super-sweet :).
>

This would fix your example (watch for wrapped lines):

$ diff -u subversion/libsvn_subr/subst.c.orig subversion/libsvn_subr/subst.c
--- subversion/libsvn_subr/subst.c.orig 2004-11-02 16:20:47.813832592 -0500
+++ subversion/libsvn_subr/subst.c 2004-11-02 16:26:16.454871560 -0500
@@ -271,7 +271,13 @@
          }
        else
          {
- /* ...but do nothing. */
+ if ((buf_ptr[0] == ':')
+ && (buf_ptr[1] == '$')) /* "$keyword:$" */
+ {
+ /* don't store the colon in the repository */
+ buf_ptr[0] = '$';
+ *len = 2 + keyword_len;
+ }
          }
        return TRUE;
      }

But this is not going to be a general solution. This is all coming back
to me now.

The problem is that if the file is committed with an "expanded keyword"
but without having the svn:keywords property set for that keyword, then
the code doesn't have a chance to unexpand the keyword when committing.
  i.e. (using your example script):

        $ echo '$Id:$' > wc/file2

        $ svn add wc/file2

        $ svn ci -m '' wc
        Adding wc/file2
        Transmitting file data .
        Committed revision 2.

        $ svn ps svn:keywords Id wc/file2
        property 'svn:keywords' set on 'wc/file2'

        $ svn ci -m '' wc
        Sending wc/file2

        Committed revision 3.

        $ svnadmin dump -q repo | grep Id
        Id
        $Id$
        $Id:$
        Id

and I in fact wonder if that is what is happening in the cvs2svn case
(the property being set after the file is committed), since the existing
code looks like it should properly unexpand any enabled keywords, _but
only on the initial commit_.

I think you are right; Subversion needs to not pay attention to any
expanded keywords in the repository. I'm not going to get that working
this afternoon... ;)

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 2 22:40:50 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.