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

AW: Timestamp issue with "svn status" in 1.9.3

From: Peter Klotz <Peter.Klotz_at_ith-icoserve.com>
Date: Fri, 4 Mar 2016 17:58:41 +0100

Hello Stefan

Thank you for the quick and detailed response.

> > When changing the timestamp of a file to an earlier point in time and
> leaving the file size unchanged yet altering the content, Subversion is
> not always able to detect this change.
> > The attached test case is the simplest we could come up with that
> reliably reproduces the problem.
>
> Subversion uses timestamp and size as a short-cut for detecting unmodified
> files. This saves Subversion from having to run a full content comparison
> for every file in the working copy when 'svn status' is run under what
> we'd consider "normal" conditions. You are artificially creating conditions
> which fool Subversion into believing the file was not modified. Because the
> timestamps and size checks which precede a full content comparison indicate
> the file was not modified, the full content comparison is skipped and the
> modification remains undetected.
>
> So, that's why you're seeing this behaviour. What's unclear is why you are
> investigating this behaviour in the first place. What is your use case for
> changing the file's content but leaving it's timestamp unchanged?

The reason for investigating this situation was because a tool did exactly what touch does in the script. A timestamp was changed to a value in the past and a content change went undetected.
Unfortunately the content change included a year (2015 -> 2016) and a version number (3.0 -> 4.0), so the file size did not change.

I see the point in Subversion using timestamps to do a quick check for changed files.

What puzzles me (see the script) is that the first change of the file (including a change of timestamp) is detected and reported by "svn status".
However if after a commit the same procedure is repeated, Subversion does no longer detect the change.

So the question should be changed:

Instead of "why is the second change not reported" it should be "why is the first change reported".

Relevant part of the script:

  echo "2" > x
  touch -m -t "201212310000.00" x
  svn -q status <-- this change is detected by Subversion (why?)

  svn commit -m "" x
  echo "3" > x
  touch -m -t "201212310000.00" x
  svn -q status <-- this change is not detected by Subversion (as expected)

Regards, Peter.
Received on 2016-03-04 17:58:55 CET

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.