comparison tests/test-largefiles.t @ 15216:7678790279da

largefiles: add beginnings of test (covers commit, remove, move, copy, and archive)
author Na'Tosha Bard <natosha@unity3d.com>
date Mon, 10 Oct 2011 17:34:17 +0200
parents
children b450a4d427ef
comparison
equal deleted inserted replaced
15215:c41078b9d0b8 15216:7678790279da
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
3 > largefiles=
4 > EOF
5
6 Create the repo with a couple of revisions of both large and normal
7 files.
8
9 $ hg init a
10 $ cd a
11 $ mkdir sub
12 $ echo normal1 > normal1
13 $ echo normal2 > sub/normal2
14 $ echo large1 > large1
15 $ echo large2 > sub/large2
16 $ hg add normal1 sub/normal2
17 $ hg add --large large1 sub/large2
18 $ hg commit -m "add files"
19 $ echo normal11 > normal1
20 $ echo normal22 > sub/normal2
21 $ echo large11 > large1
22 $ echo large22 > sub/large2
23 $ hg commit -m "edit files"
24
25 Verify that committing new versions of largefiles results in correct
26 largefile contents, and also that non-largefiles are not affected
27 badly.
28
29 $ cat normal1
30 normal11
31 $ cat large1
32 large11
33 $ cat sub/normal2
34 normal22
35 $ cat sub/large2
36 large22
37
38 Verify removing largefiles and normal files works on largefile repos.
39
40 $ hg remove normal1 large1
41 $ hg commit -m "remove files"
42 $ ls
43 sub
44
45 Test copying largefiles.
46
47 $ hg cp sub/normal2 normal1
48 $ hg cp sub/large2 large1
49 $ hg commit -m "copy files"
50 $ cat normal1
51 normal22
52 $ cat large1
53 large22
54
55 Test moving largefiles and verify that normal files are also unaffected.
56
57 $ hg mv normal1 normal3
58 $ hg mv large1 large3
59 $ hg mv sub/normal2 sub/normal4
60 $ hg mv sub/large2 sub/large4
61 $ hg commit -m "move files"
62 $ cat normal3
63 normal22
64 $ cat large3
65 large22
66 $ cat sub/normal4
67 normal22
68 $ cat sub/large4
69 large22
70
71 Test archiving the various revisions. These hit corner cases known with
72 archiving.
73
74 $ hg archive -r 0 ../archive0
75 $ hg archive -r 1 ../archive1
76 $ hg archive -r 2 ../archive2
77 $ hg archive -r 3 ../archive3
78 $ hg archive -r 4 ../archive4
79 $ cd ../archive0
80 $ cat normal1
81 normal1
82 $ cat large1
83 large1
84 $ cat sub/normal2
85 normal2
86 $ cat sub/large2
87 large2
88 $ cd ../archive1
89 $ cat normal1
90 normal11
91 $ cat large1
92 large11
93 $ cat sub/normal2
94 normal22
95 $ cat sub/large2
96 large22
97 $ cd ../archive2
98 $ ls
99 sub
100 $ cat sub/normal2
101 normal22
102 $ cat sub/large2
103 large22
104 $ cd ../archive3
105 $ cat normal1
106 normal22
107 $ cat large1
108 large22
109 $ cat sub/normal2
110 normal22
111 $ cat sub/large2
112 large22
113 $ cd ../archive4
114 $ cat normal3
115 normal22
116 $ cat large3
117 large22
118 $ cat sub/normal4
119 normal22
120 $ cat sub/large4
121 large22