ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/java/SVNAccess/src/net/oni2/svnaccess/SVN.java
(Generate patch)

Comparing java/SVNAccess/src/net/oni2/svnaccess/SVN.java (file contents):
Revision 852 by alloc, Fri May 3 12:25:21 2013 UTC vs.
Revision 854 by alloc, Fri May 3 13:35:11 2013 UTC

# Line 44 | Line 44 | public class SVN {
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          }
# Line 125 | Line 125 | public class SVN {
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
# Line 137 | Line 138 | public class SVN {
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;
# Line 200 | Line 211 | public class SVN {
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;
# Line 239 | Line 251 | public class SVN {
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          }
# Line 253 | Line 266 | public class SVN {
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          }
# Line 273 | Line 287 | public class SVN {
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          }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)