Skip to content

Commit

Permalink
Add svnPath option for native commands
Browse files Browse the repository at this point in the history
  • Loading branch information
m-hall committed Nov 24, 2015
1 parent 885fe7e commit 962b5d9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions HypnotoadSVN.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
// NOTE: this does not prevent use of native SVN, just enabling the user commands
"disable": false,

// The path to the svn binary
// leave it to false to use the command "svn"
// Make a string with the full path to the binary or command otherwise
"svnPath": false,

// Sets the minimum length for a commit message.
// 0 or less means no message is required
"commitMessageSize": 0,
Expand Down
14 changes: 14 additions & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ Allows the user to disable all native SVN commands.
"disable": false,
```

### SVN Path
Allows you to overwrite the location of the svn command, or to link to it if it's not in your PATH.
```Javascript
// Default (just use "svn" command instead of full path)
"svnPath": false
// Windows typically installs it to (with TortoiseSVN)
"svnPath": "C:\\Program Files\\TortoiseSVN\\bin\\svn.exe"
// OSX typicalls installs it to (with XCode)
"svnPath": "/Applications/Xcode.app/Contents/Developer/usr/bin/svn"
```
### Output
Modifies the way SVN commands send their output.
The default "outputTo" option is "panel".
Expand Down
6 changes: 5 additions & 1 deletion svn_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def nothing(self, nothing1=None, nothing2=None, nothing3=None, **args):

def run_command(self, cmd, files=None, log=True, async=True, on_complete=None):
"""Starts a process for a native command"""
return thread.Process(self.svn_name, 'svn ' + cmd, files, log, async, on_complete)
svn_path = settings.get_native('svnPath', False)
if svn_path is False:
return thread.Process(self.svn_name, 'svn ' + cmd, files, log, async, on_complete)
else:
return thread.Process(self.svn_name, svn_path + ' ' + cmd, files, log, async, on_complete)

def run_tortoise(self, cmd, files):
"""Starts a process for a TortoiseSVN command"""
Expand Down

0 comments on commit 962b5d9

Please sign in to comment.