Skip to content

Commit

Permalink
Display a note when reloading a repository so that users are aware it…
Browse files Browse the repository at this point in the history
… may take some time
  • Loading branch information
kit-ty-kate authored and dra27 committed Jun 9, 2024
1 parent fe46d0c commit eb49b3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ users)
## Update / Upgrade
* [BUG] Stop triggering "Undefined filter variable variable" warning for `?variable` [#5983 @dra27]
* Display extractions in the status bar [#5977 @dra27]
* Display a note when reloading a repository [#5977 @kit-ty-kate]

## Tree
* [BUG] Fix `opam tree --with-*` assigning the `with-*` variables to unrequested packages [#5919 @kit-ty-kate @rjbou - fix #5755]
Expand Down
7 changes: 6 additions & 1 deletion src/state/opamRepositoryState.ml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ module Cache = struct
end

let load_opams_from_dir repo_name repo_root =
if OpamConsole.disp_status_line () || OpamConsole.verbose () then
OpamConsole.status_line "Processing: [%s: loading data]"
(OpamConsole.colorise `blue (OpamRepositoryName.to_string repo_name));
(* FIXME: why is this different from OpamPackage.list ? *)
let rec aux r dir =
if OpamFilename.exists_dir dir then
Expand All @@ -104,7 +107,9 @@ let load_opams_from_dir repo_name repo_root =
r fnames
else r
in
aux OpamPackage.Map.empty (OpamRepositoryPath.packages_dir repo_root)
Fun.protect
(fun () -> aux OpamPackage.Map.empty (OpamRepositoryPath.packages_dir repo_root))
~finally:OpamConsole.clear_status

let load_repo repo repo_root =
let t = OpamConsole.timer () in
Expand Down
1 change: 1 addition & 0 deletions tests/reftests/update.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ opam-version: "2.0"
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
Processing 1/1: [default: rsync]
[default] synchronised from file://${BASEDIR}/REPO
Processing: [default: loading data]
Now run 'opam upgrade' to apply any package updates.

0 comments on commit eb49b3e

Please sign in to comment.