Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-04-05 14:07:50 -0500
committerMichael Valenta2002-04-05 14:07:50 -0500
commit147f7e8a068b3f6d17cd3610c0ddd4f34dd1017c (patch)
tree7601cae6e1d0bb2c3223ddfee0a96b9745b9681a
parent770c72dec587bc390d892881e04ac6540143847e (diff)
downloadeclipse.platform.team-147f7e8a068b3f6d17cd3610c0ddd4f34dd1017c.tar.gz
eclipse.platform.team-147f7e8a068b3f6d17cd3610c0ddd4f34dd1017c.tar.xz
eclipse.platform.team-147f7e8a068b3f6d17cd3610c0ddd4f34dd1017c.zip
8504: Tags not showing up in history.
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java31
1 files changed, 17 insertions, 14 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
index 80d772024..357bb70b7 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
@@ -98,12 +98,10 @@ public class LogListener implements ICommandOutputListener {
// that is the root of this branch (e.g. 1.1 is root of branch 1.1.2).
boolean isBranch = isBranchTag(tagRevision);
if (isBranch) {
- int zeroIndex = tagRevision.lastIndexOf('0');
- int lastDot = -1;
- if (zeroIndex != -1)
- lastDot = zeroIndex - 1;
- else
- lastDot = tagRevision.lastIndexOf('.');
+ int lastDot = tagRevision.lastIndexOf('.');
+ if (tagRevision.charAt(lastDot - 1) == '0' && tagRevision.charAt(lastDot - 2) == '.') {
+ lastDot = lastDot - 2;
+ }
tagRevision = tagRevision.substring(0, lastDot);
}
if (tagRevision.equals(revision)) {
@@ -130,15 +128,20 @@ public class LogListener implements ICommandOutputListener {
* an even number with a zero as the second last segment
* e.g: 1.1.1, 1.26.0.2 are branch revision numbers */
protected boolean isBranchTag(String tagName) {
- int numberOfSegments = 0;
- boolean isBranch = false;
+ // First check if we have an odd number of segments (i.e. even number of dots)
+ int numberOfDots = 0;
+ int lastDot = 0;
for (int i = 0; i < tagName.length(); i++) {
- if (tagName.charAt(i) == '.')
- numberOfSegments++;
+ if (tagName.charAt(i) == '.') {
+ numberOfDots++;
+ lastDot = i;
+ }
}
- isBranch = (numberOfSegments % 2) == 0;
- if (!isBranch && tagName.lastIndexOf('0') != -1)
- isBranch = true;
- return isBranch;
+ if ((numberOfDots % 2) == 0) return true;
+ if (numberOfDots == 1) return false;
+
+ // If not, check if the second lat segment is a zero
+ if (tagName.charAt(lastDot - 1) == '0' && tagName.charAt(lastDot - 2) == '.') return true;
+ return false;
}
}

Back to the top