Show More
@@ -96,6 +96,7 b' class local(object):' | |||||
96 | self.vfs = lfsvfs(fullpath) |
|
96 | self.vfs = lfsvfs(fullpath) | |
97 | usercache = lfutil._usercachedir(repo.ui, 'lfs') |
|
97 | usercache = lfutil._usercachedir(repo.ui, 'lfs') | |
98 | self.cachevfs = lfsvfs(usercache) |
|
98 | self.cachevfs = lfsvfs(usercache) | |
|
99 | self.ui = repo.ui | |||
99 |
|
100 | |||
100 | def write(self, oid, data): |
|
101 | def write(self, oid, data): | |
101 | """Write blob to local blobstore.""" |
|
102 | """Write blob to local blobstore.""" | |
@@ -105,12 +106,16 b' class local(object):' | |||||
105 | # XXX: should we verify the content of the cache, and hardlink back to |
|
106 | # XXX: should we verify the content of the cache, and hardlink back to | |
106 | # the local store on success, but truncate, write and link on failure? |
|
107 | # the local store on success, but truncate, write and link on failure? | |
107 | if not self.cachevfs.exists(oid): |
|
108 | if not self.cachevfs.exists(oid): | |
|
109 | self.ui.note(_('lfs: adding %s to the usercache\n') % oid) | |||
108 | lfutil.link(self.vfs.join(oid), self.cachevfs.join(oid)) |
|
110 | lfutil.link(self.vfs.join(oid), self.cachevfs.join(oid)) | |
109 |
|
111 | |||
110 | def read(self, oid): |
|
112 | def read(self, oid): | |
111 | """Read blob from local blobstore.""" |
|
113 | """Read blob from local blobstore.""" | |
112 | if not self.vfs.exists(oid): |
|
114 | if not self.vfs.exists(oid): | |
113 | lfutil.link(self.cachevfs.join(oid), self.vfs.join(oid)) |
|
115 | lfutil.link(self.cachevfs.join(oid), self.vfs.join(oid)) | |
|
116 | self.ui.note(_('lfs: found %s in the usercache\n') % oid) | |||
|
117 | else: | |||
|
118 | self.ui.note(_('lfs: found %s in the local lfs store\n') % oid) | |||
114 | return self.vfs.read(oid) |
|
119 | return self.vfs.read(oid) | |
115 |
|
120 | |||
116 | def has(self, oid): |
|
121 | def has(self, oid): |
@@ -279,7 +279,7 b' def extractpointers(repo, revs):' | |||||
279 | ctx = repo[r] |
|
279 | ctx = repo[r] | |
280 | for p in pointersfromctx(ctx).values(): |
|
280 | for p in pointersfromctx(ctx).values(): | |
281 | pointers[p.oid()] = p |
|
281 | pointers[p.oid()] = p | |
282 | return pointers.values() |
|
282 | return sorted(pointers.values()) | |
283 |
|
283 | |||
284 | def pointersfromctx(ctx): |
|
284 | def pointersfromctx(ctx): | |
285 | """return a dict {path: pointer} for given single changectx""" |
|
285 | """return a dict {path: pointer} for given single changectx""" |
@@ -61,7 +61,9 b' Clear the cache to force a download' | |||||
61 | resolving manifests |
|
61 | resolving manifests | |
62 | getting a |
|
62 | getting a | |
63 | lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
|
63 | lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | |
|
64 | lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache | |||
64 | lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
|
65 | lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | |
|
66 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | |||
65 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
66 |
|
68 | |||
67 | When the server has some blobs already |
|
69 | When the server has some blobs already | |
@@ -90,12 +92,17 b' Clear the cache to force a download' | |||||
90 | $ hg --repo ../repo1 update tip -v |
|
92 | $ hg --repo ../repo1 update tip -v | |
91 | resolving manifests |
|
93 | resolving manifests | |
92 | getting b |
|
94 | getting b | |
|
95 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | |||
93 | getting c |
|
96 | getting c | |
94 | lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
|
97 | lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | |
|
98 | lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache | |||
95 | lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
99 | lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
|
100 | lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store | |||
96 | getting d |
|
101 | getting d | |
97 | lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) |
|
102 | lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) | |
|
103 | lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache | |||
98 | lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 |
|
104 | lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 | |
|
105 | lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store | |||
99 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
106 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
100 |
|
107 | |||
101 | Check error message when the remote missed a blob: |
|
108 | Check error message when the remote missed a blob: |
@@ -59,6 +59,7 b'' | |||||
59 | $ hg push -v | egrep -v '^(uncompressed| )' |
|
59 | $ hg push -v | egrep -v '^(uncompressed| )' | |
60 | pushing to $TESTTMP/server |
|
60 | pushing to $TESTTMP/server | |
61 | searching for changes |
|
61 | searching for changes | |
|
62 | lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store | |||
62 | 2 changesets found |
|
63 | 2 changesets found | |
63 | adding changesets |
|
64 | adding changesets | |
64 | adding manifests |
|
65 | adding manifests | |
@@ -192,6 +193,7 b'' | |||||
192 | $ echo SMALL > small |
|
193 | $ echo SMALL > small | |
193 | $ hg commit -Aqm 'create a lfs file' large small |
|
194 | $ hg commit -Aqm 'create a lfs file' large small | |
194 | $ hg debuglfsupload -r 'all()' -v |
|
195 | $ hg debuglfsupload -r 'all()' -v | |
|
196 | lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store | |||
195 |
|
197 | |||
196 |
$ |
|
198 | $ cd .. | |
197 |
|
199 | |||
@@ -316,6 +318,10 b'' | |||||
316 | $ hg commit -m branching -q |
|
318 | $ hg commit -m branching -q | |
317 |
|
319 | |||
318 | $ hg bundle --base 1 bundle.hg -v |
|
320 | $ hg bundle --base 1 bundle.hg -v | |
|
321 | lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store | |||
|
322 | lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store | |||
|
323 | lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store | |||
|
324 | lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store | |||
319 | 4 changesets found |
|
325 | 4 changesets found | |
320 | uncompressed size of bundle content: |
|
326 | uncompressed size of bundle content: | |
321 | * (changelog) (glob) |
|
327 | * (changelog) (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now