Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Blame, Add, and Diff to the command palette #44

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions TortoiseSVN.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ def run(self, cmd, paths=None, isHung=False):
project_data = sublime.active_window().project_data()
project_folder = project_data['folders'][0]['path']
path = path.replace("${PROJECT_PATH}", project_folder);
paths[index] = path
paths[index] = path
dir = self.get_path(paths)

if not dir:
return

settings = self.get_setting()
tortoiseproc_path = settings.get('tortoiseproc_path')
pathEncoding = settings.get('pathEncoding')
Expand All @@ -27,8 +27,7 @@ def run(self, cmd, paths=None, isHung=False):
' please config setting file' '\n --sublime-TortoiseSVN')
raise

cmd = '"' + tortoiseproc_path + '"' +
' /command:' + cmd + ' /path:"%s"' % dir
cmd = '"' + tortoiseproc_path + '"' + ' /command:' + cmd + ' /path:"%s"' % dir

proce = subprocess.Popen(cmd.encode(pathEncoding) if pathEncoding else cmd , stdout=subprocess.PIPE)

Expand All @@ -55,7 +54,7 @@ def get_setting(self):
class MutatingTortoiseSvnCommand(TortoiseSvnCommand):
def run(self, cmd, paths=None):
TortoiseSvnCommand.run(self, cmd, paths, True)

self.view = sublime.active_window().active_view()
row, col = self.view.rowcol(self.view.sel()[0].begin())
self.lastLine = str(row + 1);
Expand All @@ -74,7 +73,7 @@ def run(self, paths=None):
settings = self.get_setting()
closeonend = ('3' if True == settings.get('autoCloseUpdateDialog')
else '0')
MutatingTortoiseSvnCommand.run(self, 'update /closeonend:' + closeonend,
MutatingTortoiseSvnCommand.run(self, 'update /closeonend:' + closeonend,
paths)


Expand Down Expand Up @@ -125,4 +124,4 @@ def run(self, paths=None):

class SvnBranchCommand(TortoiseSvnCommand):
def run(self, paths=None):
TortoiseSvnCommand.run(self, 'copy', paths)
TortoiseSvnCommand.run(self, 'copy', paths)
5 changes: 4 additions & 1 deletion TortoiseSVN.sublime-commands
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
{ "caption": "TortoiseSVN: Add", "command": "svn_add" },
{ "caption": "TortoiseSVN: Blame", "command": "svn_blame" },
{ "caption": "TortoiseSVN: Diff", "command": "svn_diff" },
{ "caption": "TortoiseSVN: Update", "command": "svn_update" },
{ "caption": "TortoiseSVN: Commit", "command": "svn_commit" },
{ "caption": "TortoiseSVN: Revert", "command": "svn_revert" },
{ "caption": "TortoiseSVN: Log", "command": "svn_log" }
]
]