On 17 December 2010 09:04, Sakari Jokinen <sakar...@gmail.com> wrote:
> Hi
>
> Is there a way to get new commands provided by extensions to hg
> visible also in the TortoiseHg context menu (or anywhere else in the
> GUI) . It is a bit of a drag to go to command line in windows all the
> time to use the extensions.
>
I think the Qt port contains a Mercurial commandline within TortoiseHg.
While this may not be exactly what you are looking for (GUI integration) at
least it allows you to use Mercurial extensions from TortoiseHg with zero
extra effort.
> I'm aware that TortoiseHg ships with built-in support for some
> extensions already. What I'm interested in is a generic solution that
> would not require forking and building TortoiseHg to provide support
> for some random extension.
>
> If this is not possible currently is there any idea how big of a task
> it would be to get something like this done? And where do I start :)
>
I think it is harder to provide a framework for extensions to plug into the
GUI, than it is to code the extension GUI directly in TortoiseHg. The
aproach is similar to that of Mercurial - you get to access the internals
directly with all pros and cons that gives you.
Depending on what you would like to happen when a new extension is added,
you might want to start at the main menu, simply adding commands. Take a
look at _setupactions in
workbench.py<https://bitbucket.org/tortoisehg/thg/src/4a41c1a78af3/tortoisehg/hgqt/workbench.py>
Or, you could look at
commit.py<https://bitbucket.org/tortoisehg/thg/src/4a41c1a78af3/tortoisehg/hgqt/commit.py>
or
update.py<https://bitbucket.org/tortoisehg/thg/src/4a41c1a78af3/tortoisehg/hgqt/update.py>to
get a feeling for what it takes to implement a single dialog for a
single
command.
You could copy one of those to a file with the same name as the extension,
and then integrate it into workbench.py or repowidget.py
Before you build a framework, try to integrate your favorite extension into
TortoiseHg. I'm currently adding support for pbranch -- veery slowly. Take a
look at pbranch.py to see how far I am.
And finally, remember that all your extension-changes must disable
themselves if the extension is not enabled.
Regards,
Peer
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Tortoisehg-discuss mailing list
Tortoisehg-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss