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

Re: bug in svn diff and related?

From: David Ripton <dripton_at_ripton.net>
Date: 2005-03-15 14:33:57 CET

On 2005.03.15 02:10:39 +0000, mike south wrote:
> It looks to my untrained (and uninformed!) eye as though svn diff may be
> checking the mtime of a file against the
> .svn/text-base/[filename].svn-base version (the "pristine copy") of the
> file, and skipping the diff if the mtimes are the same.

I haven't actually looked closely at the code, but I believe this is the
case.

I've seen a related issue, where clock skew between the local machine
and the NFS server that hosted the working copy caused svn:keyword
expansions to look like local modifications.

> I have code that is adding an empty file to the working copy,
> committing, then filling the file with contents, then committing that.
>
> What appears to me to be happening is that some times the commit of the
> empty file (and the writing of its .svn/text-base copy) are happening
> within the same second that the modify of the file happens. Then when
> you try to commit the modified file subversion doesn't see the
> modifications, and ignores your commit attempt.

I don't know if this actually qualifies as a bug, but it's certainly
tricky behavior that could be documented better.

In your case, *some* time certainly elapses between the checkout and the
checkin, so using precise enough timestamp checks to make it impossible
to sneak the two operations into the same tick (and/or a one-tick sleep)
should avoid the problem.

A quick scan of the code shows that svn_wc__timestamps_equal_p (in
questions.c) uses apr_time_t, which is supposed to have microsecond
resolution, not one-second resolution. So this shouldn't happen, unless
there's a bug, or you're using an OS or filesystem that doesn't support
very precise timestamps. (I don't think you said what you were
running.)

I assume that if you put "sleep 1" at the right place in your Perl
script, the problem goes away. Does it go away if you sleep for 0.01
seconds? (I think you have to use Time::HiRes, or select, to sleep for
less than a second in Perl.)

If you don't get a better response here, you might want to try the dev
list.

-- 
David Ripton    dripton@ripton.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 15 14:36:33 2005

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.