Sublime Forum

TortoiseSVN, TortoiseGit and TortoiseHg Plugin

#1

Sublime Tortoise is a plugin for Sublime Text 2 that gives context-sensitive keyboard shortcuts, context menu entries and sidebar menu entries for SVN, Git and Mercurial through the TortoiseSVN, TortoiseGit and TortoiseHg programs on Windows.

Simply enter one of the shortcuts, or click the appropriate menu item, and Sublime Tortoise will start the appropriate Tortoise* window for the working copy the file is located inside of, in the case of working copy operations, or the file that is selected. No configuration is necessary and it works on any file.

wbond.net/sublime_packages/tortoise includes full documentation including installation instructions, keyboard bindings and settings.

[size=150]Updates[/size]

Version 1.2.0

  • Added keyboard shortcut and file menu entry for blame command

Version 1.1.4

  • Fixed TortoiseHg support

  • Fixed handling of nested mercurial repositories

  • Improved TortoiseHg support so a cmd window is not shown even when a file path contains a space

Version 1.1.3

  • Fixed a bug with TortoiseProc.process_status()
    not properly referencing self.root_dir

Version 1.1.2

  • Fixed a bug with the Log and Diff menu entries showing for folders that were not under version control

Version 1.1.1

  • Removed a print line used for debugging

Version 1.1.0

  • Tweaked handling of statuses

  • Added the ability to disable menus

  • Added debug option

Version 1.0.8

  • Updated the keymap to actually require the ctrl+alt+v
    before the ctrl+alt+(letter) for the different commands

Version 1.0.7

  • Increased the status cache length to help prevent right-click lag on slower machines

Version 1.0.6

  • Fixed a bug with the detection of the svn binary for the Tortoise SVN context menu

Version 1.0.5

  • Fixed the plugin to work when custom paths are set for the Tortoise* binaries

  • Fixed the example Tortoise.sublime-settings

Version 1.0.4

  • Updated the plugin to work with TortoiseHg 2.x

Version 1.0.3

  • Changed references of Delete to Remove

  • Added documentation for menu items

  • Added the revert keyboard shortcut

Version 1.0.2

  • Added context menu and sidebar menu entries based on the current state of the file or folder

Version 1.0.1

  • Added an error message when trying to execute command on an unsaved file

Version 1.0.0

  • Initial release
0 Likes

Git plugin?
#2

Looks like an awesome plugin. However I can only get the first command to work on Windows 7 64bit, with the latest TortoiseHg 1.1.9 64bit and Sublime Text 2 bulid 2032

These commands don’t work.

[code]** ctrl+alt+v, ctrl+alt+l - working copy log
** ctrl+alt+v, ctrl+alt+s - working copy status
** ctrl+alt+v, ctrl+alt+c - working copy commit
** ctrl+alt+v, ctrl+alt+u - working copy update/sync

  • The following commands are run on the current file:
    ** ctrl+alt+v, ctrl+alt+f - diff file
    ** ctrl+alt+v, ctrl+alt+a - add file
    ** ctrl+alt+v, ctrl+alt+r - remove file
    ** ctrl+alt+v, ctrl+alt+g - log of file
    [/code]

This one does…

** ctrl+alt+v, ctrl+alt+e - launch explorer to working copy
0 Likes

#3

I am also running 2032 on Windows 7 64bit, with TortoiseHg 1.1.9.1.

