annotate tests/revnamesext.py @ 35280:8e72f9152c4d

lfs: introduce a user level cache for lfs files This is the same mechanism in place for largefiles, and solves several problems working with multiple local repositories. The existing largefiles method is reused in place, because I suspect that there are other functions that can be shared. If we wait a bit to identify more before `hg cp lfutil.py ...`, the history will be easier to trace. The push between repo14 and repo15 in test-lfs.t arguably shouldn't be uploading any files with a local push. Maybe we can revisit that when `hg push` without 'lfs.url' can upload files to the push destination. Then it would be consistent for blobs in a local push to be linked to the local destination's cache. The cache property is added to run-tests.py, the same as the largefiles property, so that test generated files don't pollute the real location. Having files available locally broke a couple existing lfs-test-server tests, so the cache is cleared in a few places to force file download.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 06 Dec 2017 22:56:15 -0500
parents 46fa46608ca5
children 086fc71fbb09
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33048
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
1 # Dummy extension to define a namespace containing revision names
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
2
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
3 from __future__ import absolute_import
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
4
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
5 from mercurial import (
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
6 namespaces,
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
7 )
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
8
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
9 def reposetup(ui, repo):
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
10 names = {'r%d' % rev: repo[rev].node() for rev in repo}
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
11 namemap = lambda r, name: names.get(name)
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
12 nodemap = lambda r, node: ['r%d' % repo[node].rev()]
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
13
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
14 ns = namespaces.namespace('revnames', templatename='revname',
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
15 logname='revname',
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
16 listnames=lambda r: names.keys(),
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
17 namemap=namemap, nodemap=nodemap)
46fa46608ca5 namespaces: record and expose whether namespace is built-in
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
18 repo.names.addnamespace(ns)