You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by FEDERICO PRADES ILLANES <fe...@bbva.com> on 2016/09/23 10:36:24 UTC

svn switch, touches files with svn:keywords

Hello subversion-users,

I think I found a bug in subversion, not in the issue tracker:

Subversion: svn, version 1.9.4 (r1740329)
   compiled Apr 24 2016, 15:40:35 on x86-microsoft-windows
System: Windows 7, SP1

Steps to reproduce:

   1. Create a branch b1.
   2. Create an dummy file in b1, with svn:keywords.
   3. Don't use the svn:keywords on the file.
   4. Commit the changes to b1.
   5. Create a branch b2, from b1.
   6. Perform a switch to b2.

Expected results:

   - Dummy file modification time hasn't change

Actual results

   - Dummy file modification time has change

This is a problem specially with header files, in C++ projects. This bug
wasn't present in svn 1.7.9 r1462340.

Can someone else confirm, and will proceed to open the issue.

Thanks,

*Federico Prades Illanes* - *ext. (2)75682 - Software Evangelist*
*Quantitative and Business Solutions (QBS) **- CIB - **BBVA*

-- 


"Este mensaje está dirigido de manera exclusiva a su destinatario y puede 
contener información privada y confidencial. No lo reenvíe, copie o 
distribuya a terceros que no deban conocer su contenido. En caso de haberlo 
recibido por error,  rogamos lo notifique al remitente y proceda a su 
borrado, así como al de cualquier documento que pudiera adjuntarse.

 Por favor tenga en cuenta que los correos enviados vía Internet no 
permiten garantizar la confidencialidad de los mensajes ni su transmisión 
de forma íntegra.

 Las opiniones expresadas en el presente correo pertenecen únicamente al 
remitente y no representan necesariamente la opinión del Grupo BBVA."

 "This message is intended exclusively for the adressee and may contain 
privileged and confidential information. Please, do not disseminate, copy 
or distribute it to third parties who should not receive it. In case you 
have received it by mistake, please inform the sender and delete the 
message and attachments from your system.

 Please keep in mind that e-mails sent by Internet do not allow to 
guarantee neither the confidentiality or the integrity of the messages 
sent."

Re: svn switch, touches files with svn:keywords

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Fri, Sep 23, 2016 at 6:36 AM, FEDERICO PRADES ILLANES
<fe...@bbva.com> wrote:
> Hello subversion-users,
>
> I think I found a bug in subversion, not in the issue tracker:
>
> Subversion: svn, version 1.9.4 (r1740329)
>    compiled Apr 24 2016, 15:40:35 on x86-microsoft-windows
> System: Windows 7, SP1
>
> Steps to reproduce:
>
> Create a branch b1.
> Create an dummy file in b1, with svn:keywords.
> Don't use the svn:keywords on the file.
> Commit the changes to b1.
> Create a branch b2, from b1.
> Perform a switch to b2.
>
> Expected results:
>
> Dummy file modification time hasn't change
>
> Actual results
>
> Dummy file modification time has change
>
> This is a problem specially with header files, in C++ projects. This bug
> wasn't present in svn 1.7.9 r1462340.
>
> Can someone else confirm, and will proceed to open the issue.
>
> Thanks,
>
> Federico Prades Illanes - ext. (2)75682 - Software Evangelist
> Quantitative and Business Solutions (QBS) - CIB - BBVA

I didn't expect it, but I'm completely unsurprised. svn:keywords have
to rendered, and switching an upstream repository, branch, tag, etc.,
etc. can all change the WebURL, Author, Date, and other keywords. So
I'd be completely unsurprised if all files with svn:keywords get
reparsed and touched, even if no change results in the end.

Tis is one of the fragilities of keywords in all source control
systems. innocuous changes with no change in performance lead to
modifications of source files, even such innocuous changes as comment
lines.

Re: svn switch, touches files with svn:keywords

Posted by Lorenz <lo...@yahoo.com>.
Daniel Shahaf wrote:

>Lorenz wrote on Mon, Sep 26, 2016 at 06:01:31 +0000:
>> are you sure about tha being a bug?
>> 
>> If for instance in the file the URL keyword is used to initialize a
>> string variable, wouldn't you want the file to be recompiled after the
>> switch?
>
>You are describing a different scenario than the OP.
>[...]

ah yes, I overlooked "3. Don't use the svn:keywords on the file."
-- 

Lorenz


Re: svn switch, touches files with svn:keywords

Posted by FEDERICO PRADES ILLANES <fe...@bbva.com>.
Issue created: https://issues.apache.org/jira/browse/SVN-4656


*Federico Prades Illanes* - *ext. (2)75682 - Software Evangelist*
*Quantitative and Business Solutions (QBS) **- CIB - **BBVA*

On 26 September 2016 at 09:36, Daniel Shahaf <d....@daniel.shahaf.name> wrote:

