开发者

Fixing svn UTF-8 data issues in hgsubversion pull

开发者 https://www.devze.com 2023-03-06 17:33 出处:网络
I\'ve encountered an error while pulling svn changes into my mercurial repo: abort: (\'Valid UTF-8 data\\n(hex: 75 6c 6c 20 74 61 73 6b 20 6开发者_JAVA技巧c 69 73 74 20 74 68 65 20 63 6c 69 65 6e 74)

I've encountered an error while pulling svn changes into my mercurial repo:

abort: ('Valid UTF-8 data\n(hex: 75 6c 6c 20 74 61 73 6b 20 6开发者_JAVA技巧c 69 73 74 20 74 68 65 20 63 6c 69 65 6e 74)\nfollowed by invalid UTF-8 sequence\n(hex: 92 73 20 4e)', 22)

I've found out how to detect it for svn (with a fix for filenames, but not content); how do I apply this detection to hgsubversion so I can continue pulling??


The following does not work - see step 4 (upvote if this is helpful in saving you time :)). Hopefully the real answer is some variation on this...

  1. Have a look at the svn log for the revision, and see what files are affected (hopefully a small amount)
  2. for each file use isutf8 .hg/store/data/trunk/{svn path} (from moreutils package) (where [my] branches appear in the trunk as well due to hg branching stuff I don't understand...). If things are going "correctly wrong", then the offset that isutf8 complains about should be very close to the invalid UTF-8 sequence message. In my case, isutf8 complained at position 24, where my error was at 22 (I reckon this is just reporting either the start or the end of unicode decoding...)
  3. Do something along the lines of

    iconv -f iso-8859-1 -t utf8 {file name} > {temp file}
    mv {file name} ~ # For backup purposes
    mv {temp file} {file name}
    
  4. Watch as hg pull fails again after finally logging svn and starting pulling after I've written my optimistic answer.

0

精彩评论

暂无评论...
验证码 换一张
取 消