# Encoding: UTF-8 [{beforeRunningCommand: "nop", command: "\"${TM_P4:=p4}\" add \"$TM_FILEPATH\"\n", input: "none", keyEquivalent: "^$", name: "Add to Depot", output: "showAsTooltip", uuid: "AD9B4CB8-7577-11D9-A32D-000A95A89C98"}, {beforeRunningCommand: "nop", command: "\"${TM_P4:=p4}\" annotate -c -i -q \"$TM_FILEPATH\"\n", input: "none", keyEquivalent: "^$", name: "Annotate", output: "openAsNewDocument", uuid: "D6F5F368-C476-4882-82EA-D11E22A445BF"}, {beforeRunningCommand: "nop", command: "labels=`\"${TM_P4:=p4}\" labels | cut -d \" \" -f 2`\n#echo $labels\n\ndifflabels=`osascript</dev/null 2>&1 -e 'tell application \"TextMate\" to activate' &\texit 0\t\nfi\n\nrevs=( $revs )\n\nruby -I \"$TM_BUNDLE_SUPPORT/lib/\"<> \"$HOME/P4Cache/OfflineAdds.txt\";\n", input: "none", keyEquivalent: "^$", name: "Offline Add to Depot", output: "showAsTooltip", uuid: "1194ED50-336C-45F8-9E73-C777FB3FAF88"}, {beforeRunningCommand: "nop", command: "# record a file that we're editing offline for later\n# (presumably when access to Perforce is restored)\n\n# first, unlock the file if we need to unlock it\nchmod +r \"$TM_FILEPATH\"\n/Developer/Tools/SetFile -a l \"$TM_FILEPATH\"\n\n# now record the file\nmkdir -p \"$HOME/P4Cache\"\necho \"$TM_FILEPATH\" >> \"$HOME/P4Cache/OfflineEdits.txt\";\n", input: "none", keyEquivalent: "^$", name: "Offline Open For Editing", output: "showAsTooltip", uuid: "092CED4D-9C4C-4ED7-BB6A-5C80D929D9FD"}, {beforeRunningCommand: "nop", command: "\n# if we have offline edits, send them now (assumes we're actually online again)\nif [[ -e \"$HOME/P4Cache/OfflineEdits.txt\" ]]; then\n\t\"$TM_P4\" -x \"$HOME/P4Cache/OfflineEdits.txt\" edit && rm \"$HOME/P4Cache/OfflineEdits.txt\"\nfi\n\n# if we have offline adds, send them now (assumes we're actually online again)\nif [ -e \"$HOME/P4Cache/OfflineAdds.txt\" ]; then\n\t\"$TM_P4\" -x add \"$HOME/P4Cache/OfflineAdds.txt\" && rm \"$HOME/P4Cache/OfflineAdds.txt\"\nfi\n", input: "none", keyEquivalent: "^$", name: "Offline Send Offline Edits", output: "showAsTooltip", uuid: "A1DCDF0B-628B-4590-87C0-A551DC1F5F3A"}, {beforeRunningCommand: "nop", command: "\"${TM_P4:=p4}\" edit \"$TM_FILEPATH\"\n", input: "none", keyEquivalent: "^$", name: "Open for Editing", output: "showAsTooltip", uuid: "9982EC7A-7577-11D9-A32D-000A95A89C98"}, {beforeRunningCommand: "nop", command: "\"${TM_P4:=p4}\" revert \"$TM_FILEPATH\"\n\n# force TM to refresh the current file..\nrescan_project\n", input: "none", keyEquivalent: "^$", name: "Revert to Latest", output: "showAsTooltip", uuid: "E73FA01C-7625-11D9-B58C-000A95A89C98"}, {beforeRunningCommand: "nop", command: "#!/usr/bin/env ruby -w\n\n$LOAD_PATH << ENV['TM_BUNDLE_SUPPORT'] + \"/lib\"\n$LOAD_PATH << ENV['TM_SUPPORT_PATH'] + \"/lib\"\n\nrequire 'p4_forms'\nrequire 'shelltokenize'\n\np4\t\t\t\t= ENV['TM_P4'] || 'p4'\n#commit_paths\t= ENV['CommitPaths']\nsupport\t\t\t= ENV['TM_SUPPORT_PATH']\ncommit_tool\t\t= support + \"/bin/CommitWindow.app/Contents/MacOS/CommitWindow\"\n\nignore_file_pattern = /(\\/.*)*(\\/\\..*|\\.(tmproj|o|pyc)|Icon)/\n\n\nStatusMap = {\t'edit' \t\t=> 'M',\n\t\t\t'add'\t\t=> 'A',\n\t\t\t'delete'\t=> 'D'}\n\t# TODO others probably needed\n\t\t\noutput = %x{\"\#{p4}\" change -o}\nputs output\n\ncommit_form = Perforce::Form.new(output)\n#puts commit_form.inspect\n\nraw_paths = commit_form.paths_from_entry(\"Files\")\ncommit_paths = []\ncommit_status = []\n\nraw_paths.each do |path|\n\tmatch = /^(.*)\\s#\\s(\\w*)/.match(path)\n\tcommit_paths.push(match[1])\n\tcommit_status.push(match[2])\nend\n\t\t\n# map to CVS-like status for CommitWindow display\ncommit_status = commit_status.collect{|status| StatusMap[status]}\n\ncommit_paths = commit_paths.collect {|path| path.p4_to_local_path }\ncommit_path_text = commit_paths.join_p4_to_local_paths\n\n#puts commit_path_text\n#puts \"--------------\"\n\ncommit_args = %x{\"\#{commit_tool}\" --status \#{commit_status.join(\":\")} \#{commit_path_text}}\n#puts commit_args\n#puts \"--------------\"\n\ncommit_tokens = commit_args.tokenize\n\n#puts commit_tokens.inspect\n\ncommit_form.fields['Status'] = 'pending'\ncommit_form.fields['Description'] = commit_tokens[1]\ncommit_form.fields['Files'] = commit_tokens[2...commit_tokens.size].local_to_p4_paths.inject(\"\") {|out, path| out += \"\#{path}\\n\" }\n\n\nputs commit_form.to_s\n\nIO.popen(%Q{\"\#{p4}\" submit -i}, \"w+\" ) {|p| p.puts commit_form.to_s }\n\n", input: "none", keyEquivalent: "^$", name: "Submit Changelist…", output: "openAsNewDocument", uuid: "BE2B6161-2E23-4C08-B438-409BB1E82DA8"}]