> Lorenz wrote on Mon, Sep 26, 2016 at 06:01:31 +0000:
> > are you sure about tha being a bug?
> >
> > If for instance in the file the URL keyword is used to initialize a
> > string variable, wouldn't you want the file to be recompiled after the
> > switch?
>
> You are describing a different scenario than the OP.
>
> In the OP's scenario, the file content with keywords expanded was the
> same before and after the switch, yet the mtime differed.  I consider
> that a bug.
>
> If the file content with keywords expanded had been different before the
> switch to after to the switch, then yes, I would have expected the mtime
> to differ, too.
>
> Thanks for contributing this observation: the key question is whether
> the translated content was modified, not whether the repository-normal
> content was.
>
> Cheers
>
> Daniel
>

-- 


"Este mensaje está dirigido de manera exclusiva a su destinatario y puede 
contener información privada y confidencial. No lo reenvíe, copie o 
distribuya a terceros que no deban conocer su contenido. En caso de haberlo 
recibido por error,  rogamos lo notifique al remitente y proceda a su 
borrado, así como al de cualquier documento que pudiera adjuntarse.

 Por favor tenga en cuenta que los correos enviados vía Internet no 
permiten garantizar la confidencialidad de los mensajes ni su transmisión 
de forma íntegra.

 Las opiniones expresadas en el presente correo pertenecen únicamente al 
remitente y no representan necesariamente la opinión del Grupo BBVA."

 "This message is intended exclusively for the adressee and may contain 
privileged and confidential information. Please, do not disseminate, copy 
or distribute it to third parties who should not receive it. In case you 
have received it by mistake, please inform the sender and delete the 
message and attachments from your system.

 Please keep in mind that e-mails sent by Internet do not allow to 
guarantee neither the confidentiality or the integrity of the messages 
sent."

Re: svn switch, touches files with svn:keywords

Posted by Daniel Shahaf <da...@apache.org>.
Lorenz wrote on Thu, Sep 29, 2016 at 14:29:34 +0000:
> Daniel Shahaf wrote:
> >Nico Kadel-Garcia wrote on Tue, Sep 27, 2016 at 19:44:07 -0400:
> >> If you switch the upstream repo for a software source repo, recompile.
> >> It's the best way to make sure you've not left some datestamped file
> >> inconsistencies that could mess with the system.
> >
> >Subversion supports both the "recompile from scratch after switch"
> >workflow and the "recompile minimally after switch" workflow.  You don't
> >have to use the latter if you don't like it.
> 
> Could you please elaborate a bit on this?
> 
> I assume you refere to the "use-commit-times" config option?

