[GRASS-dev] On `svn propset`

Dears,

I copied over a "new" version of a python script (local) into the
'grass-addons' directory (which is the SVN repository). The `file`
command when run on the file in question, returns:

file r.estimap.recreation.py
r.estimap.recreation.py: Python script, UTF-8 Unicode text executable, with very long lines

I think I've correctly re-set the properties via

svn propset svn:eol-style "native" r.estimap.recreation.py
property 'svn:eol-style' set on 'r.estimap.recreation.py'

and

svn propset svn:mime-type text/x-python r.estimap.recreation.py
property 'svn:mime-type' set on 'r.estimap.recreation.py'

My question is: how do I tell the difference after having applied these
commands? `svn diff` or `svn status` don't show up anything?

Thank you, Nikos

Hi Nikos,

On Sun, Jan 13, 2019 at 1:10 PM Nikos Alexandris
<nik@nikosalexandris.net> wrote:

Dears,

I copied over a "new" version of a python script (local) into the
'grass-addons' directory (which is the SVN repository). The `file`
command when run on the file in question, returns:

file r.estimap.recreation.py
r.estimap.recreation.py: Python script, UTF-8 Unicode text executable, with very long lines

I think I've correctly re-set the properties via

svn propset svn:eol-style "native" r.estimap.recreation.py
property 'svn:eol-style' set on 'r.estimap.recreation.py'

and

svn propset svn:mime-type text/x-python r.estimap.recreation.py
property 'svn:mime-type' set on 'r.estimap.recreation.py'

Do you run that manually or use the helper script

grass-addons/tools/module_svn_propset.sh *
?

My question is: how do I tell the difference after having applied these
commands? `svn diff` or `svn status` don't show up anything?

It should!

Markus

* Markus Neteler <neteler@osgeo.org> [2019-01-13 14:53:13 +0100]:

Do you run that manually or use the helper script
grass-addons/tools/module_svn_propset.sh *
?

Manually. TL;DR

The properties seem to be already set and there is no need to re-set them.
Perhaps, once set for a file, in an SVN repository, there is no need for
a re-set? Even if actually replacing a file (instead of updating it)
with a file from a(nother) non-SVN repository, and committing the update.

What I did/tried:

# 1 : Print working directory

pwd /osgeo/grass-addons/grass7/raster/r.estimap.recreation

# 2 : Update (here == replace) the Python script

cp /some/local/repository/r.estimap.recreation.py /osgeo/grass-addons/grass7/raster/r.estimap.recreation/r.estimap.recreation.py
cp: overwrite '/osgeo/grass-addons/grass7/raster/r.estimap.recreation/r.estimap.recreation.py'? y

# 3 : committing the change to the SVN repository

svn ci -m "r.estimap.recreation.py: remove left-over 'd' flag" r.estimap.recreation.py
# which is: https://trac.osgeo.org/grass/changeset/73931

# 4 : I realise(d) I forgot to set the file properties

file r.estimap.recreation.py
r.estimap.recreation.py: Python script, UTF-8 Unicode text executable, with very long lines

# 5 : Setting them manually and testing again

svn propset svn:eol-style "native" r.estimap.recreation.py
property 'svn:eol-style' set on 'r.estimap.recreation.py'

svn propset svn:mime-type text/x-python r.estimap.recreation.py
property 'svn:mime-type' set on 'r.estimap.recreation.py'

file r.estimap.recreation.py
r.estimap.recreation.py: Python script, UTF-8 Unicode text executable, with very long lines

No effect!

# 5 : Trying to use the script:

sh ../../../tools/module_svn_propset.sh r.estimap.recreation.py

file r.estimap.recreation.py
r.estimap.recreation.py: Python script, UTF-8 Unicode text executable, with very long lines

# No change again!

# 6 : From withing a GRASS GIS session maybe? Repeating the last two
# commands, does nothing.

# 7 : Last check

svn propget svn:mime-type r.estimap.recreation.py
text/x-python

svn propget svn:eol-style r.estimap.recreation.py
native

# How can this be? Properties are already set.

Nikos

On Sun, Jan 13, 2019 at 7:05 PM Nikos Alexandris
<nik@nikosalexandris.net> wrote:

* Markus Neteler <neteler@osgeo.org> [2019-01-13 14:53:13 +0100]:

>Do you run that manually or use the helper script
>grass-addons/tools/module_svn_propset.sh *
>?

Manually. TL;DR

The properties seem to be already set and there is no need to re-set them.

There is no harm to run the script. It saves you likely quite some time :slight_smile:
Trying that locally didn't change anything.

Question: what's wrong and you don't like? Maybe I don't get it...

Markus

* Markus Neteler <neteler@osgeo.org> [2019-01-13 19:38:30 +0100]:

On Sun, Jan 13, 2019 at 7:05 PM Nikos Alexandris
<nik@nikosalexandris.net> wrote:

* Markus Neteler <neteler@osgeo.org> [2019-01-13 14:53:13 +0100]:

>Do you run that manually or use the helper script
>grass-addons/tools/module_svn_propset.sh *
>?

Manually. TL;DR

The properties seem to be already set and there is no need to re-set them.

There is no harm to run the script. It saves you likely quite some time :slight_smile:

I did. But I maybe I don't understand it well yet.

Trying that locally didn't change anything.

Question: what's wrong and you don't like? Maybe I don't get it...

Nothing. Why? What I don't like perhaps is that I forget such details
and indirectly create work for others.

Thanks Markus, Nikos

On Sun, Jan 13, 2019 at 12:59 PM Nikos Alexandris <nik@nikosalexandris.net> wrote:

The properties seem to be already set and there is no need to re-set them.
Perhaps, once set for a file, in an SVN repository, there is no need for
a re-set? Even if actually replacing a file (instead of updating it)
with a file from a(nother) non-SVN repository, and committing the update.

Good question. Subversion (as well as Git) does look at the content of the file not at the creation date or anything like that. Replacing a file is the same as modifying it from point of view of the common versioning control systems. (Renaming file is a different story.)

Vaclav

* Vaclav Petras <wenzeslaus@gmail.com> [2019-01-14 21:39:50 -0500]:

On Sun, Jan 13, 2019 at 12:59 PM Nikos Alexandris <nik@nikosalexandris.net>
wrote:

The properties seem to be already set and there is no need to re-set them.
Perhaps, once set for a file, in an SVN repository, there is no need for
a re-set? Even if actually replacing a file (instead of updating it)
with a file from a(nother) non-SVN repository, and committing the update.

Good question. Subversion (as well as Git) does look at the content of the
file not at the creation date or anything like that. Replacing a file is
the same as modifying it from point of view of the common versioning
control systems. (Renaming file is a different story.)

Perhaps related?

https://resources.collab.net/blogs/repository-dictated-configuration-part-2-of-3-autoprops
(referenced at https://stackoverflow.com/a/17562605/1172302)

Nikos