Sublime Forum

New Mercurial plugin for Sublime Text 2

#1

SublimeHg

Requires Mercurial 1.9 or later

It’s functional, but needs some more work.

bitbucket.org/guillermooo/sublimehg/overview

Features:

  • Uses the new command server in Mercurial
  • Frequent commands should work fine

Bugs:

  • Probably a few. Only tested on Windows 7.
  • Cannot commit files with spaces in their path if entire path is specified (use “commit” instead of “commit (this file)” or wildcards from the cmd-line)
  • Adds extra quotation marks to commit messages

(Also, hg-git is broken for Mercurial 1.9, so I cannot commit to the org until a patch is released.)

0 Likes

#2

That’s right, but I was still getting errors without the quotes… I’ll look into it again.

Thanks for the tip about shlex!

0 Likes

#3

Updated!

REQUIRES Mercurial 1.9 OR LATER

  • More commands
  • Server is used as a server
  • Better chance of working on all platforms
  • More stable

bitbucket.org/guillermooo/sublimehg/overview

0 Likes

#4

Thanks for the plugin, look great.

But I’ve an issue:
The “SublimeHg: Hg” command from the Command Palette doesn’t work for me.
The “hg” command run but I go straight to the on_done() procedure with a value -1, without showing the quick_panel.
log:

command: show_overlay {"overlay": "command_palette"} command: hg s = -1
OTOH, running the command view.run_command(‘hg’) from the console work as expected.

Any idea ?
A ST2 bug ?

startup, version: 2079 windows x64 channel: dev

0 Likes

#5

Yep. I meant to mention that in the readme, but I forgot. You need to assign them keys (I use f10 and ctrl+f10). There are other bugs in Sublime Text related to widgets and input focus that will affect the plugin too.

0 Likes

#6

And there is another bug due to shlex stripping \ from paths on Windows… That will be an issue from the command line box only, because I forgot to include “commit (this file)” and friends in the latest release… :smile:

0 Likes

#7

Thanks for your answer, guillermooo.

Did you inform Jon about these bugs ?

0 Likes

#8

Yep - input focus related issues will be fixed in the next dev build

0 Likes

#9

Updated!

  • Fixed several issues
  • Updated README
  • Added “commit (this file)”

bitbucket.org/guillermooo/sublimehg/overview

0 Likes

#10

Updated!

  • Won’t disconnect on error or input request
  • More commands

github.com/SublimeText/SublimeHg

0 Likes

#11

Haha. I hadn’t realized the irony. But I actually push to both, now that hg-git’s sort fo working again with Mercurial 1.9.

0 Likes

#12

Updated!

  • Server is restarted if hg root isn’t a prefix of the current file’s path

The server should now always find the correct repository for the current file.

github.com/SublimeText/SublimeHg

0 Likes

#13

When I use this plugin, I can’t work out how to get the hg command line to persist. Every time I enter a command, it disappears. Unfortunately this makes the plugin unusable for me; it’s much more efficient to use an external command prompt.

For example, let’s say I want to run hg status. This is what happens:

  • I press Shift + Control + P
    and select “SublimeHg: Open Hg Command Prompt”

  • The command prompt opens in a new editor panel. (Yay!
    )

  • I type “status”

  • The command prompt panel disappears (Boo
    !) and is replaced by a results panel (which shows the response from hg)

Now I want to run hg commit, perhaps followed by hg push. For each command, I have to start all over again. And when I’m debugging, this cycle repeats a lot.

Am I just being dense, or is this something that could be improved? It would be fantastic to get a persistent hg command prompt – one less window for me to manage. :smile:

0 Likes

#14

Agreed, it’s very annoying. It used to be possible to reopen input panels on_done in ST1, but last time I tried in ST2 it wouldn’t work. I’ll be switching to Mercurial’s own python client for the command server soon, so I’ll take a look at this too. I suppose you know, but simple actions can be performed from the Command Palette too (Ctrl+Shift+P).

0 Likes

#15

This version will attempt to restore the cmdline when you focus the view where you started it first:

bitbucket.org/guillermooo/subli … me-package

Make sure to ignore or overwrite SublimeHg to avoid conflicts.

It seems to work ok-ish here, but I’ve just whipped it up, so I dunno. If it holds together, I will apply the change in the next version.

0 Likes

#16

Updated!

github.com/SublimeText/SublimeHg

  • Persistent shell to the commad server
  • Empty output is ignored instead of printed to output buffer
0 Likes

#17

Updated!

github.com/SublimeText/SublimeHg

  • Tab completion for top-level commands in the command line
  • Command history (!h and !mkh)
0 Likes

#18

Updated!

  • All commands run in the background
  • Highlighting for status, log reports, etc.

Issues

  • Mercurial server works only off the current dir Sublime Text was started from
0 Likes

#19

Updated!

  • should run regardless of how Sublime Text is started
  • cmdline will be restored every time a SublimeHg - Output buffer loses focus (and if you entered it from a cmdline)
0 Likes

#20

Updated!

  • Use buffer as CLI of sorts
  • Use private server for each distinct repo

github.com/SublimeText/SublimeHg

0 Likes