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"