New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
annexrepo: Tell caller that annex is scanning for unlocked files #4316
Conversation
WitlessProtocol calls getpreferredencoding() twice in _prepare_result(). Let's instead store the value as an attribute because, as is already the case with the GitProgress protocol, it's likely that child classes that work with the output will need this.
074c283
to
91822d7
Compare
thank you @kyleam - from a quick look seems to be LGTM. I've not tried yet though |
My added test fails on Travis. |
91822d7
to
f81d146
Compare
Codecov Report
@@ Coverage Diff @@
## master #4316 +/- ##
==========================================
- Coverage 88.83% 88.81% -0.02%
==========================================
Files 285 285
Lines 37457 37485 +28
==========================================
+ Hits 33275 33294 +19
- Misses 4182 4191 +9
Continue to review full report at Codecov.
|
Older git-annex versions were a bit more selective about showing that message. I've changed the test case so that the message is triggered there too. |
_run_annex_command(..., runner="gitwitless") is incompatible with callables for log_stdout and log_stderr, as mentioned in the to-do comment from af082fa (RF: make possible to use GitWitlessRunner in _run_annex_command and use for enable_remote, 2020-02-26). Raise a ValueError in this case.
As of af082fa (2020-02-26), _run_annex_command() callers can specify that GitWitlessRunner should be used instead of Runner. In this case, a protocol class is constructed based on the boolean values of log_std{out,err}. However, in order to do any custom handling of the output (as is done in the next commit), the caller has to be able to specify a custom protocol. Add a `protocol` parameter to _run_annex_command() so that they can do so.
Many _run_annex_command() calls have been switched to using runner="gitwitless". The call in _init() wasn't a candidate because it uses a callable for log_stderr, but now we can achieve the same thing by specifying a custom WitlessProtocol to _run_annex_command().
When init'ing v6+ repos, git-annex scans for unlocked files. This has the potential to take some time, so let the user know what's happening. Suggested-by: Yaroslav Halchenko <debian@onerussian.com>
f81d146
to
47386d4
Compare
@yarikoptic mentioned that
git annex init
could take some time on the "scanning for unlocked files" phase. This series teachesAnnexRepo._run_annex_command
to take a custom protocol and switchesAnnexRepo._init
over to using aWitlessProtocol
that logs this at the info level.Example output: