Skip to content

Commit

Permalink
0.7.2: fixes #115
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Feb 29, 2020
1 parent 31f6650 commit 1907c3c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nimph.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.7.1"
version = "0.7.2"
author = "disruptek"
description = "nim package handler from the future"
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/nimph/dependency.nim
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ proc happyProvision(requirement: Requirement; release: Release;
let
required = releaseHashes(req.release, head = head)
block matched:
for viable, thing in tags.matches(required):
for viable, thing in tags.matches(required, head = head):
# the requirement is a tag, so we simply compare the
# matches for the requirement against the provided release
# and a release composed of each match's commit hash
Expand All @@ -202,7 +202,7 @@ proc happyProvision(requirement: Requirement; release: Release;
let
provided = releaseHashes(release, head = head)
block matched:
for viable, thing in tags.matches(provided):
for viable, thing in tags.matches(provided, head = head):
if req.isSatisfiedBy(viable):
break matched
break failed
Expand Down
7 changes: 5 additions & 2 deletions src/nimph/versiontags.nim
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ proc releaseHashes*(release: Release; head = ""): HashSet[Hash] =
# perform the #head->oid substitution here
if release.reference.toLowerAscii == "head" and head != "":
result.incl head.hash
result.incl "head".hash
result.incl "HEAD".hash
of Wildlings:
# 3, 3.1, 3.1.4 ... as available
let effective = release.accepts.effectively
Expand All @@ -110,15 +112,16 @@ proc releaseHashes*(release: Release; thing: GitThing; head = ""): HashSet[Hash]
result.incl hash(thing)
result.incl hash($thing.oid)

iterator matches*(tags: GitTagTable; against: HashSet[Hash]):
iterator matches*(tags: GitTagTable; against: HashSet[Hash];
head: string = ""):
tuple[release: Release; thing: GitThing] =
## see if any of the releases in the tag table will match `against`
## if so, yield the release and thing
if tags == nil:
raise newException(Defect, "are you lost?")
for release, thing in tags.richen:
# compute hashes to match against
var symbols = release.releaseHashes(thing)
var symbols = release.releaseHashes(thing, head = head)
# see if we scored any matches
if against.intersection(symbols).len != 0:
yield (release: release, thing: thing)

0 comments on commit 1907c3c

Please sign in to comment.