5

Is it possible to fix/bypass non-UTF8 encoded svn:log records when synchronizing repositories with svnsync?

Background

I'm in the process of taking over the maintenance of an open source module that is stored within a large (well over 10,000 revisions) subversion (1.5.5) repository. I do not have admin access to the remote repository to dump/filter/load the module. The old repository is being discontinued and I am trying to sync the original sub module to my local (1.6+) repository with svnsync. For example:

svnsync file://home/svn/temp-repo/ http://path.to.repo/modulename/

The problem is that the old repository didn't enforce UTF8 encoding and I'm hitting errors like:

svnsync: Cannot accept 'svn:log' property because it is not encoded in UTF-8

I can't modify the log property in the source repository so I need to somehow modify or ignore the property value when the encoding is unknown/invalid.

Any ideas?

For example:

  • can a pre-revprop-change script modify the log property in transit?
  • I'm told that git-svn can handle it but using an intermediate git repo - how exactly is this done?
  • would it be possible to ignore log properties altogether, or for particular revisions
Chris Martin
  • 30,334
  • 10
  • 78
  • 137
Hamish
  • 22,860
  • 8
  • 53
  • 67

3 Answers3

2

You need to modify pre-revprop-change.tmpl

# cp pre-revprop-change.tmpl pre-revprop-change.tmp
# vim pre-revprop-change.tmp
exit 1 ==> exit 0

Otherwise, you may use svnadmin setrevprop to modify the repos

Yannick Blondeau
  • 9,465
  • 8
  • 52
  • 74
Yaoer
  • 21
  • 1
2

You will need to wait for the next version of Subversion, there is a pending patch to add support for non-UTF8 encodings to svnsync.

ismail
  • 46,010
  • 9
  • 86
  • 95
1

There is an easy fix for this. Change the log entry in the source repository with these statements:

Example with revision 10281 and repository in /home/svn/repos

svn proplist -v --revprop -r 10281 file:///home/svn/repos | iconv --to-code UTF8//IGNORE -o /tmp/iconv.out

svn propset svn:log --revprop -r 10281 -F /tmp/iconv.out file:///home/svn/repos

user672539
  • 11
  • 1
  • Thanks for you answer, unfortunately as stated in the question, I am unable to alter the log property (no commit access). – Hamish Mar 23 '11 at 08:45