mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
92d01b616c
Summary: Previously requesting remotefilelog file blobs from the server required write access in order to write the blob to the cache. This changes it to not abort entirely if the user doesn't have write access. Test Plan: cd tests ./run-tests.py --with-hg=/data/users/durham/hg/hg test-permissions.t Also ran the test without the fix and verified it fails. Reviewers: sid0, davidsp, pyd, dschleimer Reviewed By: dschleimer Differential Revision: https://phabricator.fb.com/D1145976 Task ID: 3601184
33 lines
731 B
Perl
33 lines
731 B
Perl
$ . "$TESTDIR/library.sh"
|
|
|
|
$ hginit master
|
|
$ cd master
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [remotefilelog]
|
|
> server=True
|
|
> EOF
|
|
$ echo x > x
|
|
$ hg commit -qAm x
|
|
|
|
$ cd ..
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master shallow -q
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
|
|
|
$ cd master
|
|
$ echo xx > x
|
|
$ hg commit -qAm x2
|
|
$ cd ..
|
|
|
|
# Test cache misses with read only permissions on server
|
|
|
|
$ chmod -R a-w master/.hg/remotefilelogcache
|
|
$ cd shallow
|
|
$ hg pull -q
|
|
$ hg update
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
|
$ cd ..
|
|
|
|
$ chmod -R u+w master/.hg/remotefilelogcache
|