Permalink
Browse files

Update Darcs bundle to have formatted changes output and a working ad…

…d files command

git-svn-id: http://svn.textmate.org/trunk/Bundles/Darcs.tmbundle@1563 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent 772e517 commit 7122ee139bdae491c3d9559eb61949b9932921c8 David Powers committed Aug 16, 2005
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
- <string>saveActiveFile</string>
+ <string>nop</string>
<key>command</key>
<string>if [[ -z $TM_SELECTED_FILES ]]; then
DARCSPaths=`echo \'$TM_FILEPATH\'`;
@@ -12,15 +12,26 @@ else
fi
cd "$TM_DIRECTORY";
-"${TM_DARCS:=/usr/local/bin/darcs}" add -r $DARCSPaths</string>
+
+"${TM_RUBY:=ruby}" &lt;&lt;'EOF'
+require 'pathname'
+
+basedir = Pathname.new(ENV['TM_DIRECTORY']).realpath()
+addlist = Array.new()
+ENV['TM_SELECTED_FILES'].split(/' '/).each() { |addfile|
+ addfile = addfile[/^'?(.*?)'?$/, 1]
+ addlist &lt;&lt; "'#{Pathname.new(addfile).realpath.relative_path_from(basedir).to_s.gsub(/(')/, "\\\1")}'"
+}
+output = `darcs add -r #{addlist.join(' ')}`
+puts(output)</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@d</string>
<key>name</key>
<string>Add to repository</string>
<key>output</key>
- <string>showAsTooltip</string>
+ <string>discard</string>
<key>uuid</key>
<string>81229AD0-DE5C-11D9-823F-000A95A51A76</string>
</dict>
@@ -6,7 +6,7 @@
<string>nop</string>
<key>command</key>
<string>cd "$TM_DIRECTORY";
-"${TM_DARCS:=/usr/local/bin/darcs}" changes</string>
+darcs changes --xml</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
@@ -6,7 +6,7 @@
<string>saveModifiedFiles</string>
<key>command</key>
<string>cd "$TM_DIRECTORY";
-"${TM_DARCS:=/usr/local/bin/darcs}" pull -a</string>
+darcs pull -a</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
@@ -6,7 +6,7 @@
<string>nop</string>
<key>command</key>
<string>cd "$TM_DIRECTORY";
-"${TM_DARCS:=/usr/local/bin/darcs}" push -a </string>
+darcs push -a </string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
@@ -16,7 +16,7 @@ if(output[0] !~ /^1$/)
exit
end
-output = `darcs record -a -m '#{output[1].strip.gsub(/'/, '\\\\1')}' '#{ENV['TM_FILEPATH'][/[^\/]+$/].gsub(/'/, '\\\\1')}'`
+output = `darcs record -a -m '#{output[1].strip.gsub(/'/, '\\\\1')}' '#{File.basename(ENV['TM_FILEPATH']).gsub(/'/, '\\\\1')}'`
puts(output)</string>
<key>input</key>

0 comments on commit 7122ee1

Please sign in to comment.