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

Re: bug: on update of svn:keywords, old value is not used to un-apply old keywords before attempted merging

From: John Peacock <jpeacock_at_rowman.com>
Date: 2005-09-30 17:26:39 CEST

Vincent Starre wrote:
> Basically: when doing the /diff/, use the old svn:keywords, then only use the new
> svn:keywords for the actual application of keywords.

I'd have to look at the code, but there is the distinct possibility that
the old svn:keywords isn't available at the point of merging. In any
case, this isn't cause of the conflict, per se. If you continue to
leave Id in svn:keywords, you'll see that you still get a conflict (in
the first example from your script).

AIUI, what happens is that the WC file is compared against the textbase
copy, which is not expanded. If there is keyword expansion involved,
the WC file is unexpanded and only then compared against the textbase.
If the only difference is between expanded and unexpanded that isn't a
conflict. But you changed the same line that Subversion is expecting to
be unexpanded, so it _is_ a conflict. See below for the way to prevent
this from happening (as I don't see any way to do it programmatically).

> My situation, just to provide a clear picture:
> We added $Id$ tags to all files. This in itself was an annoying commit,
> simply because it effected every file, everyone had to check what was
> being merged. Not SVN's fault there, just the kind of tedium expected
> whenever you make a change to all files (like updating a copyright
> notice, etc- we await user-defined keywords for the glory of
> $Copyright$, of course ;) )
>
> And then we decided we wanted to go from $Id$ to $Revision$ $Date$,
> simply because we dont like showing off our valid system account names
> to everybody.
>
> Of course, we removed Id from svn:keywords because, hey, we werent using
> it.
>

Apply this diff to your original example script (watch for line wrap):

$ diff bugtest.orig bugtest
--- bugtest.orig 2005-09-30 10:49:22.308719856 -0400
+++ bugtest 2005-09-30 10:51:07.318544448 -0400
@@ -10,6 +10,8 @@ svn propset svn:keywords 'Id' keywords/k
  svn ci keywords -m "keyword conflict test (commit 2)"
  svn update keywords
  echo -e 'AAA\nBBB\n$Revision$\n$Date$\nCCC\nDDD\nEEE\nFFF\nGGG' >
keywords/keyed
+svn ci keywords -m "keyword conflict test (commit 2b)"
+svn update keywords
  svn propset svn:keywords 'Revision Date' keywords/keyed
  svn ci keywords -m "keyword conflict test (commit 3)"
  svn update keywords

And you'll see that there are no conflicts anywhere. The problem was
both changing the text on the already expanded line _and_ changing the
svn:keywords at the same time. It _is_ a conflict then because the same
line did change in two different ways (locally modified by keyword
expansion _and_ locally modified by changing that line).

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 Fri Sep 30 17:27:36 2005

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.