Skip to content

Commit

Permalink
changes to work with new loading stuff + more deprecation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Feb 7, 2018
1 parent e675858 commit 3c0c9e2
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
7 changes: 7 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ name = "Pkg3"
repo = "https://github.com/StefanKarpinski/Pkg3.jl.git"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
3 changes: 2 additions & 1 deletion src/API.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module API

import Base.UUID
using UUIDs
using Printf
import Random
import Dates
import LibGit2

import Pkg3
import Pkg3: depots, logdir, Display.DiffEntry
Expand Down
11 changes: 6 additions & 5 deletions src/Display.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Display

import Base: UUID
using UUIDs
import LibGit2

using Pkg3.Types
import Pkg3: @info, Nothing
Expand Down Expand Up @@ -60,7 +61,7 @@ function print_project_diff(env₀::EnvCache, env₁::EnvCache)
pm₁ = filter_manifest(in_project(env₁.project["deps"]), env₁.manifest)
diff = filter!(x->x.old != x.new, manifest_diff(pm₀, pm₁))
if isempty(diff)
print_with_color(color_dark, " [no changes]\n")
printstyled(color = color_dark, " [no changes]\n")
else
print_diff(diff)
end
Expand All @@ -70,7 +71,7 @@ function print_manifest_diff(env₀::EnvCache, env₁::EnvCache)
diff = manifest_diff(env₀.manifest, env₁.manifest)
diff = filter!(x->x.old != x.new, diff)
if isempty(diff)
print_with_color(color_dark, " [no changes]\n")
printstyled(color = color_dark, " [no changes]\n")
else
print_diff(diff)
end
Expand Down Expand Up @@ -131,8 +132,8 @@ function print_diff(io::IO, diff::Vector{DiffEntry})
vstr = "[unknown]"
end
v = same ? "" : " $verb"
print_with_color(color_dark, " [$(string(x.uuid)[1:8])]")
print_with_color(colors[verb], "$v $(x.name) $vstr\n")
printstyled(color = color_dark, " [$(string(x.uuid)[1:8])]")
printstyled(color = colors[verb], "$v $(x.name) $vstr\n")
end
end
print_diff(diff::Vector{DiffEntry}) = print_diff(STDOUT, diff)
Expand Down
7 changes: 4 additions & 3 deletions src/Operations.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
module Operations

import Random: UUID, randstring
using Base.LibGit2
using UUIDs
using Random: randstring
import LibGit2

using Pkg3.TerminalMenus
using Pkg3.Types
using Pkg3.GraphType
using Pkg3.Resolve

import Pkg3: GLOBAL_SETTINGS, depots, BinaryProvider, @info, Nothing
import Pkg3.Types: uuid_julia


const SlugInt = UInt32 # max p = 4
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
const nchars = SlugInt(length(chars))
Expand Down
6 changes: 3 additions & 3 deletions src/REPLMode.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module REPLMode

using Base.Markdown
import Base.UUID
using Markdown
using UUIDs

import REPL
import REPL: LineEdit, REPLCompletions
Expand Down Expand Up @@ -165,7 +165,7 @@ function do_preview!(tokens, repl)
do_cmd!(tokens, repl, preview = true)
end

const help = Base.Markdown.parse("""
const help = Markdown.parse("""
**Synopsis**
pkg> [--env=...] cmd [opts] [args]
Expand Down
5 changes: 3 additions & 2 deletions src/Types.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module Types

import Base: UUID
using UUIDs
using Random
using Dates
import LibGit2

using Pkg3.TOML
using Pkg3.TerminalMenus
Expand Down Expand Up @@ -338,7 +339,7 @@ cmderror(msg::String...) = throw(CommandError(join(msg)))

Base.showerror(io::IO, ex::CommandError) = showerror(io, ex, [])
function Base.showerror(io::IO, ex::CommandError, bt; backtrace=true)
print_with_color(Base.error_color(), io, string(ex.msg))
printstyled(color = Base.error_color(), io, string(ex.msg))
end

## type for expressing operations ##
Expand Down

0 comments on commit 3c0c9e2

Please sign in to comment.