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

Possible bug in keyword replacement (revisited, with examples)

From: David Budworth <dbudworth_at_eloan.com>
Date: 2004-04-07 22:35:47 CEST

Sorry about reporting with less concrete info before, hope this is more

Attached is the exact script that generated this output. (works on
linux, not sure for cygwin).

I'm trying to re-produce my merge shows extra files issue, but it seems
to be something specific with my tree as I can't create the problem
from scratch.

Environment: MDK 10, svn 1.0.1. Also happens with webdab/apache and
other linux'

basic summary: If you turn on keyword substitution for 'Id', and add
the tag to your file as
$Id:$ (as in, the way CVS requires, therefore coded in many template
classes for us)
You will get diffs and conflicting merge updates on the $Id$ tag itself.

It appears that it gets stored in the repo as $Id:$, but when doing a
diff, the client strips it down to $Id$ and sees it as a conflicting

Note: purely adding a space after the colon "$Id: $" makes this go
away, as well as leaving the colon out all together.

session is as follows (it's just a bash -v script, so it outputs
everything done):

[svn@svn test]$ ./keyword_issue.sh
#!/bin/bash -v

cd `dirname $0`
dirname $0

## setup vars to make rest of script easier to read

## (re)create repository
if [ -d $REPODIR ]; then rm -r $REPODIR; fi
if [ -d $WC ]; then rm -rf $WC; fi
svnadmin create $REPODIR

## get WC and add files to it
svn co $REPO $WC
Checked out revision 0.
cd $WC
echo 'File #1 $Id:$' > file1.txt
echo 'File #2 $Id: $' > file2.txt
svn add file?.txt
A file1.txt
A file2.txt

## enable keyword substitution
svn pset svn:keywords Id file?.txt
property 'svn:keywords' set on 'file1.txt'
property 'svn:keywords' set on 'file2.txt'

## commit changes
svn commit -m 'initial tree/files'
Adding file1.txt
Adding file2.txt
Transmitting file data ..
Committed revision 1.

## touch both files to force subversion to diff on status
touch file?.txt

## Perform a diff, file1.txt shows a diff on the keyword
svn diff
Index: file1.txt
--- file1.txt (revision 1)
+++ file1.txt (working copy)
@@ -1 +1 @@
-File #1 $Id:$
+File #1 $Id$
[svn@svn test]$

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Received on Wed Apr 7 22:36:28 2004

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

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