[TxMt] Mercurial Bundle: Diff Commands

Eike Bernhardt eike+textmate at unorganized.net
Wed May 16 07:29:53 UTC 2007


while testing mercurial I noticed that the diff commands in the
Mercurial Bundle behave differently than what I'm used to from the svn

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

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

        require 'hg_diff'
        Mercurial::diff_active_file("-r$rev2 -r$rev1", "Diff Revisions…")
) | 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.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hg_diff.rb.diff
URL: <http://lists.macromates.com/textmate/attachments/20070516/3e3f967d/attachment.diff>

More information about the textmate mailing list