def run(self):
        # The requested command interacts with remote repository or is potentially
        # long-running. We run it in its own console so it can be killed easily
        # by the user. Also, they have a chance to enter credentials if necessary.
        if utils.is_flag_set(self.command_data.flags, RUN_IN_OWN_CONSOLE):
            # FIXME: what if self.fname is None?
            target_dir = (self.fname if os.path.isdir(self.fname)
                                     else os.path.dirname(self.fname))
            with utils.pushd(target_dir):
                try:
                    run_in_console(self.command_server.hg_bin, self.command,
                                   self.command_server.encoding)
                except EnvironmentError, e:
                    sublime.status_message("SublimeHg: " + e.message)
                    print "SublimeHg: " + e.message
                except __HOLE__, e:
                    sublime.status_message("SublimeHg: " + e.message)
                    print "SublimeHg: " + e.message
            return

        # Run the requested command through the command server.
        try:
            data, exit_code = run_hg_cmd(self.command_server, self.command)
            sublime.set_timeout(functools.partial(self.show_output, data, exit_code), 0)
        except UnicodeDecodeError, e:
            print "SublimeHg: Can't handle command string characters."
            print e
        except Exception, e:
            print "SublimeHg: Error while trying to run the command server."
            print "*" * 80
            print e
            print "*" * 80
dataset/ETHPy150Open SublimeText/SublimeHg/sublime_hg.py/CommandRunnerWorker.run