svn status does not detect a modification if the same file was touched

2017-10-19 Thread Sasikala Kottegoda
Hi all,

I'm using svn version 1.9.3 and I have come across the following:

   - A file named a.txt exists inside a folder in the working copy, which
   has been copied from somewhere else
   - cCopy and replace a.txt with the same file/or modify it by issuing the
   'touch' command
   - Do an svn status, it shows nothing
   - Do an svn info on the file and 'Last Changed Date' shows the same as
   the previous file. It does not get modified even though the file was newly
   copied.
   - But the from java files API, the file is shown with a different
   modified date

Why do we not modify the 'Last Changed Date' when the file was newly
copied/touched?

Thank you,
Sasikala

-- 
Sasikala Kottegoda
*Senior Software Engineer*
WSO2 Inc., http://wso2.com/
lean. enterprise. middleware
Mobile: +94 774835928

[image: https://wso2.com/signature] 


Re: svn status does not detect a modification if the same file was touched

2017-10-19 Thread Andreas Stieger
Greetings,

On 10/19/2017 11:41 AM, Sasikala Kottegoda wrote:
> A file named a.txt exists inside a folder in the working copy, which
> has been copied from somewhere else
>
>   * cCopy and replace a.txt with the same file/or modify it by issuing
> the 'touch' command
>   * Do an svn status, it shows nothing
>   * Do an svn info on the file and 'Last Changed Date' shows the same
> as the previous file. It does not get modified even though the
> file was newly copied.
>   * But the from java files API, the file is shown with a different
> modified date
>
> Why do we not modify the 'Last Changed Date' when the file was newly
> copied/touched?

Last Changed Date refers to the last change of the version item in the
repository that the working copy knows about. It does not relate or
account for local file system changes, neither in identity (inode),
timestamps (touch) nor content - because this is a local change that
does not change the versioned item until commit.

Andreas


Re: svn status does not detect a modification if the same file was touched

2017-10-19 Thread Sasikala Kottegoda
Hi Andreas,

Thanks for the prompt reply.

In this scenario, svn status does not show anything. Also, the file does
not get commited when I issue an 'svn commit'. Is there a reason for that?

Thank you,
Sasikala

On Thu, Oct 19, 2017 at 3:25 PM, Andreas Stieger 
wrote:

> Greetings,
>
> On 10/19/2017 11:41 AM, Sasikala Kottegoda wrote:
> > A file named a.txt exists inside a folder in the working copy, which
> > has been copied from somewhere else
> >
> >   * cCopy and replace a.txt with the same file/or modify it by issuing
> > the 'touch' command
> >   * Do an svn status, it shows nothing
> >   * Do an svn info on the file and 'Last Changed Date' shows the same
> > as the previous file. It does not get modified even though the
> > file was newly copied.
> >   * But the from java files API, the file is shown with a different
> > modified date
> >
> > Why do we not modify the 'Last Changed Date' when the file was newly
> > copied/touched?
>
> Last Changed Date refers to the last change of the version item in the
> repository that the working copy knows about. It does not relate or
> account for local file system changes, neither in identity (inode),
> timestamps (touch) nor content - because this is a local change that
> does not change the versioned item until commit.
>
> Andreas
>



-- 
Sasikala Kottegoda
*Senior Software Engineer*
WSO2 Inc., http://wso2.com/
lean. enterprise. middleware
Mobile: +94 774835928

[image: https://wso2.com/signature] 


Re: svn status does not detect a modification if the same file was touched

2017-10-19 Thread Ralph Seichter
On 19.10.2017 12:16, Sasikala Kottegoda wrote:

> In this scenario, svn status does not show anything. Also, the file
> does not get commited when I issue an 'svn commit'. Is there a reason
> for that?

Subversion uses a hash of the file content to determine if it has been
modified. Changing the modification date in the working copy, as you did
with 'touch', does not alter the content, hence the file is considered
unchanged. This is deliberate.

-Ralph


Re: svn status does not detect a modification if the same file was touched

2017-10-19 Thread Daniel Shahaf
Ralph Seichter wrote on Thu, 19 Oct 2017 13:01 +0200:
> On 19.10.2017 12:16, Sasikala Kottegoda wrote:
> 
> > In this scenario, svn status does not show anything. Also, the file
> > does not get commited when I issue an 'svn commit'. Is there a reason
> > for that?
> 
> Subversion uses a hash of the file content to determine if it has been
> modified. Changing the modification date in the working copy, as you did
> with 'touch', does not alter the content, hence the file is considered
> unchanged.

Subversion doesn't use checksums to detect modifications.  'svn status'
is based on filesize + mtime only.  If mtime differs but filesize doesn't, then
a full content diff is done.

> This is deliberate.

Yes, it is, for efficiency reasons.  (stat() is cheaper than read())


Re: svn status does not detect a modification if the same file was touched

2017-10-19 Thread Ralph Seichter
On 19.10.17 18:17, Daniel Shahaf wrote:

> Subversion doesn't use checksums to detect modifications. 'svn status'
> is based on filesize + mtime only.

I seemed to remember subversion behaved like git in this regard, using a
checksum (as shown in 'svn info') as an indicator, rather than raw file
size. Oh well, I'm pretty sure you know first-hand how it works. ;-)

-Ralph


Re: svn status does not detect a modification if the same file was touched

2017-10-19 Thread Daniel Shahaf
Ralph Seichter wrote on Thu, 19 Oct 2017 18:31 +0200:
> On 19.10.17 18:17, Daniel Shahaf wrote:
> 
> > Subversion doesn't use checksums to detect modifications. 'svn status'
> > is based on filesize + mtime only.
> 
> I seemed to remember subversion behaved like git in this regard, using a
> checksum (as shown in 'svn info') as an indicator, rather than raw file
> size. Oh well, I'm pretty sure you know first-hand how it works. ;-)

https://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?revision=1801448&view=markup#l258

:-)


Corporations that have a Subversion install - fancy deploying a file-sync tech that uses it?

2017-10-19 Thread Paul Hammant
http://subsyncit.com/

If you're prepared to make a few additions to httpd.conf, you can get
running with this Python3 technology to do file-sync using Subversion as
the backing store.  It doesn't require any client-side Subversion install,
but does Python and some pips. At least up until I make an installer.

I'll make the usual UI for it in the weeks that follow.

Right now I am hoping to integrate with various other
applications/services. Trello, Slack, etc. That would be for workflow-ish
functionality.

Say - Fred assigns a spreadsheet to Wilma in Trello by changing the
'assigned to' aspect of a card, and a few seconds later it appears on her
C: drive. "Update the day totals", he says.  She does, and a bot notices
the change in the spreadsheet and updates Authz files to make it
effectively disappear from her C: drive (and update in Trello again).

Or maybe that workflow happens in Slack.

Get in touch if you're a corporate and are intrigued.

Also, feel free to ask questions...

- Paul