Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (66 sloc) 2.15 KB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
def add_tm_support_to_path():
import os, sys
sys.path.append(os.environ['TM_BUNDLE_SUPPORT'])
sys.path.append(os.environ['TM_SUPPORT_PATH'] + '/lib')
add_tm_support_to_path()
from perforce_bundle_helper import *
import dialog
'''
Most commands work on all of TM_SELECTED_FILES. Here, we are explicitly only
interested in the first one.
'''
source_path = os.environ['TM_SELECTED_FILE'] if os.environ.has_key('TM_SELECTED_FILE') \
else os.environ['TM_FILEPATH'] if os.environ.has_key('TM_FILEPATH') \
else ''
relative_source_path_in_list = get_files_relative_to_p4_workspace([source_path]) if source_path else ''
relative_source_path = relative_source_path_in_list[0] if relative_source_path_in_list else ''
if relative_source_path:
default_path = relative_source_path
if os.path.isdir(source_path):
source_path += '/...'
default_path += '/...'
destination_path = dialog.get_string(
title = "Move Files With P4...",
prompt = "Please enter a destination relative to your workspace.",
string = default_path
)
if destination_path:
run_p4_command_on_selected_textmate_files('edit')
p4_response = run_p4_command('move', [source_path, destination_path])
print(stdout_to_html(p4_response))
rescan_project()
else:
print("You did not supply a destination. Command cancelled.")
else:
print("This file is not in your P4 workspace.")</string>
<key>input</key>
<string>none</string>
<key>inputFormat</key>
<string>text</string>
<key>name</key>
<string>Move…</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>html</string>
<key>outputLocation</key>
<string>newWindow</string>
<key>scope</key>
<string>attr.scm.p4</string>
<key>semanticClass</key>
<string>action.scm.move</string>
<key>uuid</key>
<string>8B71655C-276C-4379-9FF4-2BCEA4D35C5D</string>
<key>version</key>
<integer>2</integer>
</dict>
</plist>