Show More
@@ -1,161 +1,167 | |||||
1 | # Copyright 2011 Fog Creek Software |
|
1 | # Copyright 2011 Fog Creek Software | |
2 | # |
|
2 | # | |
3 | # This software may be used and distributed according to the terms of the |
|
3 | # This software may be used and distributed according to the terms of the | |
4 | # GNU General Public License version 2 or any later version. |
|
4 | # GNU General Public License version 2 or any later version. | |
5 |
|
5 | |||
6 | import os |
|
6 | import os | |
7 | import urllib2 |
|
7 | import urllib2 | |
8 |
|
8 | |||
9 | from mercurial import error, httprepo, util, wireproto |
|
9 | from mercurial import error, httprepo, util, wireproto | |
10 | from mercurial.i18n import _ |
|
10 | from mercurial.i18n import _ | |
11 |
|
11 | |||
12 | import lfutil |
|
12 | import lfutil | |
13 |
|
13 | |||
14 | LARGEFILES_REQUIRED_MSG = ('\nThis repository uses the largefiles extension.' |
|
14 | LARGEFILES_REQUIRED_MSG = ('\nThis repository uses the largefiles extension.' | |
15 | '\n\nPlease enable it in your Mercurial config ' |
|
15 | '\n\nPlease enable it in your Mercurial config ' | |
16 | 'file.\n') |
|
16 | 'file.\n') | |
17 |
|
17 | |||
18 | def putlfile(repo, proto, sha): |
|
18 | def putlfile(repo, proto, sha): | |
19 | '''Put a largefile into a repository's local store and into the |
|
19 | '''Put a largefile into a repository's local store and into the | |
20 | user cache.''' |
|
20 | user cache.''' | |
21 | proto.redirect() |
|
21 | proto.redirect() | |
22 |
|
22 | |||
23 | fd, tmpname = lfutil.mkstemp(repo, prefix='hg-putlfile') |
|
23 | fd, tmpname = lfutil.mkstemp(repo, prefix='hg-putlfile') | |
24 | tmpfp = os.fdopen(fd, 'wb+') |
|
24 | tmpfp = os.fdopen(fd, 'wb+') | |
25 | try: |
|
25 | try: | |
26 | try: |
|
26 | try: | |
27 | proto.getfile(tmpfp) |
|
27 | proto.getfile(tmpfp) | |
28 | tmpfp.seek(0) |
|
28 | tmpfp.seek(0) | |
29 | if sha != lfutil.hexsha1(tmpfp): |
|
29 | if sha != lfutil.hexsha1(tmpfp): | |
30 | return wireproto.pushres(1) |
|
30 | raise IOError(0, _('largefile contents do not match hash')) | |
31 | tmpfp.close() |
|
31 | tmpfp.close() | |
32 | lfutil.copytostoreabsolute(repo, tmpname, sha) |
|
32 | lfutil.copytostoreabsolute(repo, tmpname, sha) | |
33 | except IOError, e: |
|
33 | except IOError, e: | |
34 |
repo.ui.warn(_('largefiles: failed to put %s |
|
34 | repo.ui.warn(_('largefiles: failed to put %s into store: %s') % | |
35 |
(sha |
|
35 | (sha, e.strerror)) | |
36 | return wireproto.pushres(1) |
|
36 | return wireproto.pushres(1) | |
37 | finally: |
|
37 | finally: | |
38 | tmpfp.close() |
|
38 | tmpfp.close() | |
39 | os.unlink(tmpname) |
|
39 | os.unlink(tmpname) | |
40 |
|
40 | |||
41 | return wireproto.pushres(0) |
|
41 | return wireproto.pushres(0) | |
42 |
|
42 | |||
43 | def getlfile(repo, proto, sha): |
|
43 | def getlfile(repo, proto, sha): | |
44 | '''Retrieve a largefile from the repository-local cache or system |
|
44 | '''Retrieve a largefile from the repository-local cache or system | |
45 | cache.''' |
|
45 | cache.''' | |
46 | filename = lfutil.findfile(repo, sha) |
|
46 | filename = lfutil.findfile(repo, sha) | |
47 | if not filename: |
|
47 | if not filename: | |
48 | raise util.Abort(_('requested largefile %s not present in cache') % sha) |
|
48 | raise util.Abort(_('requested largefile %s not present in cache') % sha) | |
49 | f = open(filename, 'rb') |
|
49 | f = open(filename, 'rb') | |
50 | length = os.fstat(f.fileno())[6] |
|
50 | length = os.fstat(f.fileno())[6] | |
51 |
|
51 | |||
52 | # Since we can't set an HTTP content-length header here, and |
|
52 | # Since we can't set an HTTP content-length header here, and | |
53 | # Mercurial core provides no way to give the length of a streamres |
|
53 | # Mercurial core provides no way to give the length of a streamres | |
54 | # (and reading the entire file into RAM would be ill-advised), we |
|
54 | # (and reading the entire file into RAM would be ill-advised), we | |
55 | # just send the length on the first line of the response, like the |
|
55 | # just send the length on the first line of the response, like the | |
56 | # ssh proto does for string responses. |
|
56 | # ssh proto does for string responses. | |
57 | def generator(): |
|
57 | def generator(): | |
58 | yield '%d\n' % length |
|
58 | yield '%d\n' % length | |
59 | for chunk in f: |
|
59 | for chunk in f: | |
60 | yield chunk |
|
60 | yield chunk | |
61 | return wireproto.streamres(generator()) |
|
61 | return wireproto.streamres(generator()) | |
62 |
|
62 | |||
63 | def statlfile(repo, proto, sha): |
|
63 | def statlfile(repo, proto, sha): | |
64 | '''Return '2\n' if the largefile is missing, '1\n' if it has a |
|
64 | '''Return '2\n' if the largefile is missing, '1\n' if it has a | |
65 | mismatched checksum, or '0\n' if it is in good condition''' |
|
65 | mismatched checksum, or '0\n' if it is in good condition''' | |
66 | filename = lfutil.findfile(repo, sha) |
|
66 | filename = lfutil.findfile(repo, sha) | |
67 | if not filename: |
|
67 | if not filename: | |
68 | return '2\n' |
|
68 | return '2\n' | |
69 | fd = None |
|
69 | fd = None | |
70 | try: |
|
70 | try: | |
71 | fd = open(filename, 'rb') |
|
71 | fd = open(filename, 'rb') | |
72 | return lfutil.hexsha1(fd) == sha and '0\n' or '1\n' |
|
72 | return lfutil.hexsha1(fd) == sha and '0\n' or '1\n' | |
73 | finally: |
|
73 | finally: | |
74 | if fd: |
|
74 | if fd: | |
75 | fd.close() |
|
75 | fd.close() | |
76 |
|
76 | |||
77 | def wirereposetup(ui, repo): |
|
77 | def wirereposetup(ui, repo): | |
78 | class lfileswirerepository(repo.__class__): |
|
78 | class lfileswirerepository(repo.__class__): | |
79 | def putlfile(self, sha, fd): |
|
79 | def putlfile(self, sha, fd): | |
80 | # unfortunately, httprepository._callpush tries to convert its |
|
80 | # unfortunately, httprepository._callpush tries to convert its | |
81 | # input file-like into a bundle before sending it, so we can't use |
|
81 | # input file-like into a bundle before sending it, so we can't use | |
82 | # it ... |
|
82 | # it ... | |
83 | if issubclass(self.__class__, httprepo.httprepository): |
|
83 | if issubclass(self.__class__, httprepo.httprepository): | |
|
84 | res = None | |||
84 | try: |
|
85 | try: | |
85 |
re |
|
86 | res = self._call('putlfile', data=fd, sha=sha, | |
86 |
headers={'content-type':'application/mercurial-0.1'}) |
|
87 | headers={'content-type':'application/mercurial-0.1'}) | |
|
88 | d, output = res.split('\n', 1) | |||
|
89 | for l in output.splitlines(True): | |||
|
90 | self.ui.warn(_('remote: '), l, '\n') | |||
|
91 | return int(d) | |||
87 | except (ValueError, urllib2.HTTPError): |
|
92 | except (ValueError, urllib2.HTTPError): | |
|
93 | self.ui.warn(_('unexpected putlfile response: %s') % res) | |||
88 | return 1 |
|
94 | return 1 | |
89 | # ... but we can't use sshrepository._call because the data= |
|
95 | # ... but we can't use sshrepository._call because the data= | |
90 | # argument won't get sent, and _callpush does exactly what we want |
|
96 | # argument won't get sent, and _callpush does exactly what we want | |
91 | # in this case: send the data straight through |
|
97 | # in this case: send the data straight through | |
92 | else: |
|
98 | else: | |
93 | try: |
|
99 | try: | |
94 | ret, output = self._callpush("putlfile", fd, sha=sha) |
|
100 | ret, output = self._callpush("putlfile", fd, sha=sha) | |
95 | if ret == "": |
|
101 | if ret == "": | |
96 | raise error.ResponseError(_('putlfile failed:'), |
|
102 | raise error.ResponseError(_('putlfile failed:'), | |
97 | output) |
|
103 | output) | |
98 | return int(ret) |
|
104 | return int(ret) | |
99 | except IOError: |
|
105 | except IOError: | |
100 | return 1 |
|
106 | return 1 | |
101 | except ValueError: |
|
107 | except ValueError: | |
102 | raise error.ResponseError( |
|
108 | raise error.ResponseError( | |
103 | _('putlfile failed (unexpected response):'), ret) |
|
109 | _('putlfile failed (unexpected response):'), ret) | |
104 |
|
110 | |||
105 | def getlfile(self, sha): |
|
111 | def getlfile(self, sha): | |
106 | stream = self._callstream("getlfile", sha=sha) |
|
112 | stream = self._callstream("getlfile", sha=sha) | |
107 | length = stream.readline() |
|
113 | length = stream.readline() | |
108 | try: |
|
114 | try: | |
109 | length = int(length) |
|
115 | length = int(length) | |
110 | except ValueError: |
|
116 | except ValueError: | |
111 | self._abort(error.ResponseError(_("unexpected response:"), |
|
117 | self._abort(error.ResponseError(_("unexpected response:"), | |
112 | length)) |
|
118 | length)) | |
113 | return (length, stream) |
|
119 | return (length, stream) | |
114 |
|
120 | |||
115 | def statlfile(self, sha): |
|
121 | def statlfile(self, sha): | |
116 | try: |
|
122 | try: | |
117 | return int(self._call("statlfile", sha=sha)) |
|
123 | return int(self._call("statlfile", sha=sha)) | |
118 | except (ValueError, urllib2.HTTPError): |
|
124 | except (ValueError, urllib2.HTTPError): | |
119 | # If the server returns anything but an integer followed by a |
|
125 | # If the server returns anything but an integer followed by a | |
120 | # newline, newline, it's not speaking our language; if we get |
|
126 | # newline, newline, it's not speaking our language; if we get | |
121 | # an HTTP error, we can't be sure the largefile is present; |
|
127 | # an HTTP error, we can't be sure the largefile is present; | |
122 | # either way, consider it missing. |
|
128 | # either way, consider it missing. | |
123 | return 2 |
|
129 | return 2 | |
124 |
|
130 | |||
125 | repo.__class__ = lfileswirerepository |
|
131 | repo.__class__ = lfileswirerepository | |
126 |
|
132 | |||
127 | # advertise the largefiles=serve capability |
|
133 | # advertise the largefiles=serve capability | |
128 | def capabilities(repo, proto): |
|
134 | def capabilities(repo, proto): | |
129 | return capabilities_orig(repo, proto) + ' largefiles=serve' |
|
135 | return capabilities_orig(repo, proto) + ' largefiles=serve' | |
130 |
|
136 | |||
131 | # duplicate what Mercurial's new out-of-band errors mechanism does, because |
|
137 | # duplicate what Mercurial's new out-of-band errors mechanism does, because | |
132 | # clients old and new alike both handle it well |
|
138 | # clients old and new alike both handle it well | |
133 | def webproto_refuseclient(self, message): |
|
139 | def webproto_refuseclient(self, message): | |
134 | self.req.header([('Content-Type', 'application/hg-error')]) |
|
140 | self.req.header([('Content-Type', 'application/hg-error')]) | |
135 | return message |
|
141 | return message | |
136 |
|
142 | |||
137 | def sshproto_refuseclient(self, message): |
|
143 | def sshproto_refuseclient(self, message): | |
138 | self.ui.write_err('%s\n-\n' % message) |
|
144 | self.ui.write_err('%s\n-\n' % message) | |
139 | self.fout.write('\n') |
|
145 | self.fout.write('\n') | |
140 | self.fout.flush() |
|
146 | self.fout.flush() | |
141 |
|
147 | |||
142 | return '' |
|
148 | return '' | |
143 |
|
149 | |||
144 | def heads(repo, proto): |
|
150 | def heads(repo, proto): | |
145 | if lfutil.islfilesrepo(repo): |
|
151 | if lfutil.islfilesrepo(repo): | |
146 | return wireproto.ooberror(LARGEFILES_REQUIRED_MSG) |
|
152 | return wireproto.ooberror(LARGEFILES_REQUIRED_MSG) | |
147 | return wireproto.heads(repo, proto) |
|
153 | return wireproto.heads(repo, proto) | |
148 |
|
154 | |||
149 | def sshrepo_callstream(self, cmd, **args): |
|
155 | def sshrepo_callstream(self, cmd, **args): | |
150 | if cmd == 'heads' and self.capable('largefiles'): |
|
156 | if cmd == 'heads' and self.capable('largefiles'): | |
151 | cmd = 'lheads' |
|
157 | cmd = 'lheads' | |
152 | if cmd == 'batch' and self.capable('largefiles'): |
|
158 | if cmd == 'batch' and self.capable('largefiles'): | |
153 | args['cmds'] = args['cmds'].replace('heads ', 'lheads ') |
|
159 | args['cmds'] = args['cmds'].replace('heads ', 'lheads ') | |
154 | return ssh_oldcallstream(self, cmd, **args) |
|
160 | return ssh_oldcallstream(self, cmd, **args) | |
155 |
|
161 | |||
156 | def httprepo_callstream(self, cmd, **args): |
|
162 | def httprepo_callstream(self, cmd, **args): | |
157 | if cmd == 'heads' and self.capable('largefiles'): |
|
163 | if cmd == 'heads' and self.capable('largefiles'): | |
158 | cmd = 'lheads' |
|
164 | cmd = 'lheads' | |
159 | if cmd == 'batch' and self.capable('largefiles'): |
|
165 | if cmd == 'batch' and self.capable('largefiles'): | |
160 | args['cmds'] = args['cmds'].replace('heads ', 'lheads ') |
|
166 | args['cmds'] = args['cmds'].replace('heads ', 'lheads ') | |
161 | return http_oldcallstream(self, cmd, **args) |
|
167 | return http_oldcallstream(self, cmd, **args) |
@@ -1,879 +1,897 | |||||
1 | $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80 |
|
1 | $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80 | |
2 |
|
2 | |||
|
3 | $ USERCACHE=`pwd`/cache; export USERCACHE | |||
|
4 | $ mkdir -p ${USERCACHE} | |||
3 | $ cat >> $HGRCPATH <<EOF |
|
5 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extensions] |
|
6 | > [extensions] | |
5 | > largefiles= |
|
7 | > largefiles= | |
6 | > purge= |
|
8 | > purge= | |
7 | > rebase= |
|
9 | > rebase= | |
8 | > transplant= |
|
10 | > transplant= | |
9 | > [phases] |
|
11 | > [phases] | |
10 | > publish=False |
|
12 | > publish=False | |
11 | > [largefiles] |
|
13 | > [largefiles] | |
12 | > minsize=2 |
|
14 | > minsize=2 | |
13 | > patterns=glob:**.dat |
|
15 | > patterns=glob:**.dat | |
|
16 | > usercache=${USERCACHE} | |||
14 | > EOF |
|
17 | > EOF | |
15 |
|
18 | |||
16 | Create the repo with a couple of revisions of both large and normal |
|
19 | Create the repo with a couple of revisions of both large and normal | |
17 | files, testing that status correctly shows largefiles. |
|
20 | files, testing that status correctly shows largefiles. | |
18 |
|
21 | |||
19 | $ hg init a |
|
22 | $ hg init a | |
20 | $ cd a |
|
23 | $ cd a | |
21 | $ mkdir sub |
|
24 | $ mkdir sub | |
22 | $ echo normal1 > normal1 |
|
25 | $ echo normal1 > normal1 | |
23 | $ echo normal2 > sub/normal2 |
|
26 | $ echo normal2 > sub/normal2 | |
24 | $ echo large1 > large1 |
|
27 | $ echo large1 > large1 | |
25 | $ echo large2 > sub/large2 |
|
28 | $ echo large2 > sub/large2 | |
26 | $ hg add normal1 sub/normal2 |
|
29 | $ hg add normal1 sub/normal2 | |
27 | $ hg add --large large1 sub/large2 |
|
30 | $ hg add --large large1 sub/large2 | |
28 | $ hg commit -m "add files" |
|
31 | $ hg commit -m "add files" | |
29 | $ echo normal11 > normal1 |
|
32 | $ echo normal11 > normal1 | |
30 | $ echo normal22 > sub/normal2 |
|
33 | $ echo normal22 > sub/normal2 | |
31 | $ echo large11 > large1 |
|
34 | $ echo large11 > large1 | |
32 | $ echo large22 > sub/large2 |
|
35 | $ echo large22 > sub/large2 | |
33 | $ hg st |
|
36 | $ hg st | |
34 | M large1 |
|
37 | M large1 | |
35 | M normal1 |
|
38 | M normal1 | |
36 | M sub/large2 |
|
39 | M sub/large2 | |
37 | M sub/normal2 |
|
40 | M sub/normal2 | |
38 | $ hg commit -m "edit files" |
|
41 | $ hg commit -m "edit files" | |
39 |
|
42 | |||
40 | Commit preserved largefile contents. |
|
43 | Commit preserved largefile contents. | |
41 |
|
44 | |||
42 | $ cat normal1 |
|
45 | $ cat normal1 | |
43 | normal11 |
|
46 | normal11 | |
44 | $ cat large1 |
|
47 | $ cat large1 | |
45 | large11 |
|
48 | large11 | |
46 | $ cat sub/normal2 |
|
49 | $ cat sub/normal2 | |
47 | normal22 |
|
50 | normal22 | |
48 | $ cat sub/large2 |
|
51 | $ cat sub/large2 | |
49 | large22 |
|
52 | large22 | |
50 |
|
53 | |||
51 | Remove both largefiles and normal files. |
|
54 | Remove both largefiles and normal files. | |
52 |
|
55 | |||
53 | $ hg remove normal1 large1 |
|
56 | $ hg remove normal1 large1 | |
54 | $ hg commit -m "remove files" |
|
57 | $ hg commit -m "remove files" | |
55 | $ ls |
|
58 | $ ls | |
56 | sub |
|
59 | sub | |
57 |
|
60 | |||
58 | Copy both largefiles and normal files (testing that status output is correct). |
|
61 | Copy both largefiles and normal files (testing that status output is correct). | |
59 |
|
62 | |||
60 | $ hg cp sub/normal2 normal1 |
|
63 | $ hg cp sub/normal2 normal1 | |
61 | $ hg cp sub/large2 large1 |
|
64 | $ hg cp sub/large2 large1 | |
62 | $ hg st |
|
65 | $ hg st | |
63 | A large1 |
|
66 | A large1 | |
64 | A normal1 |
|
67 | A normal1 | |
65 | $ hg commit -m "copy files" |
|
68 | $ hg commit -m "copy files" | |
66 | $ cat normal1 |
|
69 | $ cat normal1 | |
67 | normal22 |
|
70 | normal22 | |
68 | $ cat large1 |
|
71 | $ cat large1 | |
69 | large22 |
|
72 | large22 | |
70 |
|
73 | |||
71 | Test moving largefiles and verify that normal files are also unaffected. |
|
74 | Test moving largefiles and verify that normal files are also unaffected. | |
72 |
|
75 | |||
73 | $ hg mv normal1 normal3 |
|
76 | $ hg mv normal1 normal3 | |
74 | $ hg mv large1 large3 |
|
77 | $ hg mv large1 large3 | |
75 | $ hg mv sub/normal2 sub/normal4 |
|
78 | $ hg mv sub/normal2 sub/normal4 | |
76 | $ hg mv sub/large2 sub/large4 |
|
79 | $ hg mv sub/large2 sub/large4 | |
77 | $ hg commit -m "move files" |
|
80 | $ hg commit -m "move files" | |
78 | $ cat normal3 |
|
81 | $ cat normal3 | |
79 | normal22 |
|
82 | normal22 | |
80 | $ cat large3 |
|
83 | $ cat large3 | |
81 | large22 |
|
84 | large22 | |
82 | $ cat sub/normal4 |
|
85 | $ cat sub/normal4 | |
83 | normal22 |
|
86 | normal22 | |
84 | $ cat sub/large4 |
|
87 | $ cat sub/large4 | |
85 | large22 |
|
88 | large22 | |
86 |
|
89 | |||
87 | Test archiving the various revisions. These hit corner cases known with |
|
90 | Test archiving the various revisions. These hit corner cases known with | |
88 | archiving. |
|
91 | archiving. | |
89 |
|
92 | |||
90 | $ hg archive -r 0 ../archive0 |
|
93 | $ hg archive -r 0 ../archive0 | |
91 | $ hg archive -r 1 ../archive1 |
|
94 | $ hg archive -r 1 ../archive1 | |
92 | $ hg archive -r 2 ../archive2 |
|
95 | $ hg archive -r 2 ../archive2 | |
93 | $ hg archive -r 3 ../archive3 |
|
96 | $ hg archive -r 3 ../archive3 | |
94 | $ hg archive -r 4 ../archive4 |
|
97 | $ hg archive -r 4 ../archive4 | |
95 | $ cd ../archive0 |
|
98 | $ cd ../archive0 | |
96 | $ cat normal1 |
|
99 | $ cat normal1 | |
97 | normal1 |
|
100 | normal1 | |
98 | $ cat large1 |
|
101 | $ cat large1 | |
99 | large1 |
|
102 | large1 | |
100 | $ cat sub/normal2 |
|
103 | $ cat sub/normal2 | |
101 | normal2 |
|
104 | normal2 | |
102 | $ cat sub/large2 |
|
105 | $ cat sub/large2 | |
103 | large2 |
|
106 | large2 | |
104 | $ cd ../archive1 |
|
107 | $ cd ../archive1 | |
105 | $ cat normal1 |
|
108 | $ cat normal1 | |
106 | normal11 |
|
109 | normal11 | |
107 | $ cat large1 |
|
110 | $ cat large1 | |
108 | large11 |
|
111 | large11 | |
109 | $ cat sub/normal2 |
|
112 | $ cat sub/normal2 | |
110 | normal22 |
|
113 | normal22 | |
111 | $ cat sub/large2 |
|
114 | $ cat sub/large2 | |
112 | large22 |
|
115 | large22 | |
113 | $ cd ../archive2 |
|
116 | $ cd ../archive2 | |
114 | $ ls |
|
117 | $ ls | |
115 | sub |
|
118 | sub | |
116 | $ cat sub/normal2 |
|
119 | $ cat sub/normal2 | |
117 | normal22 |
|
120 | normal22 | |
118 | $ cat sub/large2 |
|
121 | $ cat sub/large2 | |
119 | large22 |
|
122 | large22 | |
120 | $ cd ../archive3 |
|
123 | $ cd ../archive3 | |
121 | $ cat normal1 |
|
124 | $ cat normal1 | |
122 | normal22 |
|
125 | normal22 | |
123 | $ cat large1 |
|
126 | $ cat large1 | |
124 | large22 |
|
127 | large22 | |
125 | $ cat sub/normal2 |
|
128 | $ cat sub/normal2 | |
126 | normal22 |
|
129 | normal22 | |
127 | $ cat sub/large2 |
|
130 | $ cat sub/large2 | |
128 | large22 |
|
131 | large22 | |
129 | $ cd ../archive4 |
|
132 | $ cd ../archive4 | |
130 | $ cat normal3 |
|
133 | $ cat normal3 | |
131 | normal22 |
|
134 | normal22 | |
132 | $ cat large3 |
|
135 | $ cat large3 | |
133 | large22 |
|
136 | large22 | |
134 | $ cat sub/normal4 |
|
137 | $ cat sub/normal4 | |
135 | normal22 |
|
138 | normal22 | |
136 | $ cat sub/large4 |
|
139 | $ cat sub/large4 | |
137 | large22 |
|
140 | large22 | |
138 |
|
141 | |||
139 | Commit corner case: specify files to commit. |
|
142 | Commit corner case: specify files to commit. | |
140 |
|
143 | |||
141 | $ cd ../a |
|
144 | $ cd ../a | |
142 | $ echo normal3 > normal3 |
|
145 | $ echo normal3 > normal3 | |
143 | $ echo large3 > large3 |
|
146 | $ echo large3 > large3 | |
144 | $ echo normal4 > sub/normal4 |
|
147 | $ echo normal4 > sub/normal4 | |
145 | $ echo large4 > sub/large4 |
|
148 | $ echo large4 > sub/large4 | |
146 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
149 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" | |
147 | $ cat normal3 |
|
150 | $ cat normal3 | |
148 | normal3 |
|
151 | normal3 | |
149 | $ cat large3 |
|
152 | $ cat large3 | |
150 | large3 |
|
153 | large3 | |
151 | $ cat sub/normal4 |
|
154 | $ cat sub/normal4 | |
152 | normal4 |
|
155 | normal4 | |
153 | $ cat sub/large4 |
|
156 | $ cat sub/large4 | |
154 | large4 |
|
157 | large4 | |
155 |
|
158 | |||
156 | One more commit corner case: commit from a subdirectory. |
|
159 | One more commit corner case: commit from a subdirectory. | |
157 |
|
160 | |||
158 | $ cd ../a |
|
161 | $ cd ../a | |
159 | $ echo normal33 > normal3 |
|
162 | $ echo normal33 > normal3 | |
160 | $ echo large33 > large3 |
|
163 | $ echo large33 > large3 | |
161 | $ echo normal44 > sub/normal4 |
|
164 | $ echo normal44 > sub/normal4 | |
162 | $ echo large44 > sub/large4 |
|
165 | $ echo large44 > sub/large4 | |
163 | $ cd sub |
|
166 | $ cd sub | |
164 | $ hg commit -m "edit files yet again" |
|
167 | $ hg commit -m "edit files yet again" | |
165 | $ cat ../normal3 |
|
168 | $ cat ../normal3 | |
166 | normal33 |
|
169 | normal33 | |
167 | $ cat ../large3 |
|
170 | $ cat ../large3 | |
168 | large33 |
|
171 | large33 | |
169 | $ cat normal4 |
|
172 | $ cat normal4 | |
170 | normal44 |
|
173 | normal44 | |
171 | $ cat large4 |
|
174 | $ cat large4 | |
172 | large44 |
|
175 | large44 | |
173 |
|
176 | |||
174 | Committing standins is not allowed. |
|
177 | Committing standins is not allowed. | |
175 |
|
178 | |||
176 | $ cd .. |
|
179 | $ cd .. | |
177 | $ echo large3 > large3 |
|
180 | $ echo large3 > large3 | |
178 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
181 | $ hg commit .hglf/large3 -m "try to commit standin" | |
179 | abort: file ".hglf/large3" is a largefile standin |
|
182 | abort: file ".hglf/large3" is a largefile standin | |
180 | (commit the largefile itself instead) |
|
183 | (commit the largefile itself instead) | |
181 | [255] |
|
184 | [255] | |
182 |
|
185 | |||
183 | Corner cases for adding largefiles. |
|
186 | Corner cases for adding largefiles. | |
184 |
|
187 | |||
185 | $ echo large5 > large5 |
|
188 | $ echo large5 > large5 | |
186 | $ hg add --large large5 |
|
189 | $ hg add --large large5 | |
187 | $ hg add --large large5 |
|
190 | $ hg add --large large5 | |
188 | large5 already a largefile |
|
191 | large5 already a largefile | |
189 | $ mkdir sub2 |
|
192 | $ mkdir sub2 | |
190 | $ echo large6 > sub2/large6 |
|
193 | $ echo large6 > sub2/large6 | |
191 | $ echo large7 > sub2/large7 |
|
194 | $ echo large7 > sub2/large7 | |
192 | $ hg add --large sub2 |
|
195 | $ hg add --large sub2 | |
193 | adding sub2/large6 as a largefile (glob) |
|
196 | adding sub2/large6 as a largefile (glob) | |
194 | adding sub2/large7 as a largefile (glob) |
|
197 | adding sub2/large7 as a largefile (glob) | |
195 | $ hg st |
|
198 | $ hg st | |
196 | M large3 |
|
199 | M large3 | |
197 | A large5 |
|
200 | A large5 | |
198 | A sub2/large6 |
|
201 | A sub2/large6 | |
199 | A sub2/large7 |
|
202 | A sub2/large7 | |
200 |
|
203 | |||
201 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
204 | Config settings (pattern **.dat, minsize 2 MB) are respected. | |
202 |
|
205 | |||
203 | $ echo testdata > test.dat |
|
206 | $ echo testdata > test.dat | |
204 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
207 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null | |
205 | $ hg add |
|
208 | $ hg add | |
206 | adding reallylarge as a largefile |
|
209 | adding reallylarge as a largefile | |
207 | adding test.dat as a largefile |
|
210 | adding test.dat as a largefile | |
208 |
|
211 | |||
209 | Test that minsize and --lfsize handle float values; |
|
212 | Test that minsize and --lfsize handle float values; | |
210 | also tests that --lfsize overrides largefiles.minsize. |
|
213 | also tests that --lfsize overrides largefiles.minsize. | |
211 | (0.250 MB = 256 kB = 262144 B) |
|
214 | (0.250 MB = 256 kB = 262144 B) | |
212 |
|
215 | |||
213 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
216 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null | |
214 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
217 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null | |
215 | $ hg --config largefiles.minsize=.25 add |
|
218 | $ hg --config largefiles.minsize=.25 add | |
216 | adding ratherlarge as a largefile |
|
219 | adding ratherlarge as a largefile | |
217 | adding medium |
|
220 | adding medium | |
218 | $ hg forget medium |
|
221 | $ hg forget medium | |
219 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
222 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
220 | adding medium as a largefile |
|
223 | adding medium as a largefile | |
221 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
224 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null | |
222 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
225 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
223 | adding notlarge |
|
226 | adding notlarge | |
224 | $ hg forget notlarge |
|
227 | $ hg forget notlarge | |
225 |
|
228 | |||
226 | Test forget on largefiles. |
|
229 | Test forget on largefiles. | |
227 |
|
230 | |||
228 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
231 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium | |
229 | $ hg st |
|
232 | $ hg st | |
230 | A sub2/large6 |
|
233 | A sub2/large6 | |
231 | A sub2/large7 |
|
234 | A sub2/large7 | |
232 | R large3 |
|
235 | R large3 | |
233 | ? large5 |
|
236 | ? large5 | |
234 | ? medium |
|
237 | ? medium | |
235 | ? notlarge |
|
238 | ? notlarge | |
236 | ? ratherlarge |
|
239 | ? ratherlarge | |
237 | ? reallylarge |
|
240 | ? reallylarge | |
238 | ? test.dat |
|
241 | ? test.dat | |
239 | $ hg commit -m "add/edit more largefiles" |
|
242 | $ hg commit -m "add/edit more largefiles" | |
240 | $ hg st |
|
243 | $ hg st | |
241 | ? large3 |
|
244 | ? large3 | |
242 | ? large5 |
|
245 | ? large5 | |
243 | ? medium |
|
246 | ? medium | |
244 | ? notlarge |
|
247 | ? notlarge | |
245 | ? ratherlarge |
|
248 | ? ratherlarge | |
246 | ? reallylarge |
|
249 | ? reallylarge | |
247 | ? test.dat |
|
250 | ? test.dat | |
248 |
|
251 | |||
249 | Purge with largefiles: verify that largefiles are still in the working |
|
252 | Purge with largefiles: verify that largefiles are still in the working | |
250 | dir after a purge. |
|
253 | dir after a purge. | |
251 |
|
254 | |||
252 | $ hg purge --all |
|
255 | $ hg purge --all | |
253 | $ cat sub/large4 |
|
256 | $ cat sub/large4 | |
254 | large44 |
|
257 | large44 | |
255 | $ cat sub2/large6 |
|
258 | $ cat sub2/large6 | |
256 | large6 |
|
259 | large6 | |
257 | $ cat sub2/large7 |
|
260 | $ cat sub2/large7 | |
258 | large7 |
|
261 | large7 | |
259 |
|
262 | |||
260 | Clone a largefiles repo. |
|
263 | Clone a largefiles repo. | |
261 |
|
264 | |||
262 | $ hg clone . ../b |
|
265 | $ hg clone . ../b | |
263 | updating to branch default |
|
266 | updating to branch default | |
264 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
267 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
265 | getting changed largefiles |
|
268 | getting changed largefiles | |
266 | 3 largefiles updated, 0 removed |
|
269 | 3 largefiles updated, 0 removed | |
267 | $ cd ../b |
|
270 | $ cd ../b | |
268 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
271 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
269 | 7:daea875e9014 add/edit more largefiles |
|
272 | 7:daea875e9014 add/edit more largefiles | |
270 | 6:4355d653f84f edit files yet again |
|
273 | 6:4355d653f84f edit files yet again | |
271 | 5:9d5af5072dbd edit files again |
|
274 | 5:9d5af5072dbd edit files again | |
272 | 4:74c02385b94c move files |
|
275 | 4:74c02385b94c move files | |
273 | 3:9e8fbc4bce62 copy files |
|
276 | 3:9e8fbc4bce62 copy files | |
274 | 2:51a0ae4d5864 remove files |
|
277 | 2:51a0ae4d5864 remove files | |
275 | 1:ce8896473775 edit files |
|
278 | 1:ce8896473775 edit files | |
276 | 0:30d30fe6a5be add files |
|
279 | 0:30d30fe6a5be add files | |
277 | $ cat normal3 |
|
280 | $ cat normal3 | |
278 | normal33 |
|
281 | normal33 | |
279 | $ cat sub/normal4 |
|
282 | $ cat sub/normal4 | |
280 | normal44 |
|
283 | normal44 | |
281 | $ cat sub/large4 |
|
284 | $ cat sub/large4 | |
282 | large44 |
|
285 | large44 | |
283 | $ cat sub2/large6 |
|
286 | $ cat sub2/large6 | |
284 | large6 |
|
287 | large6 | |
285 | $ cat sub2/large7 |
|
288 | $ cat sub2/large7 | |
286 | large7 |
|
289 | large7 | |
287 | $ cd .. |
|
290 | $ cd .. | |
288 | $ hg clone a -r 3 c |
|
291 | $ hg clone a -r 3 c | |
289 | adding changesets |
|
292 | adding changesets | |
290 | adding manifests |
|
293 | adding manifests | |
291 | adding file changes |
|
294 | adding file changes | |
292 | added 4 changesets with 10 changes to 4 files |
|
295 | added 4 changesets with 10 changes to 4 files | |
293 | updating to branch default |
|
296 | updating to branch default | |
294 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
297 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
295 | getting changed largefiles |
|
298 | getting changed largefiles | |
296 | 2 largefiles updated, 0 removed |
|
299 | 2 largefiles updated, 0 removed | |
297 | $ cd c |
|
300 | $ cd c | |
298 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
301 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
299 | 3:9e8fbc4bce62 copy files |
|
302 | 3:9e8fbc4bce62 copy files | |
300 | 2:51a0ae4d5864 remove files |
|
303 | 2:51a0ae4d5864 remove files | |
301 | 1:ce8896473775 edit files |
|
304 | 1:ce8896473775 edit files | |
302 | 0:30d30fe6a5be add files |
|
305 | 0:30d30fe6a5be add files | |
303 | $ cat normal1 |
|
306 | $ cat normal1 | |
304 | normal22 |
|
307 | normal22 | |
305 | $ cat large1 |
|
308 | $ cat large1 | |
306 | large22 |
|
309 | large22 | |
307 | $ cat sub/normal2 |
|
310 | $ cat sub/normal2 | |
308 | normal22 |
|
311 | normal22 | |
309 | $ cat sub/large2 |
|
312 | $ cat sub/large2 | |
310 | large22 |
|
313 | large22 | |
311 |
|
314 | |||
312 | Old revisions of a clone have correct largefiles content (this also |
|
315 | Old revisions of a clone have correct largefiles content (this also | |
313 | tests update). |
|
316 | tests update). | |
314 |
|
317 | |||
315 | $ hg update -r 1 |
|
318 | $ hg update -r 1 | |
316 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
319 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
317 | getting changed largefiles |
|
320 | getting changed largefiles | |
318 | 1 largefiles updated, 0 removed |
|
321 | 1 largefiles updated, 0 removed | |
319 | $ cat large1 |
|
322 | $ cat large1 | |
320 | large11 |
|
323 | large11 | |
321 | $ cat sub/large2 |
|
324 | $ cat sub/large2 | |
322 | large22 |
|
325 | large22 | |
323 |
|
326 | |||
324 | Rebasing between two repositories does not revert largefiles to old |
|
327 | Rebasing between two repositories does not revert largefiles to old | |
325 | revisions (this was a very bad bug that took a lot of work to fix). |
|
328 | revisions (this was a very bad bug that took a lot of work to fix). | |
326 |
|
329 | |||
327 | $ cd .. |
|
330 | $ cd .. | |
328 | $ hg clone a d |
|
331 | $ hg clone a d | |
329 | updating to branch default |
|
332 | updating to branch default | |
330 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
333 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
331 | getting changed largefiles |
|
334 | getting changed largefiles | |
332 | 3 largefiles updated, 0 removed |
|
335 | 3 largefiles updated, 0 removed | |
333 | $ cd b |
|
336 | $ cd b | |
334 | $ echo large4-modified > sub/large4 |
|
337 | $ echo large4-modified > sub/large4 | |
335 | $ echo normal3-modified > normal3 |
|
338 | $ echo normal3-modified > normal3 | |
336 | $ hg commit -m "modify normal file and largefile in repo b" |
|
339 | $ hg commit -m "modify normal file and largefile in repo b" | |
337 | $ cd ../d |
|
340 | $ cd ../d | |
338 | $ echo large6-modified > sub2/large6 |
|
341 | $ echo large6-modified > sub2/large6 | |
339 | $ echo normal4-modified > sub/normal4 |
|
342 | $ echo normal4-modified > sub/normal4 | |
340 | $ hg commit -m "modify normal file largefile in repo d" |
|
343 | $ hg commit -m "modify normal file largefile in repo d" | |
341 | $ cd .. |
|
344 | $ cd .. | |
342 | $ hg clone d e |
|
345 | $ hg clone d e | |
343 | updating to branch default |
|
346 | updating to branch default | |
344 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
347 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
345 | getting changed largefiles |
|
348 | getting changed largefiles | |
346 | 3 largefiles updated, 0 removed |
|
349 | 3 largefiles updated, 0 removed | |
347 | $ cd d |
|
350 | $ cd d | |
348 | $ hg pull --rebase ../b |
|
351 | $ hg pull --rebase ../b | |
349 | pulling from ../b |
|
352 | pulling from ../b | |
350 | searching for changes |
|
353 | searching for changes | |
351 | adding changesets |
|
354 | adding changesets | |
352 | adding manifests |
|
355 | adding manifests | |
353 | adding file changes |
|
356 | adding file changes | |
354 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
357 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
355 | getting changed largefiles |
|
358 | getting changed largefiles | |
356 | 1 largefiles updated, 0 removed |
|
359 | 1 largefiles updated, 0 removed | |
357 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
360 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) | |
358 | nothing to rebase |
|
361 | nothing to rebase | |
359 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
362 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
360 | 9:598410d3eb9a modify normal file largefile in repo d |
|
363 | 9:598410d3eb9a modify normal file largefile in repo d | |
361 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
364 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
362 | 7:daea875e9014 add/edit more largefiles |
|
365 | 7:daea875e9014 add/edit more largefiles | |
363 | 6:4355d653f84f edit files yet again |
|
366 | 6:4355d653f84f edit files yet again | |
364 | 5:9d5af5072dbd edit files again |
|
367 | 5:9d5af5072dbd edit files again | |
365 | 4:74c02385b94c move files |
|
368 | 4:74c02385b94c move files | |
366 | 3:9e8fbc4bce62 copy files |
|
369 | 3:9e8fbc4bce62 copy files | |
367 | 2:51a0ae4d5864 remove files |
|
370 | 2:51a0ae4d5864 remove files | |
368 | 1:ce8896473775 edit files |
|
371 | 1:ce8896473775 edit files | |
369 | 0:30d30fe6a5be add files |
|
372 | 0:30d30fe6a5be add files | |
370 | $ cat normal3 |
|
373 | $ cat normal3 | |
371 | normal3-modified |
|
374 | normal3-modified | |
372 | $ cat sub/normal4 |
|
375 | $ cat sub/normal4 | |
373 | normal4-modified |
|
376 | normal4-modified | |
374 | $ cat sub/large4 |
|
377 | $ cat sub/large4 | |
375 | large4-modified |
|
378 | large4-modified | |
376 | $ cat sub2/large6 |
|
379 | $ cat sub2/large6 | |
377 | large6-modified |
|
380 | large6-modified | |
378 | $ cat sub2/large7 |
|
381 | $ cat sub2/large7 | |
379 | large7 |
|
382 | large7 | |
380 | $ cd ../e |
|
383 | $ cd ../e | |
381 | $ hg pull ../b |
|
384 | $ hg pull ../b | |
382 | pulling from ../b |
|
385 | pulling from ../b | |
383 | searching for changes |
|
386 | searching for changes | |
384 | adding changesets |
|
387 | adding changesets | |
385 | adding manifests |
|
388 | adding manifests | |
386 | adding file changes |
|
389 | adding file changes | |
387 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
390 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
388 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
391 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
389 | $ hg rebase |
|
392 | $ hg rebase | |
390 | getting changed largefiles |
|
393 | getting changed largefiles | |
391 | 1 largefiles updated, 0 removed |
|
394 | 1 largefiles updated, 0 removed | |
392 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
395 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob) | |
393 | $ hg log |
|
396 | $ hg log | |
394 | changeset: 9:598410d3eb9a |
|
397 | changeset: 9:598410d3eb9a | |
395 | tag: tip |
|
398 | tag: tip | |
396 | user: test |
|
399 | user: test | |
397 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
400 | date: Thu Jan 01 00:00:00 1970 +0000 | |
398 | summary: modify normal file largefile in repo d |
|
401 | summary: modify normal file largefile in repo d | |
399 |
|
402 | |||
400 | changeset: 8:a381d2c8c80e |
|
403 | changeset: 8:a381d2c8c80e | |
401 | user: test |
|
404 | user: test | |
402 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
405 | date: Thu Jan 01 00:00:00 1970 +0000 | |
403 | summary: modify normal file and largefile in repo b |
|
406 | summary: modify normal file and largefile in repo b | |
404 |
|
407 | |||
405 | changeset: 7:daea875e9014 |
|
408 | changeset: 7:daea875e9014 | |
406 | user: test |
|
409 | user: test | |
407 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
410 | date: Thu Jan 01 00:00:00 1970 +0000 | |
408 | summary: add/edit more largefiles |
|
411 | summary: add/edit more largefiles | |
409 |
|
412 | |||
410 | changeset: 6:4355d653f84f |
|
413 | changeset: 6:4355d653f84f | |
411 | user: test |
|
414 | user: test | |
412 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
415 | date: Thu Jan 01 00:00:00 1970 +0000 | |
413 | summary: edit files yet again |
|
416 | summary: edit files yet again | |
414 |
|
417 | |||
415 | changeset: 5:9d5af5072dbd |
|
418 | changeset: 5:9d5af5072dbd | |
416 | user: test |
|
419 | user: test | |
417 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
420 | date: Thu Jan 01 00:00:00 1970 +0000 | |
418 | summary: edit files again |
|
421 | summary: edit files again | |
419 |
|
422 | |||
420 | changeset: 4:74c02385b94c |
|
423 | changeset: 4:74c02385b94c | |
421 | user: test |
|
424 | user: test | |
422 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
425 | date: Thu Jan 01 00:00:00 1970 +0000 | |
423 | summary: move files |
|
426 | summary: move files | |
424 |
|
427 | |||
425 | changeset: 3:9e8fbc4bce62 |
|
428 | changeset: 3:9e8fbc4bce62 | |
426 | user: test |
|
429 | user: test | |
427 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
430 | date: Thu Jan 01 00:00:00 1970 +0000 | |
428 | summary: copy files |
|
431 | summary: copy files | |
429 |
|
432 | |||
430 | changeset: 2:51a0ae4d5864 |
|
433 | changeset: 2:51a0ae4d5864 | |
431 | user: test |
|
434 | user: test | |
432 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
435 | date: Thu Jan 01 00:00:00 1970 +0000 | |
433 | summary: remove files |
|
436 | summary: remove files | |
434 |
|
437 | |||
435 | changeset: 1:ce8896473775 |
|
438 | changeset: 1:ce8896473775 | |
436 | user: test |
|
439 | user: test | |
437 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
440 | date: Thu Jan 01 00:00:00 1970 +0000 | |
438 | summary: edit files |
|
441 | summary: edit files | |
439 |
|
442 | |||
440 | changeset: 0:30d30fe6a5be |
|
443 | changeset: 0:30d30fe6a5be | |
441 | user: test |
|
444 | user: test | |
442 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
445 | date: Thu Jan 01 00:00:00 1970 +0000 | |
443 | summary: add files |
|
446 | summary: add files | |
444 |
|
447 | |||
445 | $ cat normal3 |
|
448 | $ cat normal3 | |
446 | normal3-modified |
|
449 | normal3-modified | |
447 | $ cat sub/normal4 |
|
450 | $ cat sub/normal4 | |
448 | normal4-modified |
|
451 | normal4-modified | |
449 | $ cat sub/large4 |
|
452 | $ cat sub/large4 | |
450 | large4-modified |
|
453 | large4-modified | |
451 | $ cat sub2/large6 |
|
454 | $ cat sub2/large6 | |
452 | large6-modified |
|
455 | large6-modified | |
453 | $ cat sub2/large7 |
|
456 | $ cat sub2/large7 | |
454 | large7 |
|
457 | large7 | |
455 |
|
458 | |||
456 | Rollback on largefiles. |
|
459 | Rollback on largefiles. | |
457 |
|
460 | |||
458 | $ echo large4-modified-again > sub/large4 |
|
461 | $ echo large4-modified-again > sub/large4 | |
459 | $ hg commit -m "Modify large4 again" |
|
462 | $ hg commit -m "Modify large4 again" | |
460 | $ hg rollback |
|
463 | $ hg rollback | |
461 | repository tip rolled back to revision 9 (undo commit) |
|
464 | repository tip rolled back to revision 9 (undo commit) | |
462 | working directory now based on revision 9 |
|
465 | working directory now based on revision 9 | |
463 | $ hg st |
|
466 | $ hg st | |
464 | M sub/large4 |
|
467 | M sub/large4 | |
465 | $ hg log |
|
468 | $ hg log | |
466 | changeset: 9:598410d3eb9a |
|
469 | changeset: 9:598410d3eb9a | |
467 | tag: tip |
|
470 | tag: tip | |
468 | user: test |
|
471 | user: test | |
469 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
472 | date: Thu Jan 01 00:00:00 1970 +0000 | |
470 | summary: modify normal file largefile in repo d |
|
473 | summary: modify normal file largefile in repo d | |
471 |
|
474 | |||
472 | changeset: 8:a381d2c8c80e |
|
475 | changeset: 8:a381d2c8c80e | |
473 | user: test |
|
476 | user: test | |
474 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
477 | date: Thu Jan 01 00:00:00 1970 +0000 | |
475 | summary: modify normal file and largefile in repo b |
|
478 | summary: modify normal file and largefile in repo b | |
476 |
|
479 | |||
477 | changeset: 7:daea875e9014 |
|
480 | changeset: 7:daea875e9014 | |
478 | user: test |
|
481 | user: test | |
479 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
482 | date: Thu Jan 01 00:00:00 1970 +0000 | |
480 | summary: add/edit more largefiles |
|
483 | summary: add/edit more largefiles | |
481 |
|
484 | |||
482 | changeset: 6:4355d653f84f |
|
485 | changeset: 6:4355d653f84f | |
483 | user: test |
|
486 | user: test | |
484 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
487 | date: Thu Jan 01 00:00:00 1970 +0000 | |
485 | summary: edit files yet again |
|
488 | summary: edit files yet again | |
486 |
|
489 | |||
487 | changeset: 5:9d5af5072dbd |
|
490 | changeset: 5:9d5af5072dbd | |
488 | user: test |
|
491 | user: test | |
489 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
492 | date: Thu Jan 01 00:00:00 1970 +0000 | |
490 | summary: edit files again |
|
493 | summary: edit files again | |
491 |
|
494 | |||
492 | changeset: 4:74c02385b94c |
|
495 | changeset: 4:74c02385b94c | |
493 | user: test |
|
496 | user: test | |
494 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
497 | date: Thu Jan 01 00:00:00 1970 +0000 | |
495 | summary: move files |
|
498 | summary: move files | |
496 |
|
499 | |||
497 | changeset: 3:9e8fbc4bce62 |
|
500 | changeset: 3:9e8fbc4bce62 | |
498 | user: test |
|
501 | user: test | |
499 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
502 | date: Thu Jan 01 00:00:00 1970 +0000 | |
500 | summary: copy files |
|
503 | summary: copy files | |
501 |
|
504 | |||
502 | changeset: 2:51a0ae4d5864 |
|
505 | changeset: 2:51a0ae4d5864 | |
503 | user: test |
|
506 | user: test | |
504 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
507 | date: Thu Jan 01 00:00:00 1970 +0000 | |
505 | summary: remove files |
|
508 | summary: remove files | |
506 |
|
509 | |||
507 | changeset: 1:ce8896473775 |
|
510 | changeset: 1:ce8896473775 | |
508 | user: test |
|
511 | user: test | |
509 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
512 | date: Thu Jan 01 00:00:00 1970 +0000 | |
510 | summary: edit files |
|
513 | summary: edit files | |
511 |
|
514 | |||
512 | changeset: 0:30d30fe6a5be |
|
515 | changeset: 0:30d30fe6a5be | |
513 | user: test |
|
516 | user: test | |
514 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
517 | date: Thu Jan 01 00:00:00 1970 +0000 | |
515 | summary: add files |
|
518 | summary: add files | |
516 |
|
519 | |||
517 | $ cat sub/large4 |
|
520 | $ cat sub/large4 | |
518 | large4-modified-again |
|
521 | large4-modified-again | |
519 |
|
522 | |||
520 | "update --check" refuses to update with uncommitted changes. |
|
523 | "update --check" refuses to update with uncommitted changes. | |
521 | $ hg update --check 8 |
|
524 | $ hg update --check 8 | |
522 | abort: uncommitted local changes |
|
525 | abort: uncommitted local changes | |
523 | [255] |
|
526 | [255] | |
524 |
|
527 | |||
525 | "update --clean" leaves correct largefiles in working copy. |
|
528 | "update --clean" leaves correct largefiles in working copy. | |
526 |
|
529 | |||
527 | $ hg update --clean |
|
530 | $ hg update --clean | |
528 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
531 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
529 | getting changed largefiles |
|
532 | getting changed largefiles | |
530 | 1 largefiles updated, 0 removed |
|
533 | 1 largefiles updated, 0 removed | |
531 | $ cat normal3 |
|
534 | $ cat normal3 | |
532 | normal3-modified |
|
535 | normal3-modified | |
533 | $ cat sub/normal4 |
|
536 | $ cat sub/normal4 | |
534 | normal4-modified |
|
537 | normal4-modified | |
535 | $ cat sub/large4 |
|
538 | $ cat sub/large4 | |
536 | large4-modified |
|
539 | large4-modified | |
537 | $ cat sub2/large6 |
|
540 | $ cat sub2/large6 | |
538 | large6-modified |
|
541 | large6-modified | |
539 | $ cat sub2/large7 |
|
542 | $ cat sub2/large7 | |
540 | large7 |
|
543 | large7 | |
541 |
|
544 | |||
542 | Now "update check" is happy. |
|
545 | Now "update check" is happy. | |
543 | $ hg update --check 8 |
|
546 | $ hg update --check 8 | |
544 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
547 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
545 | getting changed largefiles |
|
548 | getting changed largefiles | |
546 | 1 largefiles updated, 0 removed |
|
549 | 1 largefiles updated, 0 removed | |
547 | $ hg update --check |
|
550 | $ hg update --check | |
548 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
551 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
549 | getting changed largefiles |
|
552 | getting changed largefiles | |
550 | 1 largefiles updated, 0 removed |
|
553 | 1 largefiles updated, 0 removed | |
551 |
|
554 | |||
552 | "revert" works on largefiles (and normal files too). |
|
555 | "revert" works on largefiles (and normal files too). | |
553 | $ echo hack3 >> normal3 |
|
556 | $ echo hack3 >> normal3 | |
554 | $ echo hack4 >> sub/normal4 |
|
557 | $ echo hack4 >> sub/normal4 | |
555 | $ echo hack4 >> sub/large4 |
|
558 | $ echo hack4 >> sub/large4 | |
556 | $ hg rm sub2/large6 |
|
559 | $ hg rm sub2/large6 | |
557 | $ echo new >> sub2/large8 |
|
560 | $ echo new >> sub2/large8 | |
558 | $ hg add --large sub2/large8 |
|
561 | $ hg add --large sub2/large8 | |
559 | # XXX we don't really want to report that we're reverting the standin; |
|
562 | # XXX we don't really want to report that we're reverting the standin; | |
560 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
563 | # that's just an implementation detail. But I don't see an obvious fix. ;-( | |
561 | $ hg revert sub |
|
564 | $ hg revert sub | |
562 | reverting .hglf/sub/large4 (glob) |
|
565 | reverting .hglf/sub/large4 (glob) | |
563 | reverting sub/normal4 (glob) |
|
566 | reverting sub/normal4 (glob) | |
564 | $ hg status |
|
567 | $ hg status | |
565 | M normal3 |
|
568 | M normal3 | |
566 | A sub2/large8 |
|
569 | A sub2/large8 | |
567 | R sub2/large6 |
|
570 | R sub2/large6 | |
568 | ? sub/large4.orig |
|
571 | ? sub/large4.orig | |
569 | ? sub/normal4.orig |
|
572 | ? sub/normal4.orig | |
570 | $ cat sub/normal4 |
|
573 | $ cat sub/normal4 | |
571 | normal4-modified |
|
574 | normal4-modified | |
572 | $ cat sub/large4 |
|
575 | $ cat sub/large4 | |
573 | large4-modified |
|
576 | large4-modified | |
574 | $ hg revert -a --no-backup |
|
577 | $ hg revert -a --no-backup | |
575 | undeleting .hglf/sub2/large6 (glob) |
|
578 | undeleting .hglf/sub2/large6 (glob) | |
576 | forgetting .hglf/sub2/large8 (glob) |
|
579 | forgetting .hglf/sub2/large8 (glob) | |
577 | reverting normal3 |
|
580 | reverting normal3 | |
578 | $ hg status |
|
581 | $ hg status | |
579 | ? sub/large4.orig |
|
582 | ? sub/large4.orig | |
580 | ? sub/normal4.orig |
|
583 | ? sub/normal4.orig | |
581 | ? sub2/large8 |
|
584 | ? sub2/large8 | |
582 | $ cat normal3 |
|
585 | $ cat normal3 | |
583 | normal3-modified |
|
586 | normal3-modified | |
584 | $ cat sub2/large6 |
|
587 | $ cat sub2/large6 | |
585 | large6-modified |
|
588 | large6-modified | |
586 | $ rm sub/*.orig sub2/large8 |
|
589 | $ rm sub/*.orig sub2/large8 | |
587 |
|
590 | |||
588 | revert some files to an older revision |
|
591 | revert some files to an older revision | |
589 | $ hg revert --no-backup -r 8 sub2 |
|
592 | $ hg revert --no-backup -r 8 sub2 | |
590 | reverting .hglf/sub2/large6 (glob) |
|
593 | reverting .hglf/sub2/large6 (glob) | |
591 | $ cat sub2/large6 |
|
594 | $ cat sub2/large6 | |
592 | large6 |
|
595 | large6 | |
593 | $ hg revert --no-backup sub2 |
|
596 | $ hg revert --no-backup sub2 | |
594 | reverting .hglf/sub2/large6 (glob) |
|
597 | reverting .hglf/sub2/large6 (glob) | |
595 | $ hg status |
|
598 | $ hg status | |
596 |
|
599 | |||
597 | "verify --large" actually verifies largefiles |
|
600 | "verify --large" actually verifies largefiles | |
598 |
|
601 | |||
599 | $ hg verify --large |
|
602 | $ hg verify --large | |
600 | checking changesets |
|
603 | checking changesets | |
601 | checking manifests |
|
604 | checking manifests | |
602 | crosschecking files in changesets and manifests |
|
605 | crosschecking files in changesets and manifests | |
603 | checking files |
|
606 | checking files | |
604 | 10 files, 10 changesets, 28 total revisions |
|
607 | 10 files, 10 changesets, 28 total revisions | |
605 | searching 1 changesets for largefiles |
|
608 | searching 1 changesets for largefiles | |
606 | verified existence of 3 revisions of 3 largefiles |
|
609 | verified existence of 3 revisions of 3 largefiles | |
607 |
|
610 | |||
608 | Merging does not revert to old versions of largefiles (this has also |
|
611 | Merging does not revert to old versions of largefiles (this has also | |
609 | been very problematic). |
|
612 | been very problematic). | |
610 |
|
613 | |||
611 | $ cd .. |
|
614 | $ cd .. | |
612 | $ hg clone -r 7 e f |
|
615 | $ hg clone -r 7 e f | |
613 | adding changesets |
|
616 | adding changesets | |
614 | adding manifests |
|
617 | adding manifests | |
615 | adding file changes |
|
618 | adding file changes | |
616 | added 8 changesets with 24 changes to 10 files |
|
619 | added 8 changesets with 24 changes to 10 files | |
617 | updating to branch default |
|
620 | updating to branch default | |
618 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
621 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
619 | getting changed largefiles |
|
622 | getting changed largefiles | |
620 | 3 largefiles updated, 0 removed |
|
623 | 3 largefiles updated, 0 removed | |
621 | $ cd f |
|
624 | $ cd f | |
622 | $ echo "large4-merge-test" > sub/large4 |
|
625 | $ echo "large4-merge-test" > sub/large4 | |
623 | $ hg commit -m "Modify large4 to test merge" |
|
626 | $ hg commit -m "Modify large4 to test merge" | |
624 | $ hg pull ../e |
|
627 | $ hg pull ../e | |
625 | pulling from ../e |
|
628 | pulling from ../e | |
626 | searching for changes |
|
629 | searching for changes | |
627 | adding changesets |
|
630 | adding changesets | |
628 | adding manifests |
|
631 | adding manifests | |
629 | adding file changes |
|
632 | adding file changes | |
630 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
633 | added 2 changesets with 4 changes to 4 files (+1 heads) | |
631 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
634 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
632 | $ hg merge |
|
635 | $ hg merge | |
633 | merging sub/large4 |
|
636 | merging sub/large4 | |
634 | largefile sub/large4 has a merge conflict |
|
637 | largefile sub/large4 has a merge conflict | |
635 | keep (l)ocal or take (o)ther? l |
|
638 | keep (l)ocal or take (o)ther? l | |
636 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
639 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
637 | (branch merge, don't forget to commit) |
|
640 | (branch merge, don't forget to commit) | |
638 | getting changed largefiles |
|
641 | getting changed largefiles | |
639 | 1 largefiles updated, 0 removed |
|
642 | 1 largefiles updated, 0 removed | |
640 | $ hg commit -m "Merge repos e and f" |
|
643 | $ hg commit -m "Merge repos e and f" | |
641 | $ cat normal3 |
|
644 | $ cat normal3 | |
642 | normal3-modified |
|
645 | normal3-modified | |
643 | $ cat sub/normal4 |
|
646 | $ cat sub/normal4 | |
644 | normal4-modified |
|
647 | normal4-modified | |
645 | $ cat sub/large4 |
|
648 | $ cat sub/large4 | |
646 | large4-merge-test |
|
649 | large4-merge-test | |
647 | $ cat sub2/large6 |
|
650 | $ cat sub2/large6 | |
648 | large6-modified |
|
651 | large6-modified | |
649 | $ cat sub2/large7 |
|
652 | $ cat sub2/large7 | |
650 | large7 |
|
653 | large7 | |
651 |
|
654 | |||
652 | Test status after merging with a branch that introduces a new largefile: |
|
655 | Test status after merging with a branch that introduces a new largefile: | |
653 |
|
656 | |||
654 | $ echo large > large |
|
657 | $ echo large > large | |
655 | $ hg add --large large |
|
658 | $ hg add --large large | |
656 | $ hg commit -m 'add largefile' |
|
659 | $ hg commit -m 'add largefile' | |
657 | $ hg update -q ".^" |
|
660 | $ hg update -q ".^" | |
658 | $ echo change >> normal3 |
|
661 | $ echo change >> normal3 | |
659 | $ hg commit -m 'some change' |
|
662 | $ hg commit -m 'some change' | |
660 | created new head |
|
663 | created new head | |
661 | $ hg merge |
|
664 | $ hg merge | |
662 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
665 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
663 | (branch merge, don't forget to commit) |
|
666 | (branch merge, don't forget to commit) | |
664 | getting changed largefiles |
|
667 | getting changed largefiles | |
665 | 1 largefiles updated, 0 removed |
|
668 | 1 largefiles updated, 0 removed | |
666 | $ hg status |
|
669 | $ hg status | |
667 | M large |
|
670 | M large | |
668 |
|
671 | |||
669 | Test that a normal file and a largefile with the same name and path cannot |
|
672 | Test that a normal file and a largefile with the same name and path cannot | |
670 | coexist. |
|
673 | coexist. | |
671 |
|
674 | |||
672 | $ rm sub2/large7 |
|
675 | $ rm sub2/large7 | |
673 | $ echo "largeasnormal" > sub2/large7 |
|
676 | $ echo "largeasnormal" > sub2/large7 | |
674 | $ hg add sub2/large7 |
|
677 | $ hg add sub2/large7 | |
675 | sub2/large7 already a largefile |
|
678 | sub2/large7 already a largefile | |
676 |
|
679 | |||
677 | Test that transplanting a largefile change works correctly. |
|
680 | Test that transplanting a largefile change works correctly. | |
678 |
|
681 | |||
679 | $ cd .. |
|
682 | $ cd .. | |
680 | $ hg clone -r 8 d g |
|
683 | $ hg clone -r 8 d g | |
681 | adding changesets |
|
684 | adding changesets | |
682 | adding manifests |
|
685 | adding manifests | |
683 | adding file changes |
|
686 | adding file changes | |
684 | added 9 changesets with 26 changes to 10 files |
|
687 | added 9 changesets with 26 changes to 10 files | |
685 | updating to branch default |
|
688 | updating to branch default | |
686 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
689 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
687 | getting changed largefiles |
|
690 | getting changed largefiles | |
688 | 3 largefiles updated, 0 removed |
|
691 | 3 largefiles updated, 0 removed | |
689 | $ cd g |
|
692 | $ cd g | |
690 | $ hg transplant -s ../d 598410d3eb9a |
|
693 | $ hg transplant -s ../d 598410d3eb9a | |
691 | searching for changes |
|
694 | searching for changes | |
692 | searching for changes |
|
695 | searching for changes | |
693 | adding changesets |
|
696 | adding changesets | |
694 | adding manifests |
|
697 | adding manifests | |
695 | adding file changes |
|
698 | adding file changes | |
696 | added 1 changesets with 2 changes to 2 files |
|
699 | added 1 changesets with 2 changes to 2 files | |
697 | getting changed largefiles |
|
700 | getting changed largefiles | |
698 | 1 largefiles updated, 0 removed |
|
701 | 1 largefiles updated, 0 removed | |
699 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
702 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
700 | 9:598410d3eb9a modify normal file largefile in repo d |
|
703 | 9:598410d3eb9a modify normal file largefile in repo d | |
701 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
704 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
702 | 7:daea875e9014 add/edit more largefiles |
|
705 | 7:daea875e9014 add/edit more largefiles | |
703 | 6:4355d653f84f edit files yet again |
|
706 | 6:4355d653f84f edit files yet again | |
704 | 5:9d5af5072dbd edit files again |
|
707 | 5:9d5af5072dbd edit files again | |
705 | 4:74c02385b94c move files |
|
708 | 4:74c02385b94c move files | |
706 | 3:9e8fbc4bce62 copy files |
|
709 | 3:9e8fbc4bce62 copy files | |
707 | 2:51a0ae4d5864 remove files |
|
710 | 2:51a0ae4d5864 remove files | |
708 | 1:ce8896473775 edit files |
|
711 | 1:ce8896473775 edit files | |
709 | 0:30d30fe6a5be add files |
|
712 | 0:30d30fe6a5be add files | |
710 | $ cat normal3 |
|
713 | $ cat normal3 | |
711 | normal3-modified |
|
714 | normal3-modified | |
712 | $ cat sub/normal4 |
|
715 | $ cat sub/normal4 | |
713 | normal4-modified |
|
716 | normal4-modified | |
714 | $ cat sub/large4 |
|
717 | $ cat sub/large4 | |
715 | large4-modified |
|
718 | large4-modified | |
716 | $ cat sub2/large6 |
|
719 | $ cat sub2/large6 | |
717 | large6-modified |
|
720 | large6-modified | |
718 | $ cat sub2/large7 |
|
721 | $ cat sub2/large7 | |
719 | large7 |
|
722 | large7 | |
720 |
|
723 | |||
721 | Test that renaming a largefile results in correct output for status |
|
724 | Test that renaming a largefile results in correct output for status | |
722 |
|
725 | |||
723 | $ hg rename sub/large4 large4-renamed |
|
726 | $ hg rename sub/large4 large4-renamed | |
724 | $ hg st |
|
727 | $ hg st | |
725 | A large4-renamed |
|
728 | A large4-renamed | |
726 | R sub/large4 |
|
729 | R sub/large4 | |
727 | $ hg commit -m "test rename output" |
|
730 | $ hg commit -m "test rename output" | |
728 | $ cat large4-renamed |
|
731 | $ cat large4-renamed | |
729 | large4-modified |
|
732 | large4-modified | |
730 | $ cd sub2 |
|
733 | $ cd sub2 | |
731 | $ hg rename large6 large6-renamed |
|
734 | $ hg rename large6 large6-renamed | |
732 | $ hg st |
|
735 | $ hg st | |
733 | A sub2/large6-renamed |
|
736 | A sub2/large6-renamed | |
734 | R sub2/large6 |
|
737 | R sub2/large6 | |
735 | $ cd ../.. |
|
738 | $ cd ../.. | |
736 |
|
739 | |||
737 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
740 | vanilla clients not locked out from largefiles servers on vanilla repos | |
738 | $ mkdir r1 |
|
741 | $ mkdir r1 | |
739 | $ cd r1 |
|
742 | $ cd r1 | |
740 | $ hg init |
|
743 | $ hg init | |
741 | $ echo c1 > f1 |
|
744 | $ echo c1 > f1 | |
742 | $ hg add f1 |
|
745 | $ hg add f1 | |
743 | $ hg com -m "m1" |
|
746 | $ hg com -m "m1" | |
744 | $ cd .. |
|
747 | $ cd .. | |
745 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
748 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid | |
746 | $ cat hg.pid >> $DAEMON_PIDS |
|
749 | $ cat hg.pid >> $DAEMON_PIDS | |
747 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
750 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 | |
748 | requesting all changes |
|
751 | requesting all changes | |
749 | adding changesets |
|
752 | adding changesets | |
750 | adding manifests |
|
753 | adding manifests | |
751 | adding file changes |
|
754 | adding file changes | |
752 | added 1 changesets with 1 changes to 1 files |
|
755 | added 1 changesets with 1 changes to 1 files | |
753 | updating to branch default |
|
756 | updating to branch default | |
754 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
757 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
755 |
|
758 | |||
756 | largefiles clients still work with vanilla servers |
|
759 | largefiles clients still work with vanilla servers | |
757 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
760 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid | |
758 | $ cat hg.pid >> $DAEMON_PIDS |
|
761 | $ cat hg.pid >> $DAEMON_PIDS | |
759 | $ hg clone http://localhost:$HGPORT1 r3 |
|
762 | $ hg clone http://localhost:$HGPORT1 r3 | |
760 | requesting all changes |
|
763 | requesting all changes | |
761 | adding changesets |
|
764 | adding changesets | |
762 | adding manifests |
|
765 | adding manifests | |
763 | adding file changes |
|
766 | adding file changes | |
764 | added 1 changesets with 1 changes to 1 files |
|
767 | added 1 changesets with 1 changes to 1 files | |
765 | updating to branch default |
|
768 | updating to branch default | |
766 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
769 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
767 |
|
770 | |||
768 | vanilla clients locked out from largefiles http repos |
|
771 | vanilla clients locked out from largefiles http repos | |
769 | $ mkdir r4 |
|
772 | $ mkdir r4 | |
770 | $ cd r4 |
|
773 | $ cd r4 | |
771 | $ hg init |
|
774 | $ hg init | |
772 | $ echo c1 > f1 |
|
775 | $ echo c1 > f1 | |
773 | $ hg add --large f1 |
|
776 | $ hg add --large f1 | |
774 | $ hg com -m "m1" |
|
777 | $ hg com -m "m1" | |
775 | $ cd .. |
|
778 | $ cd .. | |
776 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
779 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid | |
777 | $ cat hg.pid >> $DAEMON_PIDS |
|
780 | $ cat hg.pid >> $DAEMON_PIDS | |
778 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
781 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 | |
779 | abort: remote error: |
|
782 | abort: remote error: | |
780 |
|
783 | |||
781 | This repository uses the largefiles extension. |
|
784 | This repository uses the largefiles extension. | |
782 |
|
785 | |||
783 | Please enable it in your Mercurial config file. |
|
786 | Please enable it in your Mercurial config file. | |
784 | [255] |
|
787 | [255] | |
785 |
|
788 | |||
786 | used all HGPORTs, kill all daemons |
|
789 | used all HGPORTs, kill all daemons | |
787 | $ "$TESTDIR/killdaemons.py" |
|
790 | $ "$TESTDIR/killdaemons.py" | |
788 |
|
791 | |||
789 | vanilla clients locked out from largefiles ssh repos |
|
792 | vanilla clients locked out from largefiles ssh repos | |
790 | $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5 |
|
793 | $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5 | |
791 | abort: remote error: |
|
794 | abort: remote error: | |
792 |
|
795 | |||
793 | This repository uses the largefiles extension. |
|
796 | This repository uses the largefiles extension. | |
794 |
|
797 | |||
795 | Please enable it in your Mercurial config file. |
|
798 | Please enable it in your Mercurial config file. | |
796 | [255] |
|
799 | [255] | |
797 |
|
800 | |||
798 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
801 | largefiles clients refuse to push largefiles repos to vanilla servers | |
799 | $ mkdir r6 |
|
802 | $ mkdir r6 | |
800 | $ cd r6 |
|
803 | $ cd r6 | |
801 | $ hg init |
|
804 | $ hg init | |
802 | $ echo c1 > f1 |
|
805 | $ echo c1 > f1 | |
803 | $ hg add f1 |
|
806 | $ hg add f1 | |
804 | $ hg com -m "m1" |
|
807 | $ hg com -m "m1" | |
805 | $ cat >> .hg/hgrc <<! |
|
808 | $ cat >> .hg/hgrc <<! | |
806 | > [web] |
|
809 | > [web] | |
807 | > push_ssl = false |
|
810 | > push_ssl = false | |
808 | > allow_push = * |
|
811 | > allow_push = * | |
809 | > ! |
|
812 | > ! | |
810 | $ cd .. |
|
813 | $ cd .. | |
811 | $ hg clone r6 r7 |
|
814 | $ hg clone r6 r7 | |
812 | updating to branch default |
|
815 | updating to branch default | |
813 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
816 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
814 | $ cd r7 |
|
817 | $ cd r7 | |
815 | $ echo c2 > f2 |
|
818 | $ echo c2 > f2 | |
816 | $ hg add --large f2 |
|
819 | $ hg add --large f2 | |
817 | $ hg com -m "m2" |
|
820 | $ hg com -m "m2" | |
818 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid |
|
821 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid | |
819 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
822 | $ cat ../hg.pid >> $DAEMON_PIDS | |
820 | $ hg push http://localhost:$HGPORT |
|
823 | $ hg push http://localhost:$HGPORT | |
821 | pushing to http://localhost:$HGPORT/ |
|
824 | pushing to http://localhost:$HGPORT/ | |
822 | searching for changes |
|
825 | searching for changes | |
823 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
826 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store | |
824 | [255] |
|
827 | [255] | |
825 | $ cd .. |
|
828 | $ cd .. | |
826 |
|
829 | |||
|
830 | putlfile errors are shown (issue3123) | |||
|
831 | Corrupt the cached largefile in r7 | |||
|
832 | $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8 | |||
|
833 | $ hg init empty | |||
|
834 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ | |||
|
835 | > --config 'web.allow_push=*' --config web.push_ssl=False | |||
|
836 | $ cat hg.pid >> $DAEMON_PIDS | |||
|
837 | $ hg push -R r7 http://localhost:$HGPORT1 | |||
|
838 | pushing to http://localhost:$HGPORT1/ | |||
|
839 | searching for changes | |||
|
840 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash | |||
|
841 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ | |||
|
842 | [255] | |||
|
843 | $ rm -rf empty | |||
|
844 | ||||
827 | Clone a local repository owned by another user |
|
845 | Clone a local repository owned by another user | |
828 | We have to simulate that here by setting $HOME and removing write permissions |
|
846 | We have to simulate that here by setting $HOME and removing write permissions | |
829 | $ ORIGHOME="$HOME" |
|
847 | $ ORIGHOME="$HOME" | |
830 | $ mkdir alice |
|
848 | $ mkdir alice | |
831 | $ HOME="`pwd`/alice" |
|
849 | $ HOME="`pwd`/alice" | |
832 | $ cd alice |
|
850 | $ cd alice | |
833 | $ hg init pubrepo |
|
851 | $ hg init pubrepo | |
834 | $ cd pubrepo |
|
852 | $ cd pubrepo | |
835 | $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null |
|
853 | $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null | |
836 | $ hg add --large a-large-file |
|
854 | $ hg add --large a-large-file | |
837 | $ hg commit -m "Add a large file" |
|
855 | $ hg commit -m "Add a large file" | |
838 | $ cd .. |
|
856 | $ cd .. | |
839 | $ chmod -R a-w pubrepo |
|
857 | $ chmod -R a-w pubrepo | |
840 | $ cd .. |
|
858 | $ cd .. | |
841 | $ mkdir bob |
|
859 | $ mkdir bob | |
842 | $ HOME="`pwd`/bob" |
|
860 | $ HOME="`pwd`/bob" | |
843 | $ cd bob |
|
861 | $ cd bob | |
844 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
862 | $ hg clone --pull ../alice/pubrepo pubrepo | |
845 | requesting all changes |
|
863 | requesting all changes | |
846 | adding changesets |
|
864 | adding changesets | |
847 | adding manifests |
|
865 | adding manifests | |
848 | adding file changes |
|
866 | adding file changes | |
849 | added 1 changesets with 1 changes to 1 files |
|
867 | added 1 changesets with 1 changes to 1 files | |
850 | updating to branch default |
|
868 | updating to branch default | |
851 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
869 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
852 | getting changed largefiles |
|
870 | getting changed largefiles | |
853 | 1 largefiles updated, 0 removed |
|
871 | 1 largefiles updated, 0 removed | |
854 | $ cd .. |
|
872 | $ cd .. | |
855 | $ chmod -R u+w alice/pubrepo |
|
873 | $ chmod -R u+w alice/pubrepo | |
856 | $ HOME="$ORIGHOME" |
|
874 | $ HOME="$ORIGHOME" | |
857 |
|
875 | |||
858 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
876 | Symlink to a large largefile should behave the same as a symlink to a normal file | |
859 | $ hg init largesymlink |
|
877 | $ hg init largesymlink | |
860 | $ cd largesymlink |
|
878 | $ cd largesymlink | |
861 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
879 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null | |
862 | $ hg add --large largefile |
|
880 | $ hg add --large largefile | |
863 | $ hg commit -m "commit a large file" |
|
881 | $ hg commit -m "commit a large file" | |
864 | $ ln -s largefile largelink |
|
882 | $ ln -s largefile largelink | |
865 | $ hg add largelink |
|
883 | $ hg add largelink | |
866 | $ hg commit -m "commit a large symlink" |
|
884 | $ hg commit -m "commit a large symlink" | |
867 | $ rm -f largelink |
|
885 | $ rm -f largelink | |
868 | $ hg up >/dev/null |
|
886 | $ hg up >/dev/null | |
869 | $ test -f largelink |
|
887 | $ test -f largelink | |
870 | [1] |
|
888 | [1] | |
871 | $ test -L largelink |
|
889 | $ test -L largelink | |
872 | [1] |
|
890 | [1] | |
873 | $ rm -f largelink # make next part of the test independent of the previous |
|
891 | $ rm -f largelink # make next part of the test independent of the previous | |
874 | $ hg up -C >/dev/null |
|
892 | $ hg up -C >/dev/null | |
875 | $ test -f largelink |
|
893 | $ test -f largelink | |
876 | $ test -L largelink |
|
894 | $ test -L largelink | |
877 | $ cd .. |
|
895 | $ cd .. | |
878 |
|
896 | |||
879 |
|
897 |
General Comments 0
You need to be logged in to leave comments.
Login now