Show More
@@ -1,123 +1,127 b'' | |||
|
1 | 1 | Create user cache directory |
|
2 | 2 | |
|
3 | 3 | $ USERCACHE=`pwd`/cache; export USERCACHE |
|
4 | 4 | $ cat <<EOF >> ${HGRCPATH} |
|
5 | 5 | > [extensions] |
|
6 | 6 | > hgext.largefiles= |
|
7 | 7 | > [largefiles] |
|
8 | 8 | > usercache=${USERCACHE} |
|
9 | 9 | > EOF |
|
10 | 10 | $ mkdir -p ${USERCACHE} |
|
11 | 11 | |
|
12 | 12 | Create source repo, and commit adding largefile. |
|
13 | 13 | |
|
14 | 14 | $ hg init src |
|
15 | 15 | $ cd src |
|
16 | 16 | $ echo large > large |
|
17 | 17 | $ hg add --large large |
|
18 | 18 | $ hg commit -m 'add largefile' |
|
19 | $ hg rm large | |
|
20 | $ hg commit -m 'branchhead without largefile' | |
|
21 | $ hg up -qr 0 | |
|
19 | 22 | $ cd .. |
|
20 | 23 | |
|
21 | 24 | Discard all cached largefiles in USERCACHE |
|
22 | 25 | |
|
23 | 26 | $ rm -rf ${USERCACHE} |
|
24 | 27 | |
|
25 | 28 | Create mirror repo, and pull from source without largefile: |
|
26 | 29 | "pull" is used instead of "clone" for suppression of (1) updating to |
|
27 | 30 | tip (= cahcing largefile from source repo), and (2) recording source |
|
28 | 31 | repo as "default" path in .hg/hgrc. |
|
29 | 32 | |
|
30 | 33 | $ hg init mirror |
|
31 | 34 | $ cd mirror |
|
32 | 35 | $ hg pull ../src |
|
33 | 36 | pulling from ../src |
|
34 | 37 | requesting all changes |
|
35 | 38 | adding changesets |
|
36 | 39 | adding manifests |
|
37 | 40 | adding file changes |
|
38 |
added |
|
|
41 | added 2 changesets with 1 changes to 1 files | |
|
39 | 42 | (run 'hg update' to get a working copy) |
|
40 | 43 | caching new largefiles |
|
41 | 44 | 0 largefiles cached |
|
42 | 45 | |
|
43 | 46 | Update working directory to "tip", which requires largefile("large"), |
|
44 | 47 | but there is no cache file for it. So, hg must treat it as |
|
45 | 48 | "missing"(!) file. |
|
46 | 49 | |
|
47 | $ hg update | |
|
50 | $ hg update -r0 | |
|
48 | 51 | getting changed largefiles |
|
49 | 52 | error getting id 7f7097b041ccf68cc5561e9600da4655d21c6d18 from url file:$TESTTMP/mirror for file large: can't get file locally (glob) |
|
50 | 53 | 0 largefiles updated, 0 removed |
|
51 | 54 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
52 | 55 | $ hg status |
|
53 | 56 | ! large |
|
54 | 57 | |
|
55 | 58 | Update working directory to null: this cleanup .hg/largefiles/dirstate |
|
56 | 59 | |
|
57 | 60 | $ hg update null |
|
58 | 61 | getting changed largefiles |
|
59 | 62 | 0 largefiles updated, 0 removed |
|
60 | 63 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
61 | 64 | |
|
62 | 65 | Update working directory to tip, again. |
|
63 | 66 | |
|
64 | $ hg update | |
|
67 | $ hg update -r0 | |
|
65 | 68 | getting changed largefiles |
|
66 | 69 | error getting id 7f7097b041ccf68cc5561e9600da4655d21c6d18 from url file:$TESTTMP/mirror for file large: can't get file locally (glob) |
|
67 | 70 | 0 largefiles updated, 0 removed |
|
68 | 71 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 72 | $ hg status |
|
70 | 73 | ! large |
|
71 | 74 | $ cd .. |
|
72 | 75 | |
|
73 | 76 | #if unix-permissions |
|
74 | 77 | |
|
75 | 78 | Portable way to print file permissions: |
|
76 | 79 | |
|
77 | 80 | $ cat > ls-l.py <<EOF |
|
78 | 81 | > #!/usr/bin/env python |
|
79 | 82 | > import sys, os |
|
80 | 83 | > path = sys.argv[1] |
|
81 | 84 | > print '%03o' % (os.lstat(path).st_mode & 0777) |
|
82 | 85 | > EOF |
|
83 | 86 | $ chmod +x ls-l.py |
|
84 | 87 | |
|
85 | 88 | Test that files in .hg/largefiles inherit mode from .hg/store, not |
|
86 | 89 | from file in working copy: |
|
87 | 90 | |
|
88 | 91 | $ cd src |
|
89 | 92 | $ chmod 750 .hg/store |
|
90 | 93 | $ chmod 660 large |
|
91 | 94 | $ echo change >> large |
|
92 | 95 | $ hg commit -m change |
|
96 | created new head | |
|
93 | 97 | $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea |
|
94 | 98 | 640 |
|
95 | 99 | |
|
96 | 100 | Test permission of with files in .hg/largefiles created by update: |
|
97 | 101 | |
|
98 | 102 | $ cd ../mirror |
|
99 | 103 | $ rm -r "$USERCACHE" .hg/largefiles # avoid links |
|
100 | 104 | $ chmod 750 .hg/store |
|
101 | 105 | $ hg pull ../src --update -q |
|
102 | 106 | $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea |
|
103 | 107 | 640 |
|
104 | 108 | |
|
105 | 109 | Test permission of files created by push: |
|
106 | 110 | |
|
107 | 111 | $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \ |
|
108 | 112 | > --config "web.allow_push=*" --config web.push_ssl=no |
|
109 | 113 | $ cat hg.pid >> $DAEMON_PIDS |
|
110 | 114 | |
|
111 | 115 | $ echo change >> large |
|
112 | 116 | $ hg commit -m change |
|
113 | 117 | |
|
114 | 118 | $ rm -r "$USERCACHE" |
|
115 | 119 | |
|
116 | 120 | $ hg push -q http://localhost:$HGPORT/ |
|
117 | 121 | |
|
118 | 122 | $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9 |
|
119 | 123 | 640 |
|
120 | 124 | |
|
121 | 125 | $ cd .. |
|
122 | 126 | |
|
123 | 127 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now