annotate tests/notcapable @ 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 dedab036215d
children 28a4fb793ba1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14011
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
1 # Disable the $CAP wire protocol capability.
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
2
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
3 if test -z "$CAP"
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
4 then
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
5 echo "CAP environment variable not set."
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
6 fi
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
7
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
8 cat > notcapable-$CAP.py << EOF
33806
dedab036215d wireproto: use new peer interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17192
diff changeset
9 from mercurial import extensions, localrepo, repository
14011
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
10 def extsetup():
33806
dedab036215d wireproto: use new peer interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 17192
diff changeset
11 extensions.wrapfunction(repository.peer, 'capable', wrapcapable)
17192
1ac628cd7113 peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14409
diff changeset
12 extensions.wrapfunction(localrepo.localrepository, 'peer', wrappeer)
1ac628cd7113 peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14409
diff changeset
13 def wrapcapable(orig, self, name, *args, **kwargs):
14409
9ff996ba00b4 tests: support multiple caps in notcapable
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14011
diff changeset
14 if name in '$CAP'.split(' '):
14011
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
15 return False
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
16 return orig(self, name, *args, **kwargs)
17192
1ac628cd7113 peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14409
diff changeset
17 def wrappeer(orig, self):
1ac628cd7113 peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14409
diff changeset
18 # Since we're disabling some newer features, we need to make sure local
1ac628cd7113 peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14409
diff changeset
19 # repos add in the legacy features again.
1ac628cd7113 peer: introduce real peer classes
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 14409
diff changeset
20 return localrepo.locallegacypeer(self)
14011
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
21 EOF
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
22
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
23 echo '[extensions]' >> $HGRCPATH
b69471bdb678 tests: add script to disable a selected wire protocol capability
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
24 echo "notcapable-$CAP = `pwd`/notcapable-$CAP.py" >> $HGRCPATH