Exemplo n.º 1
0
def backgroundrepack(repo, incremental=True, packsonly=False):
    cmd = [procutil.hgexecutable(), '-R', repo.origroot, 'repack']
    msg = _("(running background repack)\n")
    if incremental:
        cmd.append('--incremental')
        msg = _("(running background incremental repack)\n")
    if packsonly:
        cmd.append('--packsonly')
    repo.ui.warn(msg)
    procutil.runbgcommand(cmd, encoding.environ)
Exemplo n.º 2
0
def backgroundrepack(repo, incremental=True, packsonly=False):
    cmd = [procutil.hgexecutable(), '-R', repo.origroot, 'repack']
    msg = _("(running background repack)\n")
    if incremental:
        cmd.append('--incremental')
        msg = _("(running background incremental repack)\n")
    if packsonly:
        cmd.append('--packsonly')
    repo.ui.warn(msg)
    # We know this command will find a binary, so don't block on it starting.
    procutil.runbgcommand(cmd, encoding.environ, ensurestart=False)
Exemplo n.º 3
0
 def log(self, ui, event, msg, opts):
     script = self._scripts[event]
     env = {
         b'EVENT': event,
         b'HGPID': os.getpid(),
         b'MSG1': msg,
     }
     # keyword arguments get prefixed with OPT_ and uppercased
     env.update(
         (b'OPT_%s' % key.upper(), value) for key, value in opts.items())
     fullenv = procutil.shellenviron(env)
     procutil.runbgcommand(script, fullenv, shell=True)
Exemplo n.º 4
0
 def backgroundprefetch(self,
                        revs,
                        base=None,
                        repack=False,
                        pats=None,
                        opts=None):
     """Runs prefetch in background with optional repack
     """
     cmd = [_hgexecutable(), '-R', repo.origroot, 'prefetch']
     if repack:
         cmd.append('--repack')
     if revs:
         cmd += ['-r', revs]
     procutil.runbgcommand(cmd, encoding.environ)
Exemplo n.º 5
0
def backgroundrepack(repo, incremental=True, packsonly=False):
    cmd = [procutil.hgexecutable(), b'-R', repo.origroot, b'repack']
    msg = _(b"(running background repack)\n")
    if incremental:
        cmd.append(b'--incremental')
        msg = _(b"(running background incremental repack)\n")
    if packsonly:
        cmd.append(b'--packsonly')
    repo.ui.warn(msg)
    # We know this command will find a binary, so don't block on it starting.
    kwargs = {}
    if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'):
        kwargs['record_wait'] = repo.ui.atexit

    procutil.runbgcommand(cmd, encoding.environ, ensurestart=False, **kwargs)
Exemplo n.º 6
0
 def backgroundprefetch(self,
                        revs,
                        base=None,
                        repack=False,
                        pats=None,
                        opts=None):
     """Runs prefetch in background with optional repack
     """
     cmd = [procutil.hgexecutable(), '-R', repo.origroot, 'prefetch']
     if repack:
         cmd.append('--repack')
     if revs:
         cmd += ['-r', revs]
     # We know this command will find a binary, so don't block
     # on it starting.
     procutil.runbgcommand(cmd, encoding.environ, ensurestart=False)
Exemplo n.º 7
0
        def backgroundprefetch(
            self, revs, base=None, repack=False, pats=None, opts=None
        ):
            """Runs prefetch in background with optional repack"""
            cmd = [procutil.hgexecutable(), b'-R', repo.origroot, b'prefetch']
            if repack:
                cmd.append(b'--repack')
            if revs:
                cmd += [b'-r', revs]
            # We know this command will find a binary, so don't block
            # on it starting.
            kwargs = {}
            if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'):
                kwargs['record_wait'] = repo.ui.atexit

            procutil.runbgcommand(
                cmd, encoding.environ, ensurestart=False, **kwargs
            )
Exemplo n.º 8
0
 def log(self, ui, event, msg, opts):
     script = self._scripts[event]
     maxmsg = 100000
     if len(msg) > maxmsg:
         # Each env var has a 128KiB limit on linux. msg can be long, in
         # particular for command event, where it's the full command line.
         # Prefer truncating the message than raising "Argument list too
         # long" error.
         msg = msg[:maxmsg] + b' (truncated)'
     env = {
         b'EVENT': event,
         b'HGPID': os.getpid(),
         b'MSG1': msg,
     }
     # keyword arguments get prefixed with OPT_ and uppercased
     env.update(
         (b'OPT_%s' % key.upper(), value) for key, value in opts.items())
     fullenv = procutil.shellenviron(env)
     procutil.runbgcommand(script, fullenv, shell=True)