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