view mercurial/cacheutil.py @ 43965:8a81fa44f7bb

match: don't util.normpath() cwd The problem here is that `util.normpath()` calls `util.pconvert()`, which switches to Unix style separators. That results in two test failures like this since 5685ce2ea3bf: --- c:/Users/Matt/hg/tests/test-globalopts.t +++ c:/Users/Matt/hg/tests/test-globalopts.t.err @@ -89,7 +89,7 @@ [255] $ hg -R b ann a/a abort: a/a not under root '$TESTTMP/b' - (consider using '--cwd b') + (consider using '--cwd ..\$TESTTMP\b') [255] $ hg log abort: no repository found in '$TESTTMP' (.hg not found)! ERROR: test-globalopts.t output changed Martin originally had `os.path.normpath()` (which *would* work here too), but changed it during review. He didn't remember why he thought any form is needed here. Most uses simply pass '' or `repo.getcwd()`, so these should generally be in local format anyway. It seems better if `cwd` and `root` use consistent styles here. Differential Revision: https://phab.mercurial-scm.org/D7725
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 26 Dec 2019 18:26:06 -0500
parents 687b865b95ad
children d4ba4d51f85f
line wrap: on
line source

# scmutil.py - Mercurial core utility functions
#
#  Copyright Matt Mackall <mpm@selenic.com> and other
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import

from . import repoview


def cachetocopy(srcrepo):
    """return the list of cache file valuable to copy during a clone"""
    # In local clones we're copying all nodes, not just served
    # ones. Therefore copy all branch caches over.
    cachefiles = [b'branch2']
    cachefiles += [b'branch2-%s' % f for f in repoview.filtertable]
    cachefiles += [b'rbc-names-v1', b'rbc-revs-v1']
    cachefiles += [b'tags2']
    cachefiles += [b'tags2-%s' % f for f in repoview.filtertable]
    cachefiles += [b'hgtagsfnodes1']
    return cachefiles