@@ -1770,7 +1770,7 @@ function is_package_downloaded(ctx, pkg::PackageSpec)
17701770end
17711771
17721772function print_status (ctx:: Context , old_ctx:: Union{Nothing,Context} , header:: Symbol ,
1773- uuids:: Vector , names:: Vector ; manifest= true , diff= false )
1773+ uuids:: Vector , names:: Vector ; manifest= true , diff= false , ignore_indent = false )
17741774 not_installed_indicator = sprint ((io, args) -> printstyled (io, args... ; color= :red ), " →" , context= ctx. io)
17751775 ctx. io = something (ctx. status_io, ctx. io) # for instrumenting tests
17761776 filter = ! isempty (uuids) || ! isempty (names)
@@ -1779,22 +1779,22 @@ function print_status(ctx::Context, old_ctx::Union{Nothing,Context}, header::Sym
17791779 # filter and return early if possible
17801780 if isempty (xs) && ! diff
17811781 printpkgstyle (ctx, header, " $(pathrepr (manifest ? ctx. env. manifest_file : ctx. env. project_file)) (empty " *
1782- (manifest ? " manifest" : " project" ) * " )" , true )
1782+ (manifest ? " manifest" : " project" ) * " )" , ignore_indent )
17831783 return nothing
17841784 end
17851785 xs = ! diff ? xs : eltype (xs)[(id, old, new) for (id, old, new) in xs if old != new]
17861786 if isempty (xs)
1787- printpkgstyle (ctx, Symbol (" No Changes" ), " to $(pathrepr (manifest ? ctx. env. manifest_file : ctx. env. project_file)) " , true )
1787+ printpkgstyle (ctx, Symbol (" No Changes" ), " to $(pathrepr (manifest ? ctx. env. manifest_file : ctx. env. project_file)) " , ignore_indent )
17881788 return nothing
17891789 end
17901790 xs = ! filter ? xs : eltype (xs)[(id, old, new) for (id, old, new) in xs if (id in uuids || something (new, old). name in names)]
17911791 if isempty (xs)
17921792 printpkgstyle (ctx, Symbol (" No Matches" ),
1793- " in $(diff ? " diff for " : " " )$(pathrepr (manifest ? ctx. env. manifest_file : ctx. env. project_file)) " , true )
1793+ " in $(diff ? " diff for " : " " )$(pathrepr (manifest ? ctx. env. manifest_file : ctx. env. project_file)) " , ignore_indent )
17941794 return nothing
17951795 end
17961796 # main print
1797- printpkgstyle (ctx, header, pathrepr (manifest ? ctx. env. manifest_file : ctx. env. project_file), true )
1797+ printpkgstyle (ctx, header, pathrepr (manifest ? ctx. env. manifest_file : ctx. env. project_file), ignore_indent )
17981798 # Sort stdlibs and _jlls towards the end in status output
17991799 xs = sort! (xs, by = (x -> (is_stdlib (x[1 ]), endswith (something (x[3 ], x[2 ]). name, " _jll" ), something (x[3 ], x[2 ]). name, x[1 ])))
18001800 all_packages_downloaded = true
@@ -1810,7 +1810,7 @@ function print_status(ctx::Context, old_ctx::Union{Nothing,Context}, header::Sym
18101810 println (ctx. io)
18111811 end
18121812 if ! all_packages_downloaded
1813- printpkgstyle (ctx, :Info , " packages marked with $not_installed_indicator not downloaded, use `instantiate` to download" , true )
1813+ printpkgstyle (ctx, :Info , " packages marked with $not_installed_indicator not downloaded, use `instantiate` to download" , ignore_indent )
18141814 end
18151815 return nothing
18161816end
@@ -1832,21 +1832,20 @@ function git_head_context(ctx, project_dir)
18321832 end
18331833end
18341834
1835- function show_update (ctx:: Context )
1835+ function show_update (ctx:: Context ; ignore_indent = false )
18361836 old_env = EnvCache ()
18371837 old_env. project = ctx. env. original_project
18381838 old_env. manifest = ctx. env. original_manifest
1839- status (ctx; header= :Updating , mode= PKGMODE_COMBINED, env_diff= old_env)
1839+ status (ctx; header= :Updating , mode= PKGMODE_COMBINED, env_diff= old_env, ignore_indent = ignore_indent )
18401840 return nothing
18411841end
18421842
18431843function status (ctx:: Context , pkgs:: Vector{PackageSpec} = PackageSpec[];
1844- header= nothing , mode:: PackageMode = PKGMODE_PROJECT, git_diff:: Bool = false , env_diff= nothing )
1844+ header= nothing , mode:: PackageMode = PKGMODE_PROJECT, git_diff:: Bool = false , env_diff= nothing , ignore_indent = false )
18451845 ctx. io == Base. devnull && return
18461846 # if a package, print header
18471847 if header === nothing && ctx. env. pkg != = nothing
1848- printstyled (ctx. io, " Project " ; color= Base. info_color (), bold= true )
1849- println (ctx. io, ctx. env. pkg. name, " v" , ctx. env. pkg. version)
1848+ printpkgstyle (ctx. io, :Project , string (ctx. env. pkg. name, " v" , ctx. env. pkg. version); color= Base. info_color ())
18501849 end
18511850 # load old ctx
18521851 old_ctx = nothing
@@ -1869,10 +1868,10 @@ function status(ctx::Context, pkgs::Vector{PackageSpec}=PackageSpec[];
18691868 diff = old_ctx != = nothing
18701869 header = something (header, diff ? :Diff : :Status )
18711870 if mode == PKGMODE_PROJECT || mode == PKGMODE_COMBINED
1872- print_status (ctx, old_ctx, header, filter_uuids, filter_names; manifest= false , diff= diff)
1871+ print_status (ctx, old_ctx, header, filter_uuids, filter_names; manifest= false , diff= diff, ignore_indent = ignore_indent )
18731872 end
18741873 if mode == PKGMODE_MANIFEST || mode == PKGMODE_COMBINED
1875- print_status (ctx, old_ctx, header, filter_uuids, filter_names; diff= diff)
1874+ print_status (ctx, old_ctx, header, filter_uuids, filter_names; diff= diff, ignore_indent = ignore_indent )
18761875 end
18771876end
18781877
0 commit comments