Skip to content

Commit

Permalink
reorganize for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudRoutine committed Nov 23, 2016
1 parent e144fd8 commit 7d99e57
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/Paket.Core/PackageResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -589,38 +589,29 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate
let getVersionsF = getVersionsF currentRequirement.Sources ResolverStrategy.Max groupName
Resolution.Conflict(startingStep,Set.empty,currentRequirement,getVersionsF)

let conflictState : ConflictState = {
Status = status
LastConflictReported = DateTime.Now
TryRelaxed = false
ExploredPackages = Dictionary<PackageName*SemVerInfo,ResolvedPackage>()
VersionsToExplore = Seq.empty
Conflicts = Set.empty
GlobalOverride = false
}

// NOTE - the contents of these collections will be mutated throughout iterations of 'step'
let knownConflicts = HashSet()
let conflictHistory = Dictionary()


let flags =
StepFlags
( ready = false
, useUnlisted = false
, hasUnlisted = false
, forceBreak = false
, firstTrial = true
)

let keepLooping (flags:StepFlags) (conflictState:ConflictState) =
if flags.ForceBreak then false else
if conflictState.Status.IsDone || Seq.isEmpty conflictState.VersionsToExplore then false else
flags.FirstTrial || Set.isEmpty conflictState.Conflicts




let rec step (currentStep:ResolverStep) (flags:StepFlags) =

let conflictState : ConflictState = {
Status = status
LastConflictReported = DateTime.Now
TryRelaxed = false
ExploredPackages = Dictionary<PackageName*SemVerInfo,ResolvedPackage>()
VersionsToExplore = Seq.empty
Conflicts = Set.empty
GlobalOverride = false
}

if Set.isEmpty currentStep.OpenRequirements then
{ conflictState with
Status = Resolution.Ok (cleanupNames currentStep.CurrentResolution)
Expand Down Expand Up @@ -767,6 +758,15 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate
stepLoop flags (Outer conflictState)
// ----------- TERMINATE --------------

let flags =
StepFlags
( ready = false
, useUnlisted = false
, hasUnlisted = false
, forceBreak = false
, firstTrial = true
)

match step startingStep flags with
| { Status = Resolution.Conflict _ } as conflict ->
if conflict.TryRelaxed then
Expand Down

0 comments on commit 7d99e57

Please sign in to comment.