Can you check and see if there is any console output (ctrl+`) when pressing the keys?

0 Likes

#4

No errors output i’m afraid :stuck_out_tongue:

0 Likes

#5

Are you running the 64bit or the 32bit version of ST2?

0 Likes

#6

The 64bit. This is what I get on startup if it helps at all.

startup, version: 2032 windows x64 channel: stable executable: /C/Program Files/Sublime Text 2/sublime_text.exe working dir: /C/Windows/system32 packages path: /C/Users/robin/AppData/Roaming/Sublime Text 2/Packages settings path: /C/Users/robin/AppData/Roaming/Sublime Text 2/Settings error parsing session: No data at: 0:0 PackageSetup not required catalogue loaded found 1 files for base name Default.sublime-theme found 3 files for base name Default (Windows).sublime-keymap found 1 files for base name Main.sublime-menu Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\comment.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\copy_path.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\delete_word.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\detect_indentation.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\duplicate_line.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\exec.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\find_under_expand.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\font.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\goto_line.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\indentation.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\kill_ring.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\mark.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\save_on_focus_lost.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\scroll.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\sort.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\swap_line.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\switch_file.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\transform.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\transpose.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Default\trim_trailing_white_space.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\HTML\html_completions.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Less\CompileLessOnSave.py Reloading plugin C:\Users\robin\AppData\Roaming\Sublime Text 2\Packages\Tortoise\Tortoise.py loading bindings theme loaded app ready loaded 933 snippets

0 Likes

#7

All we need now is FTP :wink:

0 Likes

#8

@jbrooksuk

I am working on an SFTP plugin that is of beta quality on Windows. I don’t currently have FTP support, but I am going to look into it once SFTP is pretty solid.

If anyone is interested in beta testing on Windows, Linux or OSX, shoot me an email at will@wbond.net.

0 Likes

#9

@firefusion

Can you try pasting this command into your console and see if you get any result? You should do it when you have a file open that is inside of your Hg working copy.

sublime.active_window().active_view().run_command('tortoise_commit')
0 Likes

#10

Also, when trying to work out why key bindings aren’t working, it’s handle to run sublime.log_commands(True) in the console, to verify that the commands are actually being run.

0 Likes

#11

Ok I get this error in the latest ST

Traceback (most recent call last): File ".\sublime_plugin.py", line 243, in run_ File ".\Tortoise.py", line 50, in run File ".\Tortoise.py", line 17, in get_vcs File ".\Tortoise.py", line 194, in __init__ File ".\Tortoise.py", line 127, in find_root File ".\ntpath.py", line 205, in dirname File ".\ntpath.py", line 170, in split File ".\ntpath.py", line 125, in splitdrive TypeError: 'NoneType' object is unsubscriptable

0 Likes

#12

Any ideas?

0 Likes

#13

?

0 Likes

#14

From what I can tell, you were trying perform VCS operations on a file that had not been saved yet. I updated the plugin on Github (github.com/wbond/sublime_tortoise) last night to show an error when this happens.

Last night I also add context menu and sidebar menu support to the plugin. I should be publishing these features later today.

0 Likes

#15

I’ve pushed the latest version to Github (github.com/wbond/sublime_tortoise), which contains context and sidebar menu commands, plus a keyboard shortcut for reverting a file.

0 Likes

#16

Ok I get the following error message…

http://dl.dropbox.com/u/497583/screenshots/tortoisehg_sublime_error.png

I have this in that config file. I don’t have a hgtk.exe anywhere so I used hg.exe. Is that ok?

{
	// "svn_tortoiseproc_path": r"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe",
	// "git_tortoiseproc_path": r"C:\Program Files\TortoiseGit\bin\TortoiseProc.exe",
	 "hg_hgtk_path": r"C:\Program Files\TortoiseHg\hg.exe", 
}
0 Likes

#17

@firefusion

Well, hg.exe won’t work since that is the command-line version of mercurial. It is odd that you don’t have an hgtk.exe - what version of TortoiseHg are you running? I have hgtk.exe in version 1.1.9.1.

0 Likes

#18

I’m running TortoiseHg 2.0.2 (with Mercurial 1.8.1) for windows 7 64bit. I’ve been using it since TortoiseHg 1.1.5 (with Mercurial 1.7). It’s totally weird. I tryed repairing the install but it hasn’t added it :stuck_out_tongue:

0 Likes

#19

A removal and reinstall didn’t help either :stuck_out_tongue:

Very strange. Must just be my karma.

0 Likes

#20

TortoiseHg 2.0 has migrated to PyQt from PyGtk.
I suppose hgtk.exe doesn’t exists anymore and was replaced with a new executable, check your installation folder and try with the exe files it contains.
With a little luck it could work without changing the ST2 plugin source.

0 Likes