示例#1
0
文件: perf.py 项目: gobizen/hg-stable
def perfaddremove(ui, repo):
    try:
        oldquiet = repo.ui.quiet
        repo.ui.quiet = True
        timer(lambda: scmutil.addremove(repo, dry_run=True))
    finally:
        repo.ui.quiet = oldquiet
示例#2
0
def perfaddremove(ui, repo):
    try:
        oldquiet = repo.ui.quiet
        repo.ui.quiet = True
        timer(lambda: scmutil.addremove(repo, dry_run=True))
    finally:
        repo.ui.quiet = oldquiet
示例#3
0
def _amend(orig, ui, repo, old, extra, pats, opts):
    # Only wrap if not disabled and repo is instance of
    # localrepo.localrepository
    if _disabled[0] or not isinstance(repo, localrepo.localrepository):
        return orig(ui, repo, old, extra, pats, opts)

    with repo.wlock(), repo.lock(), repo.transaction('dirsyncamend'):
        wctx = repo[None]
        matcher = scmutil.match(wctx, pats, opts)
        if (opts.get('addremove')
            and scmutil.addremove(repo, matcher, "", opts)):
            raise error.Abort(
                _("failed to mark all new/missing files as added/removed"))

        mirroredfiles = _updateworkingcopy(repo, matcher)
        if mirroredfiles and not matcher.always():
            # Ensure that all the files to be amended (original + synced) are
            # under consideration during the amend operation. We do so by
            # setting the value against 'include' key in opts as the only source
            # of truth.
            pats = ()
            opts['include'] = [
                f for f in wctx.files() if matcher(f)] + list(mirroredfiles)

        return orig(ui, repo, old, extra, pats, opts)
示例#4
0
def perfaddremove(ui, repo, **opts):
    timer, fm = gettimer(ui, opts)
    try:
        oldquiet = repo.ui.quiet
        repo.ui.quiet = True
        matcher = scmutil.match(repo[None])
        timer(lambda: scmutil.addremove(repo, matcher, "", dry_run=True))
    finally:
        repo.ui.quiet = oldquiet
        fm.end()
示例#5
0
def perfaddremove(ui, repo, **opts):
    timer, fm = gettimer(ui, opts)
    try:
        oldquiet = repo.ui.quiet
        repo.ui.quiet = True
        matcher = scmutil.match(repo[None])
        timer(lambda: scmutil.addremove(repo, matcher, "", dry_run=True))
    finally:
        repo.ui.quiet = oldquiet
        fm.end()