Hello,
while testing mercurial I noticed that the diff commands in the
Mercurial Bundle behave differently than what I'm used to from the svn
bundle.
When I select a folder in the drawer and issue any diff command using
the subversion bundle, I get a diff for all files under that selected
folder.
The mercurial diff commands always use the currently active file in the
diff commands.
Changing the hg_diff.rb file enables me to select a folder and get a
diff for everything under it:
@@ -6,7 +6,7 @@
module Mercurial
def Mercurial.diff_active_file( revision, command )
hg = ENV['TM_HG'] || 'hg'
- target_path = ENV['TM_FILEPATH']
+ target_path = ENV['TM_SELECTED_FILE'] || ENV['TM_FILEPATH']
work_path = ENV['WorkPath']
path = target_path.sub(/^#{work_path}\//, '')
output_path = File.basename(target_path) + ".diff"
(patch is attached)
While I'm here .. I had to change all diff commands do something like
(
"${TM_RUBY:=ruby}" -I "$TM_BUNDLE_SUPPORT/" <<END
require 'hg_diff'
Mercurial::diff_active_file("-r$rev2 -r$rev1", "Diff Revisions…")
END
) | iconv -t UTF-8 -c
since without the iconv call I'd get empty diff windows (probably
because of incorrectly encoded german special chars inside the generated
diff) -- but I'm not shure if this is just a local problem.
Bye,
Eike
Index: /Library/Application Support/TextMate/Bundles/Mercurial.tmbundle/Support/hg_diff.rb
===================================================================
--- /Library/Application Support/TextMate/Bundles/Mercurial.tmbundle/Support/hg_diff.rb (revision 7253)
+++ /Library/Application Support/TextMate/Bundles/Mercurial.tmbundle/Support/hg_diff.rb (working copy)
@@ -6,7 +6,7 @@
module Mercurial
def Mercurial.diff_active_file( revision, command )
hg = ENV['TM_HG'] || 'hg'
- target_path = ENV['TM_FILEPATH']
+ target_path = ENV['TM_SELECTED_FILE'] || ENV['TM_FILEPATH']
work_path = ENV['WorkPath']
path = target_path.sub(/^#{work_path}\//, '')
output_path = File.basename(target_path) + ".diff"
I'd love to have a command that can put the current symbol on the
clipboard, and this would be short-work if the current symbol where
available via a TM_* variable, but I'm not seeing it.
My particular use case is Python and I'd like to be able to easily
construct "<module>.<class>.<method>" or "<class>.<method>".
I see no way of getting this information, short of writing a python-
specific parser to grab it (using TM_LINE_NUMBER to figure out where
the cursor is). Am I missing something?
j.
I have a user of my FlickrMate bundle getting the following error...
error 63 (File name too long) opening sem /tm_dialog async/
> nilsborchers/4.
> tm_dialog (async_update): Window '4' doesn't exist
> /Applications/TextMate.app/Contents/SharedSupport/Support/lib/
> dialog.rb:83:in /bin/bash: -c: line 1: unexpected EOF while looking
> for matching `''
> /bin/bash: -c: line 4: syntax error: unexpected end of filecall'
> from /Applications/TextMate.app/Contents/SharedSupport/
Support/lib/
> progress.rb:36:in /bin/bash: -c: line 1: unexpected EOF while
> looking for matching `''
> /bin/bash: -c: line 3: syntax error: unexpected end of filecall'
> from /Applications/TextMate.app/Contents/SharedSupport/
Support/lib/
> progress.rb:49:in /bin/bash: -c: line 1: unexpected EOF while
> looking for matching `''
> /bin/bash: -c: line 3: syntax error: unexpected end of filefork'
> from /Applications/TextMate.app/Contents/SharedSupport/
Support/lib/
> progress.rb:47:in /bin/bash: -c: line 1: unexpected EOF while
> looking for matching `''
> /bin/bash: -c: line 3: syntax error: unexpected end of filedialog'
> from /Applications/TextMate.app/Contents/SharedSupport/
Support/lib/
> progress.rb:40:in
It's occurring during the "Browse Flickr Photos" command. If anyone
is familiar with that particular error, could you please let me know
what it might be related to?
Thanks,
Brett
Hi. This may be an another obvious thing I have missed, but:
Running Ruby produces beautiful output, through Rubymate. But running
shell commands splats the output into a plain window, with output and
errors thrown in together, and line endings ignored.
Is there any way to pipe shell output through Rubymate, or any similar
functionality for the shell?
---
Bruno
Hi TextMaters,
I recently started to translate TextMate manual into Japanese.
Subversion repository is located at http://macromates.com/svn/Bundles/
trunk/Manual/pages .
`en` directory is a Markdown version of Allan's original manual,
which I use as a source of translation and as a template. We can,
therefore, expect the same look of the translation, sharing the same
graphics and layout if Allan can tweak his script a bit.
`ja` is used for the translation. Except for a `_read_me.mdown` file,
the directory will have the same file names. My plan is to translate
the all contents quickly but roughly, and polish the translation
later on. At the moment, there's no way to *compile* a book from the
files. (Note: I haven't even translated 5% of the Manual yet.)
**Caution**
TextMate doesn't support CJK at this moment. Users including those
who use [Fake CJK Support](http://macromates.com/blog/archives/
2006/11/09/faking-cjk-support/) are encouraged *not* to open files
other than `_read_me` file in the directory with TextMate. TextMate
or the entire system may hang. You may be able to open, but
converting the Markdown to HTML may also be a cause of this hang.
From my personal experience, handling lots of CJK text prones to
this issue.
Since I can't find anyone else who is using TextMate with a large set
of Japanese text, the problem may be personal. But for now, my
suggestion is that you not use TextMate to open the files. I get a
few emails saying I'm putting virus, but .mdown files are just plain
text files.
Takaaki
--
Takaaki Kato
http://samuraicoder.net
I'm having a problem running the default task with RakeMate. Rake reports
an error saying that '(default task)' is not a valid task. I worked around
the problem by converting the 'task' variable returned by TextMate::
UI.request_item to a string on line 58 of rake_mate.rb:
task = task.to_s
Apparently request_item is return an Array, so 'task == DEFAULT_TASK'
returns false. Converting task to a string fixes it. I'm using TextMate
1383, which is the latest cutting edge I believe.
Steve
I've been using CSSEdit for the last few days, and it's got a really
nice interface. There is a left-hand pane which is the equivalent of
the popup menu for functions in Textmate. And crucially, there is a
live search box at the top which filters that pane, so you start
typing, say 'news', and it shows all selectors with a class or id
containing that word.
I personally think that would be a great feature for Textmate to have,
perhaps in a drawer on the other side from the Projects drawer. The
popup menu is pretty unwieldy (IMHO) with big documents.
---
Bruno
Hello all,
I'm working on a command that generates some functions for a set of
variables, and I'd like to print out the result in line with the text
that is selected. Is there any really clean way to do this that I'm
not aware of? I need to get the tab indentation of one of the
selected lines of text.
Thanks,
Michael
Dear All,
I have a strange situation wherein the output of a command appears
properly if I select "Show as HTML", but disappears if I select
"Create New Document" (i.e., a blank file appears). Why does this
happen?
Here is the full story:
I wanted to modify the subversion Diff commands to use wdiff instead
of subversions built-in capacities. I added an enviornment variable
called "TM_SVN_DIFF_CMD", with a value "wdiff_svn_wrapper.sh".
"wdiff_svn_wrapper.sh" is simply a wrapper script that calls "wdiff
$6 $7". I do this in order to get read of the numerous options that
subversion attaches, and retain only the file names.
If I then use the commands "Diff Revisions..." or "Diff With
Revision..." everything works perfectly: I get the appropriate
comparison between the appropriate revision. If I use "Diff With
Newest (Head)" or "Diff With Working Copy (Base)", etc., I get the
appropriate output if I select "Show as HTML" for the output, but a
blank document if I select "Create New Document" as output. What can
be happening?
Thanks,
Zvi