コード例 #1
0
def cmdview(ui, repo, *pats, **opts):
    """start light interactive history viewer from tortoisehg"""
    enforceversion()
    import cStringIO
    mystderr = cStringIO.StringIO()
    origstderr = sys.stderr
    sys.stderr = mystderr
    sys.__stdout__ = sys.stdout
    sys.__stderr__ = sys.stderr
    ret = 0
    try:
        from tortoisehg.hgqt.run import qtrun
        from tortoisehg.hgqt.run import debuglighthg as startfunc
        opts['repository'] = repo.root
        qtrun(startfunc, ui, *pats, **opts)

        sys.stderr = origstderr
        stderrout = mystderr.getvalue()
        errors = ('Traceback', 'TypeError', 'NameError', 'AttributeError',
                  'NotImplementedError')
        for l in stderrout.splitlines():
            if l.startswith(errors):
                from tortoisehg.hgqt.bugreport import run
                opts = {}
                opts['cmd'] = ' '.join(sys.argv)
                opts['error'] = 'Recoverable error (stderr):\n' + stderrout
                opts['nofork'] = True
                qtrun(run, ui.ui(), **opts)
                break
        sys.exit(ret)
    except SystemExit:
        raise
    except:
        sys.__stderr__ = sys.stderr = origstderr
        raise
コード例 #2
0
def annotate(parent, ui, repo, files):
    from tortoisehg.hgqt.manifestdialog import run
    from tortoisehg.hgqt.run import qtrun

    opts = {"repo": repo, "canonpath": files[0], "rev": repo["."].rev()}
    qtrun(run, repo.ui, **opts)
    return False
コード例 #3
0
def log(parent, ui, repo, files):
    from tortoisehg.hgqt.workbench import run
    from tortoisehg.hgqt.run import qtrun

    opts = {"root": repo.root}
    qtrun(run, repo.ui, *files, **opts)
    return False
コード例 #4
0
 def linkActivated(self, link):
     link = hglib.fromunicode(link)
     if link.startswith('subrepo:'):
         from tortoisehg.hgqt.run import qtrun
         from tortoisehg.hgqt import commit
         qtrun(commit.run, self.stwidget.repo.ui, root=link[8:])
     if link.startswith('shelve:'):
         from tortoisehg.hgqt import shelve
         dlg = shelve.ShelveDialog(self.stwidget.repo, self)
         dlg.finished.connect(dlg.deleteLater)
         dlg.exec_()
         self.refresh()
コード例 #5
0
 def linkActivated(self, link):
     link = hglib.fromunicode(link)
     if link.startswith('subrepo:'):
         from tortoisehg.hgqt.run import qtrun
         from tortoisehg.hgqt import commit
         qtrun(commit.run, self.stwidget.repo.ui, root=link[8:])
     if link.startswith('shelve:'):
         from tortoisehg.hgqt import shelve
         dlg = shelve.ShelveDialog(self.stwidget.repo, self)
         dlg.finished.connect(dlg.deleteLater)
         dlg.exec_()
         self.refresh()
コード例 #6
0
def enforceversion():
    """Verify we have an acceptable version of Mercurial

    Display an error dialog in the contrary.
    """
    from tortoisehg.util.hgversion import hgversion, checkhgversion
    errmsg = checkhgversion(hgversion)
    if errmsg:
        from tortoisehg.hgqt.bugreport import run
        from tortoisehg.hgqt.run import qtrun
        opts = {}
        opts['cmd'] = ' '.join(sys.argv)
        opts['error'] = '\n' + errmsg + '\n'
        opts['nofork'] = True
        qtrun(run, ui.ui(), **opts)
        sys.exit(1)
コード例 #7
0
ファイル: wctxactions.py プロジェクト: allenk/tortoisehg-caja
def annotate(parent, ui, repo, files):
    from tortoisehg.hgqt.manifestdialog import run
    from tortoisehg.hgqt.run import qtrun
    opts = {'repo': repo, 'canonpath': files[0], 'rev': repo['.'].rev()}
    qtrun(run, repo.ui, **opts)
    return False
コード例 #8
0
ファイル: wctxactions.py プロジェクト: allenk/tortoisehg-caja
def log(parent, ui, repo, files):
    from tortoisehg.hgqt.workbench import run
    from tortoisehg.hgqt.run import qtrun
    opts = {'root': repo.root}
    qtrun(run, repo.ui, *files, **opts)
    return False
コード例 #9
0
ファイル: ipythg.py プロジェクト: velorientc/git_test7
def main():
    os.environ['THGDEBUG'] = '1'
    os.environ['THG_GUI_SPAWN'] = '1'
    run.qtrun(_hookqtrun, ui.ui())
コード例 #10
0
ファイル: ipythg.py プロジェクト: velorientc/git_test7
def _runhgcommand(self, arg):
    def newdlg(ui):
        return cmdui.Dialog(shlex.split(arg))
    run.qtrun(newdlg, self.user_ns['ui'])
コード例 #11
0
def main():
    os.environ['THGDEBUG'] = '1'
    os.environ['THG_GUI_SPAWN'] = '1'
    run.qtrun(_hookqtrun, ui.ui())
コード例 #12
0
def _runhgcommand(self, arg):
    def newdlg(ui):
        return cmdui.Dialog(shlex.split(arg))

    run.qtrun(newdlg, self.user_ns['ui'])
コード例 #13
0
def annotate(parent, ui, repo, files):
    from tortoisehg.hgqt.manifestdialog import run
    from tortoisehg.hgqt.run import qtrun
    opts = {'repo': repo, 'canonpath' : files[0], 'rev' : repo['.'].rev()}
    qtrun(run, repo.ui, **opts)
    return False