Commit Graph

24 Commits

Author SHA1 Message Date
Mads Kiilerich
9fb2d6a4da largefiles: refactoring - return hex from _getfile and copyandhash 2013-04-15 23:35:18 +02:00
Mads Kiilerich
00a100f5a5 merge with stable 2013-02-28 14:51:59 +01:00
Mads Kiilerich
8c5a6710d0 largefiles: don't assume that .hg/largefiles/ still exists
It might not have been created and it might have been removed.
2013-02-28 13:45:18 +01:00
Mads Kiilerich
2ec95abd3b largefiles: allow use of urls with #revision
largefiles tried to create a peer directly with the specified url. That caused
  abort: unsupported URL component: "..."
if a revision was specified in the url.

The branch name do not matter for largefiles' use of remote peers. Largefiles
will be shared among all branches anyway.
2013-01-28 15:19:44 +01:00
Mads Kiilerich
46ab1da155 largefiles: verify all files in each revision and report errors in any revision
Verify used 'any' and would stop verifying after the first failure in each
changeset.

The exit code only reported the result from the last changeset.
2013-01-28 15:19:44 +01:00
Mads Kiilerich
30af46c496 largefiles: don't allow corruption to propagate after detection
basestore.get uses util.atomictempfile when checking and receiving a new
largefile ... but the close/discard logic was too clever for largefiles.
Largefiles relied on being able to discard the file and thus prevent it from
being written to the store. That was however too brittle. lfutil.copyandhash
closes the infile after writing to it ... with a 'blecch' comment. The discard
was thus a silent noop, and as a result of that corruption would be detected
... and then the corrupted files would be used anyway.

Instead we now use a tmp file and rename or unlink it after validating it.

A better solution should be implemented ... but not now.
2013-01-28 15:19:44 +01:00
Wagner Bruna
30efeaefbe largefiles: enhance error message to make it more i18n-friendly 2013-01-21 13:42:04 -02:00
Mads Kiilerich
1f565a1b35 largefiles: docstrings for verify methods 2013-02-08 13:08:25 +01:00
Mads Kiilerich
e9a72ba5f1 largefiles: fold oddly named _verify into remotestore.exists 2013-02-08 13:00:08 +01:00
Mads Kiilerich
7251dc2f89 largefiles: verify status should be written as status, not as write
Make 'hg verify --large -q' quiet when no errors.
2013-02-04 02:46:53 +01:00
Mads Kiilerich
9302004c43 largefiles: cleanup of warnings on errors getting largefiles
Especially the "no default or default-push path set in hgrc" was often very
misleading and didn't give any hint where it actually was looking.

A long error messages is better than several multi-line messages.
2012-12-13 19:19:06 +01:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Na'Tosha Bard
1ffeefa9fa largefiles: batch statlfile requests when pushing a largefiles repo (issue3386)
This implements a part of issue 3386.  It batches the request for the status of
all largefiles in the revisions that are about to be pushed into a single
request, instead of doing N separate requests.

In a real world test case, this change was verified to save 1,116 round-trips to
the server.  It only requires a client-side change; it is backwards-compatible
with an older version of the server.
2012-06-24 20:36:22 +02:00
Na'Tosha Bard
65205ee295 largefiles: remove use of underscores that breaks coding convention 2012-03-09 16:11:52 +01:00
Martin Geisler
61a444869a largefiles: respect store.createmode in basestore.get
This replaces another use of tempfile with atomictempfile. The problem
with tempfile is that it creates files with 600 permissions instead of
respecting repo.store.createmode.
2012-02-23 13:37:10 +01:00
Na'Tosha Bard
77c6b2a6a2 largefiles: fix caching largefiles from an aliased repo (issue3212) 2012-01-20 11:56:12 +01:00
Benjamin Pollack
164bde4288 largefiles: remove redundant any_ function 2011-10-19 20:40:55 -04:00
Benjamin Pollack
417391117f largefiles: rename functions and methods to match desired behavior
The original intent was that the largefiles would primarily be in the
repository, with the global cache being only that--a cache.  The naming
conventions and actual intent have both strayed.  In this first patch, the
naming conventions are switched to match the actual intent, as are the
configuration options.
2011-10-20 13:24:09 -04:00
Hao Lian
e500c9817f largefiles: string formatting typo in basestore._openstore where comma is used instead of modulo 2011-10-18 17:09:03 -04:00
Greg Ward
9201e11906 largefiles: cosmetics, whitespace, code style
This is mainly about keeping code under the 80-column limit with as
few backslashes as possible. I am deliberately not making any logic or
behaviour changes here and have restrained myself to a few "peephole"
refactorings.
2011-10-13 21:42:54 -04:00
Greg Ward
8b7a685468 largefiles: improve error reporting
- tweak wording of some error messages
- use consistent capitalization
- always say 'largefile', not 'lfile'
- fix I18N problems
- only raise Abort for errors the user can do something about
2011-10-13 20:24:29 -04:00
Greg Ward
5f73b6d815 largefiles: improve comments, internal docstrings
- fix some ungrammatical/unclear/incorrect comments/docstrings
- rewrite some really unclear comments/docstrings
- make formatting/style more consistent with the rest of Mercurial
  (lowercase without period unless it's really multiple sentences)
- wrap to 75 columns
- always say "largefile(s)", not "lfile(s)" (or "big files")
- one space between sentences, not two
2011-10-12 20:59:27 -04:00
Matt Mackall
4a1439d51a largefile: fix up hasattr usage 2011-09-29 16:48:48 -05:00
various
88e172f652 hgext: add largefiles extension
This code has a number of contributors and a complicated history prior to its
introduction that can be seen by visiting:

https://developers.kilnhg.com/Repo/Kiln/largefiles/largefiles
http://hg.gerg.ca/hg-bfiles

and looking at the included copyright notices and contributors list.
2011-09-24 17:35:45 +02:00