Sublime Forum

Looking to upgrade from 2 but

#1

Without a decent TortoiseHg solution we simply cannot!

We use Tortoise in Sublime Text 2, and I have chased before for a version that supports Sublime Text 3 a few times now, e.g. https://github.com/atwright147/sublime_tortoise/pull/1

I really like the fact you get the common commands on the context menu in the editor.

Another factor is the fact we are stuck on TortoiseHg 1.1.7 (so Mercurial 1.7.2… I know!), so none of the Mercurial plugins I’ve tried work.

Any ideas guys?

We have a ten user license, bought in 2011, so we’ll be paying to upgrade!

Cheers,
Westy

PS: Also, something I’ve just had to add to my key bindings:
{ “keys”: [“ctrl+alt+p”], “command”: “prompt_select_workspace” }

This should really be in the defaults, since cannot see another usage of ctrl+alt+p.
Apologies if this is there in a clean install…

0 Likes

#2

My 2 cents:

You are absolutely right. I have assigned Project Manager to that keys. It allows quickly changing projects with an ordinary quick panel and even can do some more stuff.

0 Likes

#3

Perhaps you can find an open source developer who you can sponsor to fix up the Sublime Tortoise package?

0 Likes

#4

Yeah, maybe. We’ll never find the time to do it ourselves that’s for sure!

Cheers

0 Likes

#5

Had a look myself, and have made some progress (since the plugin now loads).

Now need to figure out why get an error when trying to open the context menu for a file that’s under source control, with “expected bytes, bytearray or buffer compatible object”.

0 Likes

#6

Oh, it works if right-click again, kind of.
Every second click.

Hmm.

0 Likes

#7

I could try to take a quick look, if you post the entire traceback here.

0 Likes

#8

@FichteFoll
Hi,

If you’d be willing to take a look that’d be great!
Is there a way I can turn on more logging in the console?

All I’m getting is: “error: expected bytes, bytearray or buffer compatible object”

Cheers

0 Likes

#9

I see that plugins now support threading.
The fact that the issue is intermittent is perhaps hinting towards a thread-safety issue?

Is there a template plugin somewhere I could use as a new starting point to copy the existing code into?

Cheers

0 Likes

#10

Tools>Developer>New Plugin

0 Likes

#11

Unfortunately not. It seems like something is catching the exception and only outputs the error message but not the traceback, so we would have to go through all except blocks and look for the code that does this, disable it and produce a proper traceback.

0 Likes

#12

Oh, that makes sense, yeah.
That’s give me an angle of attack on the problem, thanks!

I’ll try and find some time to have a look at doing just this on Monday. Will report back with my findings.

Thanks a lot,
Westy

0 Likes

#13

Ok, progress!

I commented out a try…catch in process_status:

#try:
    status = vcs.check_status(path)
#except Exception as exception:
    #sublime.error_message(str(exception))

This, oddly, makes the plugin work fine.
This confused me, so I added a debug line after it:

if settings.get('debug'):
    print('check_status for', path, 'returned', status);

Adding this makes all hell break loose (since it’s called many times for any file it seems):
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Cloud Sync\OneDrive\Portable Software\Sublime Text 3\sublime_plugin.py”, line 722, in is_visible_
ret = self.is_visible()
File “C:\Cloud Sync\OneDrive\Portable Software\Sublime Text 3\Data\Packages\Tortoise\Tortoise.py”, line 71, in handler
res = fn(self, *args, **kwargs)
File “C:\Cloud Sync\OneDrive\Portable Software\Sublime Text 3\Data\Packages\Tortoise\Tortoise.py”, line 242, in is_visible
return self.get_vcs(path).get_status(path) in
File “C:\Cloud Sync\OneDrive\Portable Software\Sublime Text 3\Data\Packages\Tortoise\Tortoise.py”, line 551, in get_status
return self.process_status(hg, path)
File “C:\Cloud Sync\OneDrive\Portable Software\Sublime Text 3\Data\Packages\Tortoise\Tortoise.py”, line 371, in process_status
status = vcs.check_status(path)
File “C:\Cloud Sync\OneDrive\Portable Software\Sublime Text 3\Data\Packages\Tortoise\Tortoise.py”, line 645, in check_status
result = proc.run().split(’\n’)
File “C:\Cloud Sync\OneDrive\Portable Software\Sublime Text 3\Data\Packages\Tortoise\Tortoise.py”, line 569, in run
return proc.stdout.read().replace(’\r\n’, ‘\n’).rstrip(’ \n\r’)
TypeError: expected bytes, bytearray or buffer compatible object

I’ll keep digging.

Once again, thanks for the hint to disable exception handling. Feel like I’m getting somewhere!

Cheers,
Westy

0 Likes

#14

I’ve sorted it, thanks for the help!

1 Like