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

Re: Keyword substitutions not being merged correctly

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Wed, 20 Mar 2013 14:36:19 -0400

On 03/20/2013 02:24 PM, David Sandberg wrote:
> Things I had read elsewhere suggested that the
> keyword substitution takes place on the client during the commit process,
> but is it actually the case that the client only updates the committing
> user's working copy of that file during the commit, and then similarly
> updates any other user's working copy of that file with the same revision
> number during an update? If this is the case, then am I on the right
> track by thinking that the revision # of the merged file wouldn't be
> updated because the client doesn't regard a merge as the same thing as an
> update, and the revision # would only be updated when that merged file is
> committed (and to the revision of the merge commit in that branch, not
> the revision of the original trunk modification)?

Perhaps the most non-obvious-yet-useful thing folks need to understand about
Subversion and keywords is this: the Subversion server knows *nothing*
about keywords or the substitution thereof.

When keyword substitution is enabled, the Subversion client will substitute
keyword values into placeholder locations embedded the file when copying the
working file out of the "pristines" area of the working copy administrative
subdirectory. When you commit changes to such a file, the client first
un-substitutes the keywords found therein -- leaving only the keyword
placeholders -- before transmitting those file changes up to the server. If
the commit is successful, the Subversion client will again re-substitute
your keywords into the working file, this time with an updated revision and
last-modified stuffs. Likewise, when you update the file to receive someone
else's changes, the client re-substitutes the keywords in the working file
with the updated metadata.

This is why your user isn't seeing updated revisions in his keywords after
performing a merge -- because the line which contains those keywords in the
file didn't *really* change from the server's point of view. It only
appears to change on the client side because the client keeps refreshing
that line of the file when required by changes to the file's local version.

You should find that after accepting the merge from the server, the keyword
remains unchanged in your working copy, but that after committing the merged
changes, the working copy file is updated to reflect the new version you've
just committed.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development

Received on 2013-03-20 19:36:56 CET

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.