r3372 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/vcs
Author: chatellier Date: 2011-06-09 10:30:14 +0000 (Thu, 09 Jun 2011) New Revision: 3372 Log: Fix svn update (wasn't restoring locally missing file) Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java =================================================================== --- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2011-06-09 10:01:12 UTC (rev 3371) +++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2011-06-09 10:30:14 UTC (rev 3372) @@ -656,14 +656,21 @@ } /** + * Retourne la liste des fichiers qui ont été mis à jour sur le serveur. + * + * Le status des fichiers retourné est : + * <ul> + * <li>SVNStatusType.STATUS_ADDED (remote) pour ajout local + * <li>SVNStatusType.STATUS_DELETED (remote) pour suppression locale + * <li>SVNStatusType.MISSING (local) pour restauration + * </ul> + * * @param file * @param recurse - * @param wanted * @return remote status * @throws VCSException */ - protected Map<File, SVNStatus> getRemoteStatus(File file, boolean recurse, - SVNStatusType... wanted) throws VCSException { + protected Map<File, SVNStatus> getRemoteStatus(File file, boolean recurse) throws VCSException { try { File localFile = file; @@ -672,21 +679,21 @@ } final Map<File, SVNStatus> result = new HashMap<File, SVNStatus>(); - final Set<SVNStatusType> acceptedStatusType = new HashSet<SVNStatusType>( - Arrays.asList(wanted)); ISVNStatusHandler handler = new ISVNStatusHandler() { public void handleStatus(SVNStatus status) throws SVNException { - if ((acceptedStatusType.size() == 0 - && status.getRemoteContentsStatus() != SVNStatusType.STATUS_NONE && status - .getRemoteContentsStatus() != SVNStatusType.STATUS_NORMAL) - || acceptedStatusType.contains(status - .getRemoteContentsStatus())) { + if (log.isDebugEnabled()) { + log.debug("Status on file " + status.getFile() + " rstatus:" + + status.getRemoteContentsStatus() + " lstatus:" + status.getContentsStatus()); + } + + if (status.getRemoteContentsStatus().equals(SVNStatusType.STATUS_ADDED) || + status.getRemoteContentsStatus().equals(SVNStatusType.STATUS_DELETED) || + status.getContentsStatus().equals(SVNStatusType.STATUS_MISSING)) { + File statusFile = status.getFile(); - if (!statusFile.isDirectory() - || status.getRemoteContentsStatus() == SVNStatusType.STATUS_ADDED - || status.getRemoteContentsStatus() == SVNStatusType.STATUS_DELETED) { - // on ne met pas les repertoires pere dans le status + if (!statusFile.isDirectory()) { + // on ne met pas les repertoires pere dans le status // car en fait ca veut dire qu'un fichier/rep dans ce // repertoire a ete ajout/modifier/delete, et on l'aura // aussi dans les resultats et ca suffit @@ -701,8 +708,8 @@ SVNRevision.HEAD, // SVNRevision revision, SVNDepth.INFINITY, // SVNDepth depth, true, // boolean remote, - !acceptedStatusType.contains(SVNStatusType.STATUS_NORMAL), // boolean reportAll, - acceptedStatusType.contains(SVNStatusType.STATUS_IGNORED), // boolean includeIgnored, + true, // boolean reportAll, + false, // boolean includeIgnored, true, // boolean collectParentExternals, handler, // ISVNStatusHandler handler, null); // Collection changeLists
participants (1)
-
chatellier@users.labs.libre-entreprise.org