From eba7a4c7dc14594aec3b805a6a431816598651fe Mon Sep 17 00:00:00 2001 From: Andrew Oberstar Date: Thu, 18 Aug 2022 20:09:36 -0500 Subject: [PATCH] Only use parallel version avoidance for significants Only if reckoning a significant version should we try to avoid version numbers tagged on parallel branches. This is in line with our existing documented axioms (which focused on two TAGGED parallel versions). What this helps with is feature branches where you aren't intending to make a release, and there's more benefit to having the version logically related to what the history of the branch is, rather than assuming the feature branch will eventually conflict and try to eagerly avoid the existing parallel version. --- .../src/main/java/org/ajoberstar/reckon/core/Reckoner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reckon-core/src/main/java/org/ajoberstar/reckon/core/Reckoner.java b/reckon-core/src/main/java/org/ajoberstar/reckon/core/Reckoner.java index e2f0bec..a6ffcc3 100644 --- a/reckon-core/src/main/java/org/ajoberstar/reckon/core/Reckoner.java +++ b/reckon-core/src/main/java/org/ajoberstar/reckon/core/Reckoner.java @@ -92,9 +92,10 @@ private Version reckonNormal(VcsInventory inventory) { } var targetNormal = inventory.getBaseNormal().incrementNormal(scope); + var probableStage = stageCalc.calculate(inventory, targetNormal); // if a version's already being developed on a parallel branch we'll skip it - if (inventory.getParallelNormals().contains(targetNormal)) { + if (inventory.getParallelNormals().contains(targetNormal) && probableStage.isPresent()) { if (scope.compareTo(parallelBranchScope) < 0) { logger.debug("Skipping {} as it's being developed on a parallel branch. While {} was requested, parallel branches claim a {}, using that instead.", scope, parallelBranchScope); targetNormal = targetNormal.incrementNormal(parallelBranchScope);