-
-
Save gerrymanoim/1184449 to your computer and use it in GitHub Desktop.
simple script to checkout files you want to edit in sublime text 2 using P4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["f8"], "command": "p4_edit" } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["f8"], "command": "p4_edit" } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["f8"], "command": "p4_edit" } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin, os, subprocess | |
class P4EditCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
if self.view.file_name(): | |
folder_name, file_name = os.path.split(self.view.file_name()) | |
command = 'p4 edit -c default '+file_name | |
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=folder_name, shell=True) | |
result, err = p.communicate() | |
self.view.set_status('p4',result+err) | |
sublime.set_timeout(self.clear,2000) | |
def clear(self): | |
self.view.erase_status('p4') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use with Sublime Text 2, copy both these files into a new folder in your packages directory (Preferences -> Browse Packages).
github is having issues and including duplicate files in this gist.