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

Re: [PATCH] Follow-up to r922176 was:Re: svn commit: r922176 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/revision_status.c svnversion/main.c

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Fri, 12 Mar 2010 19:42:53 -0600

On Mar 12, 2010, at 3:52 PM, Daniel Näslund wrote:

> On Fri, Mar 12, 2010 at 05:43:18AM -0500, Greg Stein wrote:
>> On Fri, Mar 12, 2010 at 03:21, <dannas_at_apache.org> wrote:
>>> ...
>>> +++ subversion/trunk/subversion/libsvn_wc/revision_status.c Fri Mar 12 08:21:45 2010
>>> ...
>>> {
>>> - struct status_baton *sb = baton;
>>> + struct walk_baton *wb = baton;
>>> + svn_revnum_t changed_rev;
>>> + svn_revnum_t revision;
>>> + svn_depth_t depth;
>>> + svn_wc__db_status_t status;
>>> + svn_boolean_t wc_root;
>>> + svn_boolean_t switched;
>>
>> wc_root and switched can be moved into a tighter scope.
>
> Fixed!
>
>>> - if (status->entry->depth != svn_depth_exclude)
>>> + /* Added files have a revision of no interest */
>>> + if (revision != SVN_INVALID_REVNUM)
>>> {
>>> - sb->result->switched |= status->switched;
>>> - sb->result->modified |= (status->text_status != svn_wc_status_normal);
>>> - sb->result->modified |= (status->prop_status != svn_wc_status_normal
>>> - && status->prop_status != svn_wc_status_none);
>>> + svn_revnum_t item_rev = (wb->committed
>>> + ? changed_rev
>>> + : revision);
>>
>> I think this may introduce a bug. Depending on wb->committed, we look
>> at different revision values. And it may be that REVISION is valid,
>> but CHANGED_REV is not. I would suggest moving the assignment of
>> ITEM_REV one block out, and using that in the primary if() test.
>
> Fixed, although I must admit that I don't truly understand how
> changed_rev and revision differs!

'Changed rev' is the last time the object was modified in the repo. 'Revision' refers to which revision the working copy thinks this object is up-to-date to.

For instance, if I change foo.c in r10, and then later update to r12, if foo.c wasn't modified by the update, the last changed revision would still be r10, but revision would be r12. You've every right to be confused, btw, since in wc-1 entry->revision is overloaded about 4 different ways.

> My change of the caller svnversion/main.c in r922176 caused a problem
> when svnversion was invoked on a newly added path. It is under version
> control but has no revision number. At the moment '-1' is returned for
> such a path. I intend to fix that in a separate patch.
>
> [[[
> Follow-up to r922176. Fix that tree changes were not considered when
> determining if the wc has modifications.
>
> * subversion/libsvn_wc/revision_status.c
> (analyze_status): Determine from status if a path has been added or
> deleted. Do some optimizations to avoid having to do a text
> comparison for determining if a wc has modifications.
>
> Suggested by: gstein
> rhuijben
> Approved by: ?
> ]]]
> <revision_status_follow_up.diff.txt>
Received on 2010-03-13 02:43:19 CET

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