| 44 |
|
|
| 45 |
|
private void setProxy(BasicAuthenticationManager authMan) { |
| 46 |
|
ProxySettings prox = ProxySettings.getInstance(); |
| 47 |
< |
if (prox.validate()) { |
| 47 |
> |
if (prox.validate() && prox.isUseProxy()) { |
| 48 |
|
authMan.setProxy(prox.getHostOrIp(), prox.getPort(), null, null); |
| 49 |
|
} |
| 50 |
|
} |
| 125 |
|
* URL of repository to check for newer revisions |
| 126 |
|
* @param wcDir |
| 127 |
|
* Local working copy path to compare against |
| 128 |
< |
* @return -1: No local working copy yet<br> |
| 128 |
> |
* @return -2: No connection to remote repos<br> |
| 129 |
> |
* -1: No local working copy yet<br> |
| 130 |
|
* 0: Revisions are equal<br> |
| 131 |
|
* 1: SVN contains newer revisions<br> |
| 132 |
|
* 2: WC has manually deleted files |
| 138 |
|
|
| 139 |
|
if (wcDir.exists()) { |
| 140 |
|
int localRev = pathIsWCof(repos, wcDir); |
| 141 |
< |
if (localRev < 0) |
| 142 |
< |
throw new Exception( |
| 143 |
< |
"Destination path exists but is not a Working Copy of the SVN"); |
| 141 |
> |
if (localRev < 0) { |
| 142 |
> |
if (wcDir.listFiles().length > 0) { |
| 143 |
> |
throw new Exception( |
| 144 |
> |
"Destination path exists but is not a Working Copy of the SVN"); |
| 145 |
> |
} else { |
| 146 |
> |
wcDir.delete(); |
| 147 |
> |
return -1; |
| 148 |
> |
} |
| 149 |
> |
} |
| 150 |
|
int remoteRev = getRemoteHeadRevision(repos); |
| 151 |
|
if (remoteRev > localRev) |
| 152 |
|
return 1; |
| 153 |
|
else { |
| 154 |
< |
if (getMissingFiles(wcDir)) |
| 155 |
< |
return 2; |
| 156 |
< |
else |
| 157 |
< |
return 0; |
| 154 |
> |
if (remoteRev < 0) { |
| 155 |
> |
return -2; |
| 156 |
> |
} else { |
| 157 |
> |
if (getMissingFiles(wcDir)) |
| 158 |
> |
return 2; |
| 159 |
> |
else |
| 160 |
> |
return 0; |
| 161 |
> |
} |
| 162 |
|
} |
| 163 |
|
} else { |
| 164 |
|
return -1; |
| 211 |
|
} catch (SVNException e) { |
| 212 |
|
err.println("Error while getting information of working copy for the location '" |
| 213 |
|
+ reposUrl + "': " + e.getMessage()); |
| 214 |
+ |
e.printStackTrace(); |
| 215 |
|
} |
| 216 |
|
} |
| 217 |
|
return -1; |
| 251 |
|
} catch (Exception e) { |
| 252 |
|
err.println("Error while updating the working copy for the location '" |
| 253 |
|
+ reposUrl + "': " + e.getMessage()); |
| 254 |
+ |
e.printStackTrace(); |
| 255 |
|
} |
| 256 |
|
return false; |
| 257 |
|
} |
| 266 |
|
} catch (Exception e) { |
| 267 |
|
err.println("Error while getting the list of files of the location '" |
| 268 |
|
+ reposUrl + "': " + e.getMessage()); |
| 269 |
+ |
e.printStackTrace(); |
| 270 |
|
} |
| 271 |
|
return list; |
| 272 |
|
} |
| 287 |
|
} catch (Exception e) { |
| 288 |
|
err.println("Error while checking out a working copy for the location '" |
| 289 |
|
+ reposUrl + "': " + e.getMessage()); |
| 290 |
+ |
e.printStackTrace(); |
| 291 |
|
} |
| 292 |
|
return result; |
| 293 |
|
} |