Skip to content

Commit

Permalink
0.6.1: fix unlock bug with oids
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Dec 22, 2019
1 parent ddf3dc0 commit 309da98
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 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.6.0"
version = "0.6.1"
author = "disruptek"
description = "nim package handler from the future"
license = "MIT"
Expand Down
36 changes: 18 additions & 18 deletions src/nimph/dependency.nim
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ proc happyProvision(requirement: Requirement; release: Release;
required = releaseHashes(req.release, head = head)
block matched:
for viable, thing in tags.matches(required):
# the release may be a viable match for the requirement,
# which we've already established is a tag
if viable == release:
# 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
let candidate = newRelease($thing.oid, operator = Tag)
if release in [viable, candidate]:
break matched
break failed
elif not req.isSatisfiedBy(release):
Expand All @@ -199,27 +201,25 @@ proc happyProvision(requirement: Requirement; release: Release;
iterator matchingReleases(requirement: Requirement; head = "";
tags: GitTagTable): Release =
## yield releases that satisfy the requirement, using the head and tags
# we need to keep track if we've seen the head oid, because
# we don't want to issue it twice
var
sawTheHead = false

if tags != nil:
# we need to keep track if we've seen the head oid, because
# we don't want to issue it twice
var
sawTheHead = false

if tags != nil:
for tag, thing in tags.pairs:
let
release = newRelease($thing.oid, operator = Tag)
if requirement.happyProvision(release, head = head, tags = tags):
sawTheHead = sawTheHead or $thing.oid == head
yield release

if head != "" and not sawTheHead:
for tag, thing in tags.pairs:
let
release = newRelease(head, operator = Tag)
release = newRelease($thing.oid, operator = Tag)
if requirement.happyProvision(release, head = head, tags = tags):
sawTheHead = sawTheHead or $thing.oid == head
yield release

if head != "" and not sawTheHead:
let
release = newRelease(head, operator = Tag)
if requirement.happyProvision(release, head = head, tags = tags):
yield release

iterator symbolicMatch*(project: Project; req: Requirement): Release =
## see if a project can match a given requirement symbolically
if project.dist == Git:
Expand Down

0 comments on commit 309da98

Please sign in to comment.