Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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()
Beispiel #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()
Beispiel #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)
Beispiel #7
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
Beispiel #8
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
Beispiel #9
0
def main():
    os.environ['THGDEBUG'] = '1'
    os.environ['THG_GUI_SPAWN'] = '1'
    run.qtrun(_hookqtrun, ui.ui())
Beispiel #10
0
def _runhgcommand(self, arg):
    def newdlg(ui):
        return cmdui.Dialog(shlex.split(arg))
    run.qtrun(newdlg, self.user_ns['ui'])
Beispiel #11
0
def main():
    os.environ['THGDEBUG'] = '1'
    os.environ['THG_GUI_SPAWN'] = '1'
    run.qtrun(_hookqtrun, ui.ui())
Beispiel #12
0
def _runhgcommand(self, arg):
    def newdlg(ui):
        return cmdui.Dialog(shlex.split(arg))

    run.qtrun(newdlg, self.user_ns['ui'])
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