Discussion:
svn rename adds mergeinfo property / renaming in working copy does not
Nicolai Scheer
2017-11-06 17:10:37 UTC
Permalink
Hi all,

I just stumbled across a very strange behaviour.
We're using a pre-commit hook, that checks if a commit involves a merge
operation.
If the operation does involve a merge, we force the user to use the word
"merge" in the commit message.

I implented this using

svnlook diff --no-diff-deleted --no-diff-added -t XXXXXX /my/path/to/repo

and analysing if the string "Added: svn:mergeinfo" or "Modified:
svn:mergeinfo" shows up in the diff.

Recently one of my team members tried to rename a sub folder in a project
where there is a mergeinfo-property on the base folder.
He tried to do so using the command line client:

svn rename https://example.org/repo/project_a/subfolder_a
https://example.org/repo/project_a/subfolder_b

In this example, the "project_a" folder carries the mergeinfo property.

The commit hook complains that the operation is a merge an blocks (the user
did not use the word "merge" in the message since the operation is no merge
at all).

Doing the same rename in a working copy works.

I was not able to find any documentation on that behaviour: Obviously svn
copies the mergeinfo property from the root folder to the renamed folder -
but does only so if the rename is invoked as "svn rename from_url to_url".
If the rename is applied to a working copy and commited afterwards, the
svnlook on the server does not show adding the mergeinfo property.

I cannot imagine a case where copying the mergeinfo to the new folder is a
wanted behaviour, even worse, without the user being able to notice
anything about such an operation.

Maybe there's something wrong in our setup? Or is this the expected
behaviour?

The server currently uses httpd 2.2 + svn 1.8.13, the clients used for
testing where svn 1.8.13 and svn 1.9.7.

Any insight is appreciated!

Greetings

Nico
Stefan Sperling
2017-11-06 18:06:41 UTC
Permalink
Post by Nicolai Scheer
I cannot imagine a case where copying the mergeinfo to the new folder is a
wanted behaviour
The current behaviour was implemented on purpose.
It has been this way since Subversion 1.5.5.

See https://svn.haxx.se/dev/archive-2008-11/0432.shtml
and https://svn.haxx.se/dev/archive-2008-11/0297.shtml
for details.
Nicolai Scheer
2017-11-07 15:14:11 UTC
Permalink
Hi Stefan,
Post by Stefan Sperling
Post by Nicolai Scheer
I cannot imagine a case where copying the mergeinfo to the new folder is
a
Post by Nicolai Scheer
wanted behaviour
The current behaviour was implemented on purpose.
It has been this way since Subversion 1.5.5.
See https://svn.haxx.se/dev/archive-2008-11/0432.shtml
and https://svn.haxx.se/dev/archive-2008-11/0297.shtml
for details.
Thanks for the pointers.

If I understand correctly, WC to WC copy/rename does not add mergeinfo in
our case, because the source folder does not have any.
That seems to be change that has been commited as a result of the
discussion you pointed out.

Still, I can't get from the archives why a URL to URL rename does add
mergeinfo, although the folder to be renamed does not have any mergeinfo
props itself.
But maybe I'm just not into the details why this can't be changed easily...

Greetings

Nico
Branko Čibej
2017-11-07 19:21:41 UTC
Permalink
Post by Nicolai Scheer
Still, I can't get from the archives why a URL to URL rename does add
mergeinfo, although the folder to be renamed does not have any
mergeinfo props itself.
But maybe I'm just not into the details why this can't be changed easily...
Copying a directory is the same as creating a branch. You need the
mergeinfo in order to know what to merge. The recorded mergeinfo
describes the source path and revision of the branch.

-- Brane

Loading...