You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2009/04/14 17:43:15 UTC

Re: svn commit: r37259 - trunk/subversion/libsvn_wc

On Tue, Apr 14, 2009 at 19:19, Hyrum K. Wright <hy...@hyrumwright.org> wrote:
>...
> +++ trunk/subversion/libsvn_wc/log.c    Tue Apr 14 10:19:44 2009        (r37259)
>...
> @@ -1496,14 +1490,13 @@ log_do_upgrade_format(struct log_runner
>   /* Remove the .svn/format file, if it exists. */
>   svn_error_clear(svn_io_remove_file(path, loggy->pool));
>
> -  /* The nice thing is that, just by setting this flag, the entries file will
> -     be rewritten in the desired format. */
> -  loggy->entries_modified = TRUE;
> -
>   /* Reading the entries file will support old formats, even if this number
>      is updated. */
>   SVN_ERR(svn_wc__adm_set_wc_format(fmt, loggy->adm_access, loggy->pool));
>
> +  SVN_ERR(svn_wc_entries_read(&entries, loggy->adm_access, TRUE, loggy->pool));
> +  SVN_ERR(svn_wc__entries_write(entries, loggy->adm_access, loggy->pool));

Might be safer to read the entries *first*, set the format, then write
the entries. I doubt it will happen, but we don't want that read() to
reset the format to what was found in the WC.

Better yet: one function to do the above.

>...

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1713841


Re: svn commit: r37259 - trunk/subversion/libsvn_wc

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Apr 14, 2009, at 12:43 PM, Greg Stein wrote:

> On Tue, Apr 14, 2009 at 19:19, Hyrum K. Wright  
> <hy...@hyrumwright.org> wrote:
>> ...
>> +++ trunk/subversion/libsvn_wc/log.c    Tue Apr 14 10:19:44  
>> 2009        (r37259)
>> ...
>> @@ -1496,14 +1490,13 @@ log_do_upgrade_format(struct log_runner
>>   /* Remove the .svn/format file, if it exists. */
>>   svn_error_clear(svn_io_remove_file(path, loggy->pool));
>>
>> -  /* The nice thing is that, just by setting this flag, the  
>> entries file will
>> -     be rewritten in the desired format. */
>> -  loggy->entries_modified = TRUE;
>> -
>>   /* Reading the entries file will support old formats, even if  
>> this number
>>      is updated. */
>>   SVN_ERR(svn_wc__adm_set_wc_format(fmt, loggy->adm_access, loggy- 
>> >pool));
>>
>> +  SVN_ERR(svn_wc_entries_read(&entries, loggy->adm_access, TRUE,  
>> loggy->pool));
>> +  SVN_ERR(svn_wc__entries_write(entries, loggy->adm_access, loggy- 
>> >pool));
>
> Might be safer to read the entries *first*, set the format, then write
> the entries. I doubt it will happen, but we don't want that read() to
> reset the format to what was found in the WC.

I can't comment on what would be "safer", but I will note that the  
"reset format-read entries-write entries" method of upgrading is what  
we've been doing all along.  It's just been hidden by the way loggy  
works and the entries_modified flag.

> Better yet: one function to do the above.

Eh, possibly, but I hope to rework this entire section at some point  
to do proper upgrading.

-Hyrum

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1713911