I mainly meant that Subversion, as a product, does not enforce either
workflow.  We provide �svn cleanup --remove-ignored --remove-unversioned�
to support the latter work-flow, and we don't change mtimes unnecessarily
to support the former workflow.  (Hence accepting the OP's report as a bug.)

Re: svn switch, touches files with svn:keywords

Posted by Lorenz <lo...@yahoo.com>.
Daniel Shahaf wrote:
>Nico Kadel-Garcia wrote on Tue, Sep 27, 2016 at 19:44:07 -0400:
>> If you switch the upstream repo for a software source repo, recompile.
>> It's the best way to make sure you've not left some datestamped file
>> inconsistencies that could mess with the system.
>
>Subversion supports both the "recompile from scratch after switch"
>workflow and the "recompile minimally after switch" workflow.  You don't
>have to use the latter if you don't like it.

Could you please elaborate a bit on this?

I assume you refere to the "use-commit-times" config option?
-- 

Lorenz


Re: svn switch, touches files with svn:keywords

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Nico Kadel-Garcia wrote on Tue, Sep 27, 2016 at 19:44:07 -0400:
> If you switch the upstream repo for a software source repo, recompile.
> It's the best way to make sure you've not left some datestamped file
> inconsistencies that could mess with the system.

Subversion supports both the "recompile from scratch after switch"
workflow and the "recompile minimally after switch" workflow.  You don't
have to use the latter if you don't like it.

Daniel

Re: svn switch, touches files with svn:keywords

Posted by Branko Čibej <br...@apache.org>.
On 28.09.2016 01:44, Nico Kadel-Garcia wrote:
>
>> If the file content with keywords expanded had been different before the
>> switch to after to the switch, then yes, I would have expected the mtime
>> to differ, too.
> And how, exactly, are you going to verify this? Put in a locally
> processed working file to check against? That's begging to leave
> debris in the working repository.

Subversion already has both files available.

Files that arrive in the working copy (during checkout, update, etc.)
are preprocessed in a temporary to expand keywords, adjust newlines and
so on, then moved to the final location in the working copy.

-- Brane


Re: svn switch, touches files with svn:keywords

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Mon, Sep 26, 2016 at 3:36 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Lorenz wrote on Mon, Sep 26, 2016 at 06:01:31 +0000:
>> are you sure about tha being a bug?
>>
>> If for instance in the file the URL keyword is used to initialize a
>> string variable, wouldn't you want the file to be recompiled after the
>> switch?
>
> You are describing a different scenario than the OP.
>
> In the OP's scenario, the file content with keywords expanded was the
> same before and after the switch, yet the mtime differed.  I consider
> that a bug.

How can Subversion know that? Reprocessing the file, setting aside the
processed file, then doing a "diff" between them is a lot more pain
than it's worth. And the maintenance of supporting such a feature for
all releases, and backporting it to previous Subversion releases to
support such a contorted workflow as switching upstream midrepos or
branches midstream, is potentially quite fragile.

If you switch the upstream repo for a software source repo, recompile.
It's the best way to make sure you've not left some datestamped file
inconsistencies that could mess with the system.

> If the file content with keywords expanded had been different before the
> switch to after to the switch, then yes, I would have expected the mtime
> to differ, too.

And how, exactly, are you going to verify this? Put in a locally
processed working file to check against? That's begging to leave
debris in the working repository./

> Thanks for contributing this observation: the key question is whether
> the translated content was modified, not whether the repository-normal
> content was.
>
> Cheers
>
> Daniel

Re: svn switch, touches files with svn:keywords

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Lorenz wrote on Mon, Sep 26, 2016 at 06:01:31 +0000:
> are you sure about tha being a bug?
> 
> If for instance in the file the URL keyword is used to initialize a
> string variable, wouldn't you want the file to be recompiled after the
> switch?

You are describing a different scenario than the OP.

In the OP's scenario, the file content with keywords expanded was the
same before and after the switch, yet the mtime differed.  I consider
that a bug.

If the file content with keywords expanded had been different before the
switch to after to the switch, then yes, I would have expected the mtime
to differ, too.

Thanks for contributing this observation: the key question is whether
the translated content was modified, not whether the repository-normal
content was.

Cheers

Daniel

Re: svn switch, touches files with svn:keywords

Posted by Lorenz <lo...@yahoo.com>.
Daniel Shahaf wrote:

>FEDERICO PRADES ILLANES wrote on Fri, Sep 23, 2016 at 12:36:24 +0200:
>> Steps to reproduce:
>> 
>>    1. Create a branch b1.
>>    2. Create an dummy file in b1, with svn:keywords.
>>    3. Don't use the svn:keywords on the file.
>>    4. Commit the changes to b1.
>>    5. Create a branch b2, from b1.
>>    6. Perform a switch to b2.
>> 
>> Expected results:
>> 
>>    - Dummy file modification time hasn't change
>> 
>> Actual results
>> 
>>    - Dummy file modification time has change
>
>I can reproduce this with current trunk and I agree it's a (minor) bug.
>[...]

are you sure about tha being a bug?

If for instance in the file the URL keyword is used to initialize a
string variable, wouldn't you want the file to be recompiled after the
switch?
-- 

Lorenz


RE: svn switch, touches files with svn:keywords

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Daniel Shahaf [mailto:danielsh@apache.org]
> Sent: zaterdag 24 september 2016 09:11
> To: FEDERICO PRADES ILLANES <fe...@bbva.com>
> Cc: users@subversion.apache.org
> Subject: Re: svn switch, touches files with svn:keywords
> 
> FEDERICO PRADES ILLANES wrote on Fri, Sep 23, 2016 at 12:36:24 +0200:
> > Steps to reproduce:
> >
> >    1. Create a branch b1.
> >    2. Create an dummy file in b1, with svn:keywords.
> >    3. Don't use the svn:keywords on the file.
> >    4. Commit the changes to b1.
> >    5. Create a branch b2, from b1.
> >    6. Perform a switch to b2.
> >
> > Expected results:
> >
> >    - Dummy file modification time hasn't change
> >
> > Actual results
> >
> >    - Dummy file modification time has change
> 
> I can reproduce this with current trunk and I agree it's a (minor) bug.

See also issue #1975, which documented the opposite behavior as a bug, which was fixed in 1.9.0
http://subversion.apache.org/issue1975

	Bert


Re: svn switch, touches files with svn:keywords

Posted by Daniel Shahaf <da...@apache.org>.
FEDERICO PRADES ILLANES wrote on Fri, Sep 23, 2016 at 12:36:24 +0200:
> Steps to reproduce:
> 
>    1. Create a branch b1.
>    2. Create an dummy file in b1, with svn:keywords.
>    3. Don't use the svn:keywords on the file.
>    4. Commit the changes to b1.
>    5. Create a branch b2, from b1.
>    6. Perform a switch to b2.
> 
> Expected results:
> 
>    - Dummy file modification time hasn't change
> 
> Actual results
> 
>    - Dummy file modification time has change

I can reproduce this with current trunk and I agree it's a (minor) bug.

Minimal reproduction:

svn co -q $URL wc
cd wc
touch iota
svn add iota
svn ps -q svn:keywords Id iota
svn ci -q -mr1 
svn up -q
stat iota
svn switch ^/iota iota
stat iota

> This is a problem specially with header files, in C++ projects. This bug
> wasn't present in svn 1.7.9 r1462340.
> 
> Can someone else confirm, and will proceed to open the issue.

Confirmed.  Thanks for the clear bug report1

Daniel