0

I have the svn repo with XML files, and I'm not satisfied with svn-update automerge functionality.

After svn update or svn update --accept postpone I've got the corrupted XML like this.

<?xml version="1.0" encoding="utf-8"?>
<VERSION>
<<<<<<< .mine
    <MAJOR>200</MAJOR>
=======
    <MAJOR>100</MAJOR>
>>>>>>> .r10
</VERSION>

SVN think XML was a text file, and place some markers for human editor here

How to disable the merge in svn update for XML (text) files?

I've read and try all answers in Can I turn off automatic merging in Subversion?, but it's doesn't work for SVN v 1.8.

UPD

I was review the answer https://stackoverflow.com/a/7673033/3578861, and found it's doesn't actual for svn 1.8 - Subcommand 'update' doesn't accept option '--diff-cmd ARG'

But now was a diff3-cmd option instead.

If I modify the solution to

svn update --accept postpone --diff3-cmd="d:\\f.bat"

and write d:\f.bat script with

@type %9
@exit 1

It's work now. But it's too much overheaded and unstable hack. This script accept the input streams from all conflicted files and save one of them to result file - it's very stupid and costly

Is there are a more elegant solution?

Community
  • 1
  • 1
Y.N
  • 4,989
  • 7
  • 34
  • 61

1 Answers1

0

Maybe better solution will be redefine MIME-type of *.xml to some/nontext in SVN-repository (or globally in config-file in [auto-props] section)?

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Yes, may be, I'll try. But there is a lot of file extention for DSL XML file. SVG is an example. Can I define nontext for all files with xml content? – Y.N Oct 29 '15 at 12:47
  • @Y.N - no. only *per extension*, not per context – Lazy Badger Oct 29 '15 at 13:32
  • I try to `config` `[miscellany] enable-auto-props = yes` and `[auto-props] *.xml = svn:mime-type=image/gif` or `*.xml = svn:mime-type=application/octet-stream` and where is NO effect – Y.N Oct 29 '15 at 14:53
  • @Y.N - autopros works only on *new* files at **adding to repository** stage. For versioned files you have to define this property by hand – Lazy Badger Oct 29 '15 at 19:52
  • Yes, now I see. After configuring autoprops or manual setting the file property to binary mime-type svn stop to merge it. – Y.N Oct 30 '15 at 07:15
  • But I think. my task is not solved. How to handle the files which are already be in repo without any mime? I think this is a hack, and it's not a clear and stable solution – Y.N Oct 30 '15 at 07:18
  • @Y.N - for files in repo - `svn ps svn:mime-type` **only**. In future, you can have [Repository Dictated Configuration](http://blogs.collab.net/subversion/the-road-to-repository-dictated-configuration-day-2-autoprops) from start of every repo – Lazy Badger Oct 30 '15 at 10:53