Commit Graph

9 Commits

Author SHA1 Message Date
Sonia Kim
7ef1e18d89 lfs: include filename in object lookup fail message
Summary: Object lookup fails in blobstore provided vague error message when a specific file was not present. Updating error message to reference the filename associated with the blob not found.

Test Plan:
In facebook-hg-rpms/fb-hgext/tests directory:  rt test-lfs-test-server.t
Shows no error and validates that correct error message is displayed

Reviewers: quark, rainee, davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5617283

Tasks: T18972111

Signature: t1:5617283:1503070630:56fdcab5295ce7d050a24f1a989806066ef7054f
2017-08-22 10:54:41 -07:00
Jun Wu
f532dddaa4 lfs: implement byte-level progress bar
Summary:
Previously, the progress bar is file-level - it moves when a file is transferred.

When uploading or downloading a single giant file, progress bar matters. And
this diff adds it to make people more patient.

Test Plan:
Manually upload and download several big files.
Make sure the progress bar appears in both cases.

Also make sure the output is sane with `-v`.

Reviewers: #mercurial, davidsp, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5100014

Signature: t1:5100014:1495316719:c500ccd63d3a495e41575cadd72419a41f5fb259
2017-05-22 11:03:14 -07:00
Jun Wu
9eedb98b61 lfs: downgrade "computing set of blobs to upload" to debug message
Summary:
Calculating what blobs to upload should be fast since we use changelog `files`
information. Users will see `lfs: uploading ...` very soon. So let's downgrade
`lfs: computing set of blobs to upload` to a debug message to make `-v`
cleaner.

Test Plan: Updated existing test.

Reviewers: davidsp, #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5066600

Signature: t1:5066600:1494954115:c00925a1930f9b53e914078d32b6c4e4161099ee
2017-05-16 15:27:25 -07:00
Jun Wu
ae541c9f80 lfs: show status per object when ui.verbose is set
Summary:
Downloading or uploading a single LFS object could take long. Instead of
showing a summary of what objects are downloaded or uploaded, print a message
per object if --verbose is provided.

Test Plan: Added a test

Reviewers: davidsp, #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5066327

Signature: t1:5066327:1494953894:3593436ff53eaff117a2932476dfc4b867fb9f17
2017-05-16 15:24:04 -07:00
Jun Wu
28de141267 lfs: handle "wrong action" error earlier
Summary:
Previously, when an object is not found server-side, we error out during the
basic transfer API. This diffs move the check to the batch metadata API so the
check is preformed earlier.

That also means, when batch fetching many LFS objects, we could report multiple
objects being missing instead of just one.

Test Plan: Modified an existing test

Reviewers: davidsp, #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5065623

Signature: t1:5065623:1494952131:cb1df73e1cea21e07bfd0ec630bacec60e5b385c
2017-05-16 15:19:40 -07:00
Jun Wu
d5a9c91ff9 lfs: move batch API to a separate method
Summary:
The LFS uploading or downloading process consists of 2 parts: a batch API to
get metadata about objects, followed by `len(objects)` requests.

This diff moves the first metadata API out from a giant `_batch` method to
make the code structure easier to maintain. Later diffs will further split
`_batch` method.

A side effect is `lfs: mapping blobs to #{action} URLs` message is removed.
More user-friendly message will be added back in a later patch.

Reviewers: #mercurial, davidsp, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5057541

Signature: t1:5057541:1494949989:d510c3d9369744e7ee776c0d0a26d263dfaf8352
2017-05-16 12:24:20 -07:00
Jun Wu
31882a9791 lfs: remove total parameters from remote store APIs
Summary:
Displaying total bytes to upload is currently inaccurate - the server could
already have some objects so only a subset of selected objects will be
uploaded.

Besides, we pass `pointers` to related upload and download APIs so `total`
could be calculated from them.

This diff removes the inaccurate "need to upload" message and unnecessary
parameters. An accurate message will be added in a later patch.

Reviewers: #mercurial, davidsp, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5057470

Signature: t1:5057470:1494949554:07e637a8b58c894598b3f0c2dd53f80a5ade25a8
2017-05-16 11:19:39 -07:00
Jun Wu
d5e501b573 lfs: provide more detailed message on network error
Summary:
The server or the HTTP library may provide more detailed error message.
Let's use them. `RequestFailedError` is also renamed to `LfsRemoteError` to
make it clear it's related to LFS and network.

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5057014

Signature: t1:5057014:1494634052:00c1cb1b337a0e4cb92828cd49e95b7b0ff7e540
2017-05-12 17:22:02 -07:00
Jun Wu
67f97aa1d3 lfs: add an integration test with lfs-test-server
Summary:
lfs-test-server is a reference implementation by GitHub [1]. Testing against it
will give us more confidence.

[1]: https://github.com/git-lfs/lfs-test-server

Test Plan: Added a test

Reviewers: #mercurial, davidsp

Reviewed By: davidsp

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5009346

Signature: t1:5009346:1494042196:86e8c2e0e5c4296b1afc72efa84a9c1b9030e6fc
2017-05-08 11:13:12 -07:00