##// END OF EJS Templates
commands: add hidden -T option for files/manifest/status/tags...
commands: add hidden -T option for files/manifest/status/tags These commands have generic formatting support but no way to enable it yet. When this feature is more fully developed, this flag will be unhidden.

File last commit:

r21024:7731a228 default
r22429:7a7eed51 default
Show More
test-largefiles-cache.t
136 lines | 3.5 KiB | text/troff | Tads3Lexer
/ tests / test-largefiles-cache.t
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 Create user cache directory
$ USERCACHE=`pwd`/cache; export USERCACHE
$ cat <<EOF >> ${HGRCPATH}
> [extensions]
> hgext.largefiles=
> [largefiles]
> usercache=${USERCACHE}
> EOF
$ mkdir -p ${USERCACHE}
Create source repo, and commit adding largefile.
$ hg init src
$ cd src
$ echo large > large
$ hg add --large large
$ hg commit -m 'add largefile'
Mads Kiilerich
tests: don't rely on broken behaviour in test-largefiles-cache.t...
r18723 $ hg rm large
$ hg commit -m 'branchhead without largefile'
$ hg up -qr 0
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 $ cd ..
Discard all cached largefiles in USERCACHE
$ rm -rf ${USERCACHE}
Matt Mackall
tests: fix trailing whitespace
r15478 Create mirror repo, and pull from source without largefile:
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 "pull" is used instead of "clone" for suppression of (1) updating to
Mads Kiilerich
spelling: fixes from spell checker
r21024 tip (= caching largefile from source repo), and (2) recording source
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 repo as "default" path in .hg/hgrc.
$ hg init mirror
$ cd mirror
$ hg pull ../src
pulling from ../src
requesting all changes
adding changesets
adding manifests
adding file changes
Mads Kiilerich
tests: don't rely on broken behaviour in test-largefiles-cache.t...
r18723 added 2 changesets with 1 changes to 1 files
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 (run 'hg update' to get a working copy)
Update working directory to "tip", which requires largefile("large"),
but there is no cache file for it. So, hg must treat it as
"missing"(!) file.
Mads Kiilerich
tests: don't rely on broken behaviour in test-largefiles-cache.t...
r18723 $ hg update -r0
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 getting changed largefiles
Simon Heimberg
tests: lines with largefile .* file://$TESTTMP also match on windows...
r20471 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 0 largefiles updated, 0 removed
Benoit Boissinot
largefiles: fix largefiles+subrepo update (issue3752)...
r18459 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 $ hg status
! large
Update working directory to null: this cleanup .hg/largefiles/dirstate
$ hg update null
getting changed largefiles
0 largefiles updated, 0 removed
Benoit Boissinot
largefiles: fix largefiles+subrepo update (issue3752)...
r18459 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472
Update working directory to tip, again.
Mads Kiilerich
tests: don't rely on broken behaviour in test-largefiles-cache.t...
r18723 $ hg update -r0
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 getting changed largefiles
Simon Heimberg
tests: lines with largefile .* file://$TESTTMP also match on windows...
r20471 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 0 largefiles updated, 0 removed
Benoit Boissinot
largefiles: fix largefiles+subrepo update (issue3752)...
r18459 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
FUJIWARA Katsunori
largefiles: treat status of cache missed largefiles as "missing" correctly...
r15472 $ hg status
! large
Mads Kiilerich
tests: convert some hghave unix-permissions to #if
r16986 $ cd ..
Mads Kiilerich
largefiles: getstandinmatcher should not depend on existence of directories...
r18724 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
$ hg init mirror2
$ hg -R mirror2 pull src -r0
pulling from src
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
Mads Kiilerich
tests: convert some hghave unix-permissions to #if
r16986 #if unix-permissions
Martin Geisler
largefiles: use repo.store.createmode for new files in .hg/largefiles...
r16153
Portable way to print file permissions:
$ cat > ls-l.py <<EOF
> #!/usr/bin/env python
> import sys, os
> path = sys.argv[1]
> print '%03o' % (os.lstat(path).st_mode & 0777)
> EOF
$ chmod +x ls-l.py
Test that files in .hg/largefiles inherit mode from .hg/store, not
from file in working copy:
$ cd src
$ chmod 750 .hg/store
$ chmod 660 large
$ echo change >> large
$ hg commit -m change
Mads Kiilerich
tests: don't rely on broken behaviour in test-largefiles-cache.t...
r18723 created new head
Martin Geisler
largefiles: use repo.store.createmode for new files in .hg/largefiles...
r16153 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
640
Martin Geisler
largefiles: respect store.createmode in basestore.get...
r16154
Test permission of with files in .hg/largefiles created by update:
$ cd ../mirror
$ rm -r "$USERCACHE" .hg/largefiles # avoid links
$ chmod 750 .hg/store
$ hg pull ../src --update -q
$ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
640
Martin Geisler
largefiles: respect store.createmode and avoid extra file copy...
r16155
Test permission of files created by push:
$ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
> --config "web.allow_push=*" --config web.push_ssl=no
$ cat hg.pid >> $DAEMON_PIDS
$ echo change >> large
$ hg commit -m change
$ rm -r "$USERCACHE"
$ hg push -q http://localhost:$HGPORT/
$ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
640
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913
$ cd ..
Mads Kiilerich
tests: convert some hghave unix-permissions to #if
r16986
#endif