Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2009-04-24 17:51:52 +0000
committerddunne2009-04-24 17:51:52 +0000
commitd217f3179eedca9eccd05f28ff9fb34484a93059 (patch)
treeff8229c809e0a5b0db11e50e5c366e83b96aea55 /org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
parent5cd391e51cc64b1c5ef4e6c1343f0ebae34db67c (diff)
downloadorg.eclipse.osee-d217f3179eedca9eccd05f28ff9fb34484a93059.tar.gz
org.eclipse.osee-d217f3179eedca9eccd05f28ff9fb34484a93059.tar.xz
org.eclipse.osee-d217f3179eedca9eccd05f28ff9fb34484a93059.zip
Multi-branch task gen
Diffstat (limited to 'org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java')
-rw-r--r--org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java34
1 files changed, 29 insertions, 5 deletions
diff --git a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
index caff560ef92..89d9e35e41c 100644
--- a/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
+++ b/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
@@ -47,6 +47,7 @@ import org.eclipse.osee.ats.workflow.item.AtsAddDecisionReviewRule.DecisionRuleO
import org.eclipse.osee.framework.db.connection.exception.BranchDoesNotExist;
import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
import org.eclipse.osee.framework.db.connection.exception.MultipleBranchesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
import org.eclipse.osee.framework.db.connection.exception.TransactionDoesNotExist;
@@ -386,7 +387,7 @@ public class AtsBranchManager {
return getWorkingBranch(includeArchived) != null;
}
- public Collection<ICommitConfigArtifact> getConfigArtifactsToCommitTo() throws OseeCoreException {
+ public Collection<ICommitConfigArtifact> getConfigArtifactsConfiguredToCommitTo() throws OseeCoreException {
Set<ICommitConfigArtifact> configObjects = new HashSet<ICommitConfigArtifact>();
if (smaMgr.isTeamUsesVersions()) {
if (smaMgr.getTargetedForVersion() != null) {
@@ -401,7 +402,7 @@ public class AtsBranchManager {
}
public boolean isAllObjectsToCommitToConfigured() throws OseeCoreException {
- return getConfigArtifactsToCommitTo().size() == getBranchesToCommitTo().size();
+ return getConfigArtifactsConfiguredToCommitTo().size() == getBranchesToCommitTo().size();
}
public Collection<Branch> getBranchesLeftToCommit() throws OseeCoreException {
@@ -417,7 +418,7 @@ public class AtsBranchManager {
public Collection<Branch> getBranchesToCommitTo() throws OseeCoreException {
Set<Branch> branches = new HashSet<Branch>();
- for (Object obj : getConfigArtifactsToCommitTo()) {
+ for (Object obj : getConfigArtifactsConfiguredToCommitTo()) {
if ((obj instanceof VersionArtifact) && ((VersionArtifact) obj).getParentBranch() != null) {
branches.add(((VersionArtifact) obj).getParentBranch());
} else if ((obj instanceof TeamDefinitionArtifact) && ((TeamDefinitionArtifact) obj).getParentBranch() != null) {
@@ -730,12 +731,35 @@ public class AtsBranchManager {
private static final Map<TransactionId, ChangeData> changeDataCacheForCommittedBranch =
new HashMap<TransactionId, ChangeData>();
- public ChangeData getChangeData() throws OseeCoreException {
+ public ChangeData getChangeDataFromEarliestTransactionId() throws OseeCoreException {
+ return getChangeData(null);
+ }
+
+ /**
+ * Return ChangeData represented by commit to commitConfigArt or earliest commit if commitConfigArt == null
+ *
+ * @param commitConfigArt that configures commit or null
+ * @return ChangeData
+ * @throws OseeCoreException
+ */
+ public ChangeData getChangeData(ICommitConfigArtifact commitConfigArt) throws OseeCoreException {
+ if (commitConfigArt != null && commitConfigArt.getParentBranch() == null) {
+ throw new OseeArgumentException("Parent Branch not configured for " + commitConfigArt);
+ }
ChangeData changeData = null;
if (smaMgr.getBranchMgr().isWorkingBranch()) {
changeData = ChangeManager.getChangeDataPerBranch(getWorkingBranch(), null);
} else if (smaMgr.getBranchMgr().isCommittedBranchExists()) {
- TransactionId transactionId = getEarliestTransactionId();
+ TransactionId transactionId = null;
+ if (commitConfigArt == null) {
+ transactionId = getEarliestTransactionId();
+ } else {
+ for (TransactionId transId : getTransactionIds(false)) {
+ if (transId.getBranch() == commitConfigArt.getParentBranch()) {
+ transactionId = transId;
+ }
+ }
+ }
if (changeDataCacheForCommittedBranch.get(transactionId) == null) {
changeDataCacheForCommittedBranch.put(transactionId, ChangeManager.getChangeDataPerTransaction(
transactionId, null));

Back to the top