Honor SVN auto-props

Issue #186 new
Klaus Reimer
created an issue

When hgsubversion pushes new files to the SVN repo then it does not set SVN properties according to the auto-props section defined in the SVN configuration. This means hgsubvresion can't be used on SVN repositories which enforce certain SVN properties like mime-type and eol-style.

More information can be found here:


Comments (9)

  1. Anonymous

    Is there currently the ability to set svn properties manually from an hgsubversion repository, or do I have do get a subversion checkout and set the properties there?

  2. Klaus Reimer reporter

    I skimmed over the sourcecode and I only found some automatic svn properties stuff to mark binary files. And I can't even use SVN to fix the properties because our SVN repo rejects commits without correct SVN properties. So I can't commit the files with hgsubversion and then set the properties with an SVN client and therefore I can't use hgsubversion at all without this feature.

  3. ronvoe

    The absence of this feature blocks the adoption of mercurial in my company (because of the problems already described above), so I thought, I'll try to implement it.

    I've published the initial implementation in the patch queue https://bitbucket.org/ronvoe/hgsubversion-auto-props. Please try it. It's not tested "in production", but I have tested it locally and the patch also contains some automatic tests (which are passing, of course).

    Its main restriction is, that it only works with the SWIG-bindings.

    I couldn't find any support in the subvertpy-bindings for this area.

    But also the SWIG-based implementation isn't as straightforward, as it could be. The Python version of the SWIG-bindings is incomplete (compared to the Perl version, which is used in git-svn, which has this feature). So I had to reimplement some functionality, that is already present in the svn-libs.

  4. Anonymous

    Thanks, ronvoe. It seems to be working on Windows. The subversion config file should be placed here: C:\Users\<username>\AppData\Roaming\Subversion\config.

    P.S. I always wanted this feature, but due to lack of time couldn't implement it. Now I see how it can be done :) I'm new to mercurial, hgsubversion source code, and svn bindings, and may be wrong, but if it is difficult to implement searching for svn config file, why not just add temporary hgrc options like this:

    autoprops_config = <path to svn config>

    It can be used for subvertpy and also for SWIG bindings( for example, my cfg is located in $HOME/.subversion/config and I want it to be used)

  5. ronvoe

    Thanks for testing, Anonymous.

    My goal was, to keep the behavior of the functionality as close to the original, as possible. That's why I tried to reuse the svn-libs, where I could.

    For finding the config file, I *was* able to use a function provided by the svn-library. So hgsubversion will look for the config file where svn would look for it, which is exactly what I intended.

    On Windows this is the path you described. Your config directory is obviously different. When you are using svn, how do you tell it, to use your config dir? I only know of the command line argument, which is quite inconvenient. Or are you using a cygwin-build of svn?

  6. dgc

    I took a somewhat different approach to this problem, I guess. I don't care about using actual svn configuration files, I'm find with implementing configuration in .hgrc. I've been using this minimal implementation for over a year.

  7. dgc

    Augie pushed Ronny's version in June, so I guess that should work. I'm not keen on using svn's config for this, but I haven't had time to write a new patch to permit hgrc, and my old patch still works. (I also no longer have svn in my work life -- but since I have git now, I'm not sure I'm better off.)

  8. Log in to comment