hg cr not working inside thg output log window

Issue #1709 wontfix
Boris Glimcher
created an issue

Comments (6)

  1. Yuya Nishihara

    This happens because TortoiseHg executes all hg command in worker thread, but Qt widgets must be created in main thread.

    Instead, hgcr-gui-qt can inject entry point to TortoiseHg's command table, tortoisehg.hgqt.run.table. Then you can open CodeREviewDialog from log window as thg cr.

  2. Boris Glimcher reporter
    • changed status to open

    please add it to command table.

    you can use this patch:

    diff -r 82c2dd50c45e tortoisehg/hgqt/run.py
    --- a/tortoisehg/hgqt/run.py    Tue Apr 16 22:03:28 2013 +0200
    +++ b/tortoisehg/hgqt/run.py    Wed May 01 01:15:44 2013 +0300
    @@ -840,6 +840,11 @@
         from tortoisehg.hgqt.revdetails import run
         return qtrun(run, ui, *pats, **opts)
    +def hgcr(ui, *pats, **opts):
    +    """code review tool"""
    +    tmp = __import__('hgext.hgcr-gui-qt')
    +    return qtrun(vars(tmp)['hgcr-gui-qt'].run_with_gui, ui, *pats, **opts)
     ### help management, adapted from mercurial.commands.help_()
     def help_(ui, name=None, with_version=False, **opts):
         """show help for a command, extension, or list of commands
    @@ -1199,6 +1204,7 @@
         "^version": (version,
             [('v', 'verbose', None, _('print license'))],
             _('thg version [OPTION]')),
    +    "^cr": (hgcr, [], _('launch code review tool')),
     if os.name == 'nt':
  3. Yuya Nishihara

    @Boris Glimcher It should be available only if hgcr-gui-qt is enabled. So please update command table by extsetup():

    def extsetup(ui):
        from tortoisehg.hgqt import run
        run.table['^cr'] = ...

    Sadly it has no effect when executing thg cr from command-line, but it should be available in Output Log window.

  4. Yuya Nishihara

    @Boris Glimcher It worked fine, thanks.

    What is the correct protocol to update this extension inside thg-build repo?

    Maybe Steve will pick up the latest version. In case, please email him or thg-dev@googlegroups.com. I'm not good at packaging issue.

  5. Log in to comment