1 11 package org.eclipse.team.internal.ccvs.core.syncinfo; 12 13 import java.util.Date ; 14 15 import org.eclipse.core.runtime.Assert; 16 import org.eclipse.team.internal.ccvs.core.CVSException; 17 import org.eclipse.team.internal.ccvs.core.CVSTag; 18 import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption; 19 20 34 public class MutableResourceSyncInfo extends ResourceSyncInfo { 35 36 protected MutableResourceSyncInfo(ResourceSyncInfo info) { 37 this.name = info.getName(); 38 setRevision(info.getRevision()); 39 setTag(info.getTag()); 40 this.timeStamp = info.getTimeStamp(); 41 this.isDirectory = info.isDirectory(); 42 this.keywordMode = info.getKeywordMode(); 43 this.isDeleted = info.isDeleted(); 44 if(info.isMergedWithConflicts()) { 45 setSyncType(TYPE_MERGED_WITH_CONFLICTS); 46 } else if(info.isMerged()) { 47 setSyncType(TYPE_MERGED); 48 } else { 49 setSyncType(TYPE_REGULAR); 50 } 51 } 52 53 57 public MutableResourceSyncInfo(String name, String revision) { 58 Assert.isNotNull(name); 59 this.name = name; 60 setRevision(revision); 61 } 62 63 67 public void setRevision(String revision) { 68 super.setRevision(revision); 69 } 70 71 75 public void setTimeStamp(Date timeStamp) { 76 this.timeStamp = timeStamp; 77 } 78 79 83 public void setTimeStamp(Date timeStamp, boolean clearMerged) { 84 setTimeStamp(timeStamp); 85 if (clearMerged) setSyncType(TYPE_REGULAR); 86 } 87 88 92 public void setKeywordMode(KSubstOption keywordMode) { 93 this.keywordMode = keywordMode; 94 } 95 96 100 public void setTag(CVSTag tag) { 101 super.setTag(tag); 102 } 103 104 108 public void setDeleted(boolean isDeleted) { 109 this.isDeleted = isDeleted;; 110 } 111 112 115 public void setAdded() { 116 setRevision(ADDED_REVISION); 117 } 118 119 122 public void setMerged() { 123 if(syncType==TYPE_REGULAR) { 125 this.syncType = TYPE_MERGED; 126 } 127 } 128 129 132 public void setEntryLine(String entryLine) throws CVSException { 133 super.setEntryLine(entryLine); 134 } 135 } 136 | Popular Tags |