You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Nathan Hartman <ha...@gmail.com> on 2020/10/01 02:27:47 UTC

Re: forcing update of keyword expansions in a working copy

On Wed, Sep 30, 2020 at 6:50 PM Vincent Lefevre <vi...@vinc17.net> wrote:
> Is there a way to force the update of keyword expansions to their
> correct values in a working copy?
>
> "svn up" will not change anything if the file hasn't changed, but
> the file may have obsolete keyword values, probably due to some bug
> in Subversion. I noticed the issue while checking data integrity by
> comparing an up-to-date working copy with the result of "svn export"
> (some keyword expansions were different, and it appears that the
> expansions of the Id keyword were not updated after a commit that
> only changed the svn:keywords property from "Id Date" to "Id").

Hi Vincent,

Searching through the issues database, I came across issue #4585 [1]
which you filed previously and this sounds related to the same issue.

Are you still using svn 1.8.x? If not, which version are you using now?

A few svn:keywords bugs were fixed in 1.9.x, including issue #1975
[2], where svn:keywords were not being re-expanded after 'svn switch';
perhaps that fix is common to this case as well. Note that 1.9.x went
end-of-life earlier this year, so if you could try with 1.10.x or
1.14.x, that would be preferred. (And 1.8.x went end-of-life more than
2 years ago.)

If the file timestamp changes, but not the file contents ('touch' the
file and then run 'svn update'), does keyword re-expansion occur?

If the file contents change (e.g., add 1 character to the file
contents then run 'svn update') does the expected keyword expansion
take place?

Thanks,
Nathan

[1] https://issues.apache.org/jira/browse/SVN-4585

[2] https://issues.apache.org/jira/browse/SVN-1975

Re: forcing update of keyword expansions in a working copy

Posted by Vincent Lefevre <vi...@vinc17.net>.
On 2020-09-30 22:27:47 -0400, Nathan Hartman wrote:
> Searching through the issues database, I came across issue #4585 [1]
> which you filed previously and this sounds related to the same issue.

This was not this bug. What I did was to change svn:keywords from
"Id Date" to "Id" on various files (which used only the Id keyword),
and the commit did only that. But for some of these files (those
that did not have any additional commits later), the expansion of
the Id keyword was still the one from the previous commit. In #4585,
the svn:keywords does not change, which triggers a bug. But here,
svn:keywords had changed.

The commit was done in December 2017 on a Debian/stable machine.
The svn version was 1.9.5 (Debian package 1.9.5-1+deb9u1), and
the working copy was on the same machine.

Now the machine has svn 1.10.4, but for files that didn't had new
commits, "svn up" on the working copy doesn't change anything, so
that these files were still affected by the old issue.

I've just tried to reproduce the bug with the following script:

------------------------------------------------------------
#!/bin/sh

set -e

mkdir my-test-svn
cd my-test-svn

svnadmin create svn
svn co file://`pwd`/svn wc1
svn co file://`pwd`/svn wc2

cd wc1
mkdir dir
printf '# \044Id\044\n' > dir/file
svn add dir
svn propset svn:keywords "Id Date" dir/file
svn ci -m "add dir/file"
svn update
cat dir/file

cd ../wc2
svn update
cat dir/file
svn propset svn:keywords "Id" dir/file
svn ci -m "new keywords"
cat dir/file
svn update
cat dir/file

cd ../wc1
svn update
cat dir/file
------------------------------------------------------------

on a machine that has svn 1.9.4 (gcc119.fsffrance.org), but
I haven't noticed any issue (I expected the 3rd and 4th cat
output to be incorrect).

> If the file timestamp changes, but not the file contents ('touch' the
> file and then run 'svn update'), does keyword re-expansion occur?

No, this is never done. You can try by changing the Id keyword
expansion of a file. A "svn update" never fixes it to the correct
value.

> If the file contents change (e.g., add 1 character to the file
> contents then run 'svn update') does the expected keyword expansion
> take place?

Ditto.

-- 
Vincent Lefèvre <vi...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)