Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1456 - trunk/subclipse/core/src/org/tigris/subversion/subclipse/core/resources

subclipse
Discussion topic

Back to topic list

svn commit: r1456 - trunk/subclipse/core/src/org/tigris/subversion/subclipse/core/resources

Author markphip
Full name Mark Phippard
Date 2005-07-18 07:13:04 PDT
Message Author: markphip
Date: Mon Jul 18 07:13:04 2005
New Revision: 1456

Modified:
   trunk/subclipse/core​/src/org/tigris/subv​ersion/subclipse/cor​e/resources/LocalRes​ourceStatus.java
Log:
LocalResourceStatus was not saving/restoring the lock info to/from the byte
cache.

Issue #: 338


Modified: trunk/subclipse/core​/src/org/tigris/subv​ersion/subclipse/cor​e/resources/LocalRes​ourceStatus.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/trunk/su​bclipse/core/src/org​/tigris/subversion/s​ubclipse/core/resour​ces/LocalResourceSta​tus.java?view=diff​&rev=1456&p1=t​runk/subclipse/core/​src/org/tigris/subve​rsion/subclipse/core​/resources/LocalReso​urceStatus.java&​r1=1455&p2=trunk​/subclipse/core/src/​org/tigris/subversio​n/subclipse/core/res​ources/LocalResource​Status.java&r2=1​456
====================​====================​====================​==================
--- trunk/subclipse/core​/src/org/tigris/subv​ersion/subclipse/cor​e/resources/LocalRes​ourceStatus.java (original)
+++ trunk/subclipse/core​/src/org/tigris/subv​ersion/subclipse/cor​e/resources/LocalRes​ourceStatus.java Mon Jul 18 07:13:04 2005
@@ -48,6 +48,7 @@
     public static LocalResourceStatus NONE = new LocalResourceStatusNone();
     
     private static int FORMAT_VERSION_1 = 1;
+ private static int FORMAT_VERSION_2 = 2;
 
     protected String url;
 
@@ -251,7 +252,7 @@
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         DataOutputStream dos = new DataOutputStream(out);
         try {
- dos.writeInt(FORMAT_VERSION_1);
+ dos.writeInt(FORMAT_VERSION_2);
 
             // url
             if (url == null) {
@@ -315,6 +316,24 @@
             } else {
                 dos.writeUTF(pathCon​flictWorking);
             }
+
+ // lock owner
+ if(lockOwner == null)
+ dos.writeUTF("");
+ else
+ dos.writeUTF(lockOwner);
+
+ // lock creation date
+ dos.writeLong(lockCr​eationDate);
+
+ // lock comment
+ if (lockComment == null)
+ dos.writeUTF("");
+ else
+ dos.writeUTF(lockComment);
+
+ //read only
+ dos.writeBoolean(readOnly);
 
         } catch (IOException e) {
             return null;
@@ -333,7 +352,8 @@
         ByteArrayInputStream in = new ByteArrayInputStream(bytes);
         DataInputStream dis = new DataInputStream(in);
         try {
- if (dis.readInt() != FORMAT_VERSION_1) {
+ int version = dis.readInt();
+ if (version != FORMAT_VERSION_1 && version != FORMAT_VERSION_2) {
                 throw new SVNException("Invalid format");
             }
 
@@ -396,6 +416,22 @@
             pathConflictWorking = dis.readUTF();
             if (pathConflictWorking​.equals(""))
                 pathConflictWorking = null;
+
+ if (version >= FORMAT_VERSION_2) {
+ lockOwner = dis.readUTF();
+ if (lockOwner.equals(""))
+ lockOwner = null;
+ lockCreationDate = dis.readLong();
+ lockComment = dis.readUTF();
+ if (lockComment.equals(""))
+ lockComment = null;
+ readOnly = dis.readBoolean();
+ } else {
+ lockOwner = null;
+ lockCreationDate = 0L;
+ lockComment = null;
+ readOnly = false;
+ }
         } catch (IOException e) {
             throw new SVNException(
                     "cannot create LocalResourceStatus from bytes", e);
@@ -638,7 +674,7 @@
             this.revision = SVNRevision.SVN_INVALID_REVNUM;
             this.textStatus = SVNStatusKind.NONE.toInt();
             this.propStatus = SVNStatusKind.NONE.toInt();
- this.readOnly = true;
+ this.readOnly = false;
             //this.path = status.getFile().get​AbsolutePath();
         }
     }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1456 - trunk/subclipse/core/src/org/tigris/subversion/subclipse/core/resources markphip Mark Phippard 2005-07-18 07:13:04 PDT
Messages per page: