##// END OF EJS Templates
largefiles: test lfconvert with rename, remove, and merge
Greg Ward -
r15342:b2e00d67 stable
parent child Browse files
Show More
@@ -1,114 +1,205 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > largefiles =
3 > largefiles =
4 > share =
4 > share =
5 > graphlog =
5 > [largefiles]
6 > [largefiles]
6 > minsize = 0.5
7 > minsize = 0.5
7 > patterns = **.dat
8 > patterns = **.dat
8 > EOF
9 > EOF
9
10
10 "lfconvert" works
11 "lfconvert" works
11 $ hg init bigfile-repo
12 $ hg init bigfile-repo
12 $ cd bigfile-repo
13 $ cd bigfile-repo
13 $ cat >> .hg/hgrc <<EOF
14 $ cat >> .hg/hgrc <<EOF
14 > [extensions]
15 > [extensions]
15 > largefiles = !
16 > largefiles = !
16 > EOF
17 > EOF
17 $ mkdir sub
18 $ mkdir sub
18 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
19 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
19 $ echo normal > normal1
20 $ echo normal > normal1
20 $ echo alsonormal > sub/normal2
21 $ echo alsonormal > sub/normal2
21 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
22 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
22 $ hg addremove
23 $ hg addremove
23 adding large
24 adding large
24 adding normal1
25 adding normal1
25 adding sub/maybelarge.dat
26 adding sub/maybelarge.dat
26 adding sub/normal2
27 adding sub/normal2
27 $ hg commit -m"add large, normal1" large normal1
28 $ hg commit -m"add large, normal1" large normal1
28 $ hg commit -m"add sub/*" sub
29 $ hg commit -m"add sub/*" sub
29 $ [ -d .hg/largefiles ] && echo fail || echo pass
30 $ [ -d .hg/largefiles ] && echo fail || echo pass
30 pass
31 pass
31 $ cd ..
32 $ cd ..
32 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
33 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
33 initializing destination largefiles-repo
34 initializing destination largefiles-repo
34
35
35 "lfconvert" converts content correctly
36 "lfconvert" converts content correctly
36 $ cd largefiles-repo
37 $ cd largefiles-repo
37 $ hg up
38 $ hg up
38 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 getting changed largefiles
40 getting changed largefiles
40 2 largefiles updated, 0 removed
41 2 largefiles updated, 0 removed
41 $ hg locate
42 $ hg locate
42 .hglf/large
43 .hglf/large
43 .hglf/sub/maybelarge.dat
44 .hglf/sub/maybelarge.dat
44 normal1
45 normal1
45 sub/normal2
46 sub/normal2
46 $ cat normal1
47 $ cat normal1
47 normal
48 normal
48 $ cat sub/normal2
49 $ cat sub/normal2
49 alsonormal
50 alsonormal
50 $ sha1sum large sub/maybelarge.dat
51 $ sha1sum large sub/maybelarge.dat
51 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 large
52 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 large
52 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c sub/maybelarge.dat
53 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c sub/maybelarge.dat
53
54
54 "lfconvert" adds 'largefiles' to .hg/requires.
55 "lfconvert" adds 'largefiles' to .hg/requires.
55 $ cat .hg/requires
56 $ cat .hg/requires
56 largefiles
57 largefiles
57 revlogv1
58 revlogv1
58 fncache
59 fncache
59 store
60 store
60 dotencode
61 dotencode
61
62
62 "lfconvert" includes a newline at the end of the standin files.
63 "lfconvert" includes a newline at the end of the standin files.
63 $ cat .hglf/large .hglf/sub/maybelarge.dat
64 $ cat .hglf/large .hglf/sub/maybelarge.dat
64 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
65 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
65 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
66 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
66
67
67 add another largefile to the new largefiles repo
68 add another largefile to the new largefiles repo
68 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
69 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
69 $ hg add --lfsize=1 anotherlarge
70 $ hg add --lfsize=1 anotherlarge
70 $ hg commit -m "add anotherlarge (should be a largefile)"
71 $ hg commit -m "add anotherlarge (should be a largefile)"
71 $ cat .hglf/large .hglf/anotherlarge
72 $ cat .hglf/large .hglf/anotherlarge
72 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
73 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
73 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
74 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
74 $ cd ..
75 $ cd ..
75
76
77 add some changesets to rename/remove/merge
78 $ cd bigfile-repo
79 $ hg mv -q sub stuff
80 $ hg commit -m"rename sub/ to stuff/"
81 $ hg update -q 1
82 $ echo blah >> normal3
83 $ echo blah >> sub/normal2
84 $ echo blah >> sub/maybelarge.dat
85 $ sha1sum sub/maybelarge.dat
86 76236b6a2c6102826c61af4297dd738fb3b1de38 sub/maybelarge.dat
87 $ hg commit -A -m"add normal3, modify sub/*"
88 adding normal3
89 created new head
90 $ hg rm large normal3
91 $ hg commit -q -m"remove large, normal3"
92 $ hg merge
93 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
94 warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file.
95 merging stuff/maybelarge.dat failed!
96 merging sub/normal2 and stuff/normal2 to stuff/normal2
97 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
98 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
99 [1]
100 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
101 $ hg resolve -m stuff/maybelarge.dat
102 $ hg commit -m"merge"
103 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
104 @ 5:4884f215abda merge
105 |\
106 | o 4:7285f817b77e remove large, normal3
107 | |
108 | o 3:67e3892e3534 add normal3, modify sub/*
109 | |
110 o | 2:c96c8beb5d56 rename sub/ to stuff/
111 |/
112 o 1:020c65d24e11 add sub/*
113 |
114 o 0:117b8328f97a add large, normal1
115
116 $ cd ..
117
118 lfconvert with rename, merge, and remove
119 $ hg lfconvert --size 0.2 bigfile-repo largefiles2-repo
120 initializing destination largefiles2-repo
121 $ cd largefiles2-repo
122 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
123 o 5:8e05f5f2b77e merge
124 |\
125 | o 4:a5a02de7a8e4 remove large, normal3
126 | |
127 | o 3:55759520c76f add normal3, modify sub/*
128 | |
129 o | 2:261ad3f3f037 rename sub/ to stuff/
130 |/
131 o 1:334e5237836d add sub/*
132 |
133 o 0:d4892ec57ce2 add large, normal1
134
135 $ hg locate -r 2
136 .hglf/large
137 .hglf/stuff/maybelarge.dat
138 normal1
139 stuff/normal2
140 $ hg locate -r 3
141 .hglf/large
142 .hglf/sub/maybelarge.dat
143 normal1
144 normal3
145 sub/normal2
146 $ hg locate -r 4
147 .hglf/sub/maybelarge.dat
148 normal1
149 sub/normal2
150 $ hg locate -r 5
151 .hglf/stuff/maybelarge.dat
152 normal1
153 stuff/normal2
154 $ hg update
155 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 getting changed largefiles
157 1 largefiles updated, 0 removed
158 $ cat stuff/normal2
159 alsonormal
160 blah
161 $ sha1sum stuff/maybelarge.dat
162 76236b6a2c6102826c61af4297dd738fb3b1de38 stuff/maybelarge.dat
163 $ cat .hglf/stuff/maybelarge.dat
164 76236b6a2c6102826c61af4297dd738fb3b1de38
165 $ cd ..
166
76 "lfconvert" error cases
167 "lfconvert" error cases
77 $ hg lfconvert http://localhost/foo foo
168 $ hg lfconvert http://localhost/foo foo
78 abort: http://localhost/foo is not a local Mercurial repo
169 abort: http://localhost/foo is not a local Mercurial repo
79 [255]
170 [255]
80 $ hg lfconvert foo ssh://localhost/foo
171 $ hg lfconvert foo ssh://localhost/foo
81 abort: ssh://localhost/foo is not a local Mercurial repo
172 abort: ssh://localhost/foo is not a local Mercurial repo
82 [255]
173 [255]
83 $ hg lfconvert nosuchrepo foo
174 $ hg lfconvert nosuchrepo foo
84 abort: repository nosuchrepo not found!
175 abort: repository nosuchrepo not found!
85 [255]
176 [255]
86 $ hg share -q -U bigfile-repo shared
177 $ hg share -q -U bigfile-repo shared
87 $ echo -n bogus > shared/.hg/sharedpath
178 $ echo -n bogus > shared/.hg/sharedpath
88 $ hg lfconvert shared foo
179 $ hg lfconvert shared foo
89 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus!
180 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus!
90 [255]
181 [255]
91 $ hg lfconvert bigfile-repo largefiles-repo
182 $ hg lfconvert bigfile-repo largefiles-repo
92 initializing destination largefiles-repo
183 initializing destination largefiles-repo
93 abort: repository largefiles-repo already exists!
184 abort: repository largefiles-repo already exists!
94 [255]
185 [255]
95
186
96 Convert back to a normal (non-largefiles) repo
187 Convert back to a normal (non-largefiles) repo
97 $ cd largefiles-repo
188 $ cd largefiles-repo
98 $ hg lfconvert --to-normal . ../normal-repo
189 $ hg lfconvert --to-normal . ../normal-repo
99 initializing destination ../normal-repo
190 initializing destination ../normal-repo
100 $ cd ../normal-repo
191 $ cd ../normal-repo
101 $ cat >> .hg/hgrc <<EOF
192 $ cat >> .hg/hgrc <<EOF
102 > [extensions]
193 > [extensions]
103 > largefiles = !
194 > largefiles = !
104 > EOF
195 > EOF
105 $ hg update
196 $ hg update
106 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 $ hg locate
198 $ hg locate
108 anotherlarge
199 anotherlarge
109 large
200 large
110 normal1
201 normal1
111 sub/maybelarge.dat
202 sub/maybelarge.dat
112 sub/normal2
203 sub/normal2
113 $ [ -d .hg/largefiles ] && echo fail || echo pass
204 $ [ -d .hg/largefiles ] && echo fail || echo pass
114 pass
205 pass
General Comments 0
You need to be logged in to leave comments. Login now