[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Subclipse-users] Bugs in svnant / WcVersion - wrong code for mixed revision

From: Przemysław Sztoch <psztoch_at_finn.pl>
Date: Tue, 01 Jul 2008 22:52:27 +0200

Hello!

There is a bug in revision calculation in WcVersion.
Please, apply attached patch.
IMO there is time for svnant RC3.

-- 
Przemyslaw Sztoch <psztoch!at!finn.pl>
LTC Sp. z o.o.
http://www.finn.pl

Index: build.xml
===================================================================
--- build.xml (revision 3899)
+++ build.xml (working copy)
@@ -12,7 +12,7 @@
         <!-- ================================================================= -->
 
         <!-- svnant version -->
- <property name="svnant.version" value="1.1.0-RC2" />
+ <property name="svnant.version" value="1.1.0-RC3" />
 
         <!-- compile with debug on or off -->
         <property name="debug" value="off" />
Index: src/main/org/tigris/subversion/svnant/commands/WcVersion.java
===================================================================
--- src/main/org/tigris/subversion/svnant/commands/WcVersion.java (revision 3899)
+++ src/main/org/tigris/subversion/svnant/commands/WcVersion.java (working copy)
@@ -176,25 +176,25 @@
     }
     
     /**
- * @return Returns whether unversioned resources should be processed.
- */
- public boolean getProcessUnversioned() {
- return processUnversioned;
- }
+ * @return Returns whether unversioned resources should be processed.
+ */
+ public boolean getProcessUnversioned() {
+ return processUnversioned;
+ }
 
- /**
- * @param processUnversioned
- * Whether unversioned resources should be processed.
- */
- public void setProcessUnversioned(boolean processUnversioned) {
- this.processUnversioned = processUnversioned;
- }
+ /**
+ * @param processUnversioned
+ * Whether unversioned resources should be processed.
+ */
+ public void setProcessUnversioned(boolean processUnversioned) {
+ this.processUnversioned = processUnversioned;
+ }
     
     /**
- * Holds summary status information about a working copy path.
- *
- * @author Matt Doran (matt.doran_at_papercut.biz)
- */
+ * Holds summary status information about a working copy path.
+ *
+ * @author Matt Doran (matt.doran_at_papercut.biz)
+ */
     private static class WCVersionSummary {
         protected String wcPath;
         protected long maxRevision = 0;
@@ -226,39 +226,43 @@
                 ISVNStatus status = statuses[i];
                 
                 if (!SVNStatusUtils.isManaged(status) && !processUnversioned) {
- // Don't care about unversioned files
+ // Don't care about unversioned files
                     continue;
                 }
                 
                 if (!this.hasModified
- && ((status.getTextStatus() != SVNStatusKind.NORMAL
- && status.getTextStatus() != SVNStatusKind.IGNORED)
- || (status.getPropStatus() != SVNStatusKind.NORMAL
- && status.getPropStatus() != SVNStatusKind.NONE))) {
- this.hasModified = true;
+ && ((status.getTextStatus() != SVNStatusKind.NORMAL
+ && status.getTextStatus() != SVNStatusKind.IGNORED)
+ || (status.getPropStatus() != SVNStatusKind.NORMAL
+ && status.getPropStatus() != SVNStatusKind.NONE))) {
+ this.hasModified = true;
                 }
                 
                 if (SVNStatusUtils.isManaged(status)) {
- SVNRevision.Number rev = status.getLastChangedRevision();
- long revNum = (rev != null) ? rev.getNumber() : 0;
- if (revNum > this.maxRevision) {
- this.maxRevision = revNum;
- }
-
- if (revNum < this.minRevision) {
- this.minRevision = revNum;
- }
+ SVNRevision.Number rev = status.getRevision();
 
- SVNRevision.Number comRev = status.getLastChangedRevision();
- long committedRev = (comRev != null) ? comRev.getNumber() : 0;
- if (committedRev > this.maxCommitted) {
- this.maxCommitted = committedRev;
- }
- }
+ if (rev != null) {
+ long revNum = rev.getNumber();
+ if (revNum > this.maxRevision) {
+ this.maxRevision = revNum;
+ }
+ if (revNum < this.minRevision || this.minRevision == 0) {
+ this.minRevision = revNum;
+ }
+ }
+
+ SVNRevision.Number comRev = status.getLastChangedRevision();
+ if (comRev != null) {
+ long committedRev = comRev.getNumber();
+ if (committedRev > this.maxCommitted) {
+ this.maxCommitted = committedRev;
+ }
+ }
+ }
             }
             
             if ((this.minRevision > 0) && (this.minRevision != this.maxRevision)) {
- this.hasMixed = true;
+ this.hasMixed = true;
             }
         }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subclipse.tigris.org
For additional commands, e-mail: users-help_at_subclipse.tigris.org
Received on 2008-07-01 22:57:37 CEST

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.