Permalink
Browse files

Add commit method to ui.rb, this is a wrapper for 's commit window

  • Loading branch information...
1 parent 0761fcf commit 4adf3c7b00f3bcebe110d9d56c2e6d4aa12487e6 @joachimm committed Aug 22, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 Support/shared/lib/ui.rb
View
@@ -187,6 +187,27 @@ def menu(options)
return return_hash ? options[index] : index
end
+
+ def commit(diff, actions = [], statuses = [], files = [])
+ pid = fork do
+ STDOUT.reopen(open('/dev/null'))
+ STDERR.reopen(open('/dev/null'))
+
+ command = "#{TM_DIALOG} commit"
+ command << " --diff-cmd #{e_sh diff}"
+ plist = { 'action_commands' => actions, 'statuses' => statuses, 'files' => files }.to_plist
+
+ res = ::IO.popen(command, "w+") do |io|
+ io.write plist; io.close_write
+ OSX::PropertyList::load(io) rescue nil
+ end
+
+ open("/tmp/res-commit-after.txt", "w") do |f|
+ f.write "somebody #{res}"
+ end
+ end
+ return pid
+ end
# request a single, simple string
def request_string(options = Hash.new,&block)

0 comments on commit 4adf3c7

Please sign in to comment.