Changeset 764 for java/SVNAccess
- Timestamp:
- Mar 31, 2013, 5:11:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/SVNAccess/src/net/oni2/svnaccess/SVN.java
r732 r764 13 13 import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory; 14 14 import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; 15 import org.tmatesoft.svn.core.wc.ISVNStatusHandler; 15 16 import org.tmatesoft.svn.core.wc.SVNClientManager; 16 17 import org.tmatesoft.svn.core.wc.SVNInfo; 17 18 import org.tmatesoft.svn.core.wc.SVNRevision; 19 import org.tmatesoft.svn.core.wc.SVNStatus; 20 import org.tmatesoft.svn.core.wc.SVNStatusType; 18 21 import org.tmatesoft.svn.core.wc.SVNWCUtil; 19 22 … … 99 102 * @return -1: No local working copy yet<br> 100 103 * 0: Revisions are equal<br> 101 * 1: SVN contains newer revisions 104 * 1: SVN contains newer revisions<br> 105 * 2: WC has manually deleted files 102 106 * @throws Exception 103 107 * If destination is not a WC of the given repository … … 114 118 if (remoteRev > localRev) 115 119 return 1; 116 else 117 return 0; 120 else { 121 if (getMissingFiles(wcDir)) 122 return 2; 123 else 124 return 0; 125 } 118 126 } else { 119 127 return -1; 120 128 } 129 } 130 131 private boolean getMissingFiles(File wcDir) { 132 try { 133 final Vector<String> files = new Vector<String>(); 134 svnCManager.getStatusClient().doStatus(wcDir, null, 135 SVNDepth.INFINITY, false, false, false, false, 136 new ISVNStatusHandler() { 137 @Override 138 public void handleStatus(SVNStatus status) 139 throws SVNException { 140 SVNStatusType stat = status 141 .getCombinedNodeAndContentsStatus(); 142 if (stat == SVNStatusType.MISSING 143 || stat == SVNStatusType.STATUS_MISSING) { 144 files.add(status.getFile().getPath()); 145 } 146 } 147 }, null); 148 return files.size() > 0; 149 } catch (SVNException e) { 150 e.printStackTrace(); 151 } 152 return false; 121 153 } 122 154 … … 157 189 true, 0, new LogEntryHandler(list, reposUrl.getPath())); 158 190 } catch (Exception e) { 159 if ( e.getMessage().startsWith("svn: No such revision "))160 return null;161 err.println("Error while getting the list of updated files of the location '"162 + reposUrl + "': " + e.getMessage());163 e.printStackTrace();191 if (!e.getMessage().contains("No such revision ")) { 192 err.println("Error while getting the list of updated files of the location '" 193 + reposUrl + "': " + e.getMessage()); 194 e.printStackTrace(); 195 } 164 196 } 165 197 … … 171 203 Vector<String> updatedFiles = getUpdatedFilesInRepository(reposUrl, 172 204 fromRev); 173 174 if (updatedFiles == null)175 return true;176 205 177 206 svnCManager.getUpdateClient().setEventHandler(
Note:
See TracChangeset
for help on using the changeset viewer.