I'm having problems with the standard subversion integration in leopard. When I try to do a log command in textmate I get the following in the popup window:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/rexml/source.rb:226:in `pos': Illegal seek (Errno::ESPIPE) from / System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ rexml/source.rb:226:in `current_line' from /System/Library/Frameworks/ Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parseexception.rb: 44:in `line' from /System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/rexml/parseexception.rb:28:in `to_s' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/escape.rb: 30:in `htmlize' from /Applications/TextMate.app/Contents/SharedSupport/ Bundles/Subversion.tmbundle/Support/svn_helper.rb:90:in `handle_default_exceptions' from /Applications/TextMate.app/Contents/ SharedSupport/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:171 REXML::ParseException
I don't have any custom bundles loaded and I haven't done anything to the stock leopard ruby installation. Leopard was a scratch install on this machine too, so there shouldn't be any cruft left laying around from Tiger.
Any ideas?
Matt
On 14 Nov 2007, at 20:15, Matt Brandt wrote:
I'm having problems with the standard subversion integration in leopard. When I try to do a log command in textmate I get the following in the popup window: [...]
From that stack trace, it looks like either svn produces invalid XML or Ruby’s XML parser is broken.
Try: svn log --xml -v «whatever file/folder you requested the log for»
Then attach this log so I or someone else might try and reproduce it.
Also, is the broken log consistent for all files in this project, other projects on svn?
On Nov 15, 2007, at 12:44 AM, Allan Odgaard wrote:
On 14 Nov 2007, at 20:15, Matt Brandt wrote:
I'm having problems with the standard subversion integration in leopard. When I try to do a log command in textmate I get the following in the popup window: [...]
From that stack trace, it looks like either svn produces invalid XML or Ruby’s XML parser is broken.
Try: svn log --xml -v «whatever file/folder you requested the log for»
Then attach this log so I or someone else might try and reproduce it.
Also, is the broken log consistent for all files in this project, other projects on svn?
Allan,
It doesn't seem to happen to all files in the project. Probably has to do with some content of the particular log I guess. I've placed the log from one of the failures at http://walkingdog.net/svnlog because it is too large to be included inline (~6MB). The size may have something to do with the failure. The failure message was:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/rexml/source.rb:226:in `pos': Illegal seek (Errno::ESPIPE) from / System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ rexml/source.rb:226:in `current_line' from /System/Library/Frameworks/ Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parseexception.rb: 44:in `line' from /System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/rexml/parseexception.rb:28:in `to_s' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/escape.rb: 30:in `htmlize' from /Applications/TextMate.app/Contents/SharedSupport/ Bundles/Subversion.tmbundle/Support/svn_helper.rb:90:in `handle_default_exceptions' from /Applications/TextMate.app/Contents/ SharedSupport/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:171 REXML::ParseException
Thanks for taking a look.
Matt
On 15 Nov 2007, at 17:41, Matt Brandt wrote:
[...] It doesn't seem to happen to all files in the project. Probably has to do with some content of the particular log I guess. I've placed the log from one of the failures at http://walkingdog.net/svnlog because it is too large to be included inline (~6MB). The size may have something to do with the failure. The failure message was:
Unfortunately I cannot reproduce a problem with that log.
What I did was download your log to /tmp/log.xml then open Subversion.tmbundle/Support/format_log_xml.rb and add these two lines at the top:
ENV['TM_BUNDLE_SUPPORT'] = '/Users/duff/Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support' $stdin.reopen('/tmp/log.xml')
And then ⌘R — after a few seconds, it generated the HTML corresponding to that log.
Maybe you could try the same?
Btw: the log is only 1.4 MB, not 6 MB. Did you upload the proper one?
On Nov 16, 2007, at 5:42 AM, Allan Odgaard wrote:
On 15 Nov 2007, at 17:41, Matt Brandt wrote:
[...] It doesn't seem to happen to all files in the project. Probably has to do with some content of the particular log I guess. I've placed the log from one of the failures at http://walkingdog.net/svnlog because it is too large to be included inline (~6MB). The size may have something to do with the failure. The failure message was:
Unfortunately I cannot reproduce a problem with that log.
What I did was download your log to /tmp/log.xml then open Subversion.tmbundle/Support/format_log_xml.rb and add these two lines at the top:
ENV['TM_BUNDLE_SUPPORT'] = '/Users/duff/Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support' $stdin.reopen('/tmp/log.xml')
And then ⌘R — after a few seconds, it generated the HTML corresponding to that log.
Maybe you could try the same?
Btw: the log is only 1.4 MB, not 6 MB. Did you upload the proper one?
I did the following in the checked out directory:
svn log -v --xml pcisetup.c >svnlog cp /Applications/TextMate.app/Contents/SharedSupport/Bundles/ Subversion.tmbundle/Support/format_log_xml.rb .
added the following two lines to format_log_xml.rb (I don't have any custom bundles so there is no Application Support in my ~/Library)
ENV['TM_BUNDLE_SUPPORT'] = '/Applications/TextMate.app/Contents/ SharedSupport/Bundles/Subversion.tmbundle/Support' $stdin.reopen('svnlog')
⌘R
I get a window full of apparently valid HTML. I copied it into a file and opened that file in Safari and it rendered with a few minor glitches. Some of the links didn't work, but I guess that's to be expected since it is in a different environment than normal.
This was with a smaller log (only 1.4MB), but I get the same result when I try to do a log in TextMate. All of the other commands (blame, info, etc) seem to work ok though (at least for this file).
Matt
On 16 Nov 2007, at 16:50, Matt Brandt wrote:
[...] I did the following in the checked out directory:
[...]
I get a window full of apparently valid HTML. I copied it into a file and opened that file in Safari and it rendered with a few minor glitches. Some of the links didn't work, but I guess that's to be expected since it is in a different environment than normal.
This was with a smaller log (only 1.4MB), but I get the same result when I try to do a log in TextMate. All of the other commands (blame, info, etc) seem to work ok though (at least for this file).
Not sure how to read that. Are you saying you are *not* seeing any errors?
On Nov 17, 2007, at 3:06 AM, Allan Odgaard wrote:
On 16 Nov 2007, at 16:50, Matt Brandt wrote:
[...] I did the following in the checked out directory:
[...]
I get a window full of apparently valid HTML. I copied it into a file and opened that file in Safari and it rendered with a few minor glitches. Some of the links didn't work, but I guess that's to be expected since it is in a different environment than normal.
This was with a smaller log (only 1.4MB), but I get the same result when I try to do a log in TextMate. All of the other commands (blame, info, etc) seem to work ok though (at least for this file).
Not sure how to read that. Are you saying you are *not* seeing any errors?
I'm saying that doing the "svn -v --xml log" command then deeding the output to the ruby script generates HTML and seems to work, but If I do the svn log from inside textmate I get the error.
It seems like this is something other than the ruby xml parser. The error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/rexml/source.rb:226:in `pos': Illegal seek (Errno::ESPIPE) from / System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ rexml/source.rb:226:in `current_line' from /System/Library/Frameworks/ Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parseexception.rb: 44:in `line' from /System/Library/Frameworks/Ruby.framework/Versions/ 1.8/usr/lib/ruby/1.8/rexml/parseexception.rb:28:in `to_s' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/escape.rb: 30:in `htmlize' from /Applications/TextMate.app/Contents/SharedSupport/ Bundles/Subversion.tmbundle/Support/svn_helper.rb:90:in `handle_default_exceptions' from /Applications/TextMate.app/Contents/ SharedSupport/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:171 REXML::ParseException
starts with a ESPIPE which, I would think, indicates that something is disconnecting from the other side of a pipe before the parser is done. I don't really know enough about the flow of data here though to debug...
Matt
On 17 Nov 2007, at 17:54, Matt Brandt wrote:
[...] starts with a ESPIPE which, I would think, indicates that something is disconnecting from the other side of a pipe before the parser is done. I don't really know enough about the flow of data here though to debug...
If you look in the Subversion bundle the format_log_xml.rb script is called by this line:
"$TM_SVN" log --xml $LIMIT -vr "$TM_SVN_LOG_RANGE" \ "$TM_FILEPATH" 2>&1 | "$TM_RUBY" -- "$FORMAT_LOG"
With no variable set, the default values for the above should become:
svn log --xml --limit 15 -vr HEAD:1 \ «file» 2>&1 | ruby -- "${TM_BUNDLE_SUPPORT}/format_log_xml.rb"
Allan Odgaard-3 wrote:
On 17 Nov 2007, at 17:54, Matt Brandt wrote:
If you look in the Subversion bundle the format_log_xml.rb script is called by this line:
"$TM_SVN" log --xml $LIMIT -vr "$TM_SVN_LOG_RANGE" \ "$TM_FILEPATH" 2>&1 | "$TM_RUBY" -- "$FORMAT_LOG"
With no variable set, the default values for the above should become:
svn log --xml --limit 15 -vr HEAD:1 \ «file» 2>&1 | ruby -- "${TM_BUNDLE_SUPPORT}/format_log_xml.rb"
Digging up an old thread here, but I'm getting these same problems with the latest TextMate and the latest Subversion bundle.
When I run the second command above (the parsed one with defaults)[1] I get the same REXML error [2]. However, if I change it to this (two-liner) it works just fine (of course, it doesn't show in TM...):
svn log --xml --limit 15 -vr HEAD:1 «file» 2>&1 > ~/test.log ruby /Library/Application\ Support/TextMate/Bundles/Subversion.tmbundle/Support/format_log_xml.rb < ~/test.log
Any ideas?
Dave
[1] I had to set several ENV variables in the script before it would work: TM_BUNDLE_SUPPORT, TM_SUPPORT_PATH, and TM_SELECTED_FILES
[2] The error with the rescue block in format_log_xml.rb commented out: /opt/local/lib/ruby/1.8/rexml/parsers/treeparser.rb:90:in `parse': REXML::ParseException from /opt/local/lib/ruby/1.8/rexml/document.rb:190:in `build' from /opt/local/lib/ruby/1.8/rexml/document.rb:45:in `initialize' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:170:in `new' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:170
The error with the rescue block uncommented: /opt/local/lib/ruby/1.8/rexml/source.rb:226:in `pos': Illegal seek (Errno::ESPIPE) from /opt/local/lib/ruby/1.8/rexml/source.rb:226:in `current_line' from /opt/local/lib/ruby/1.8/rexml/parseexception.rb:44:in `line' from /opt/local/lib/ruby/1.8/rexml/parseexception.rb:28:in `to_s' from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/escape.rb:30:in `htmlize' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/svn_helper.rb:90:in `handle_default_exceptions' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:174
Dave Myron wrote:
The error with the rescue block in format_log_xml.rb commented out: /opt/local/lib/ruby/1.8/rexml/parsers/treeparser.rb:90:in `parse': REXML::ParseException from /opt/local/lib/ruby/1.8/rexml/document.rb:190:in `build' from /opt/local/lib/ruby/1.8/rexml/document.rb:45:in `initialize' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:170:in `new' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:170
The error with the rescue block uncommented: /opt/local/lib/ruby/1.8/rexml/source.rb:226:in `pos': Illegal seek (Errno::ESPIPE) from /opt/local/lib/ruby/1.8/rexml/source.rb:226:in `current_line' from /opt/local/lib/ruby/1.8/rexml/parseexception.rb:44:in `line' from /opt/local/lib/ruby/1.8/rexml/parseexception.rb:28:in `to_s' from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/escape.rb:30:in `htmlize' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/svn_helper.rb:90:in `handle_default_exceptions' from /Library/Application Support/TextMate/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:174
Nobody else is seeing this error? It's really strange the running the commands separately works but piping them together leads to these problems. Can anybody confirm this?
Thanks, Dave
On 24 Jan 2008, at 21:59, dave.myron wrote:
[...] the default values for the above should become:
svn log --xml --limit 15 -vr HEAD:1 \ «file» 2>&1 | ruby -- "${TM_BUNDLE_SUPPORT}/format_log_xml.rb"
Digging up an old thread here, but I'm getting these same problems with the latest TextMate and the latest Subversion bundle.
When I run the second command above (the parsed one with defaults) [1] I get the same REXML error [2].
So you can reproduce the error outside TextMate?
However, if I change it to this (two-liner) it works just fine (of course, it doesn't show in TM...): [...] The error with the rescue block uncommented: /opt/local/lib/ruby/1.8/rexml/source.rb:226:in `pos': Illegal seek (Errno::ESPIPE)
It would appear the REXML parser treats the IO object as more than just a pipe (i.e. it tries to seek).
Try instead of using ‘</tmp/test.log’ do: ‘cat /tmp/test.log|ruby …’, see if that changes things. Also try change ‘2>&1’ to ‘2>/dev/null’ in the version that fails for you in Terminal.