Examples of SVNLogEntryPath


Examples of org.tmatesoft.svn.core.SVNLogEntryPath

          Map map = logEntry.getChangedPaths();
          Set changePathSet = map.keySet();         
         
          ScmLogEntry scmLogEntry = new ScmLogEntry(logEntry.getAuthor(),logEntry.getDate(), logEntry.getMessage() );
          for ( Iterator it2 = changePathSet.iterator(); it2.hasNext(); ) {             
              SVNLogEntryPath entryPath = ( SVNLogEntryPath ) map.get( it2.next() );             
             
              switch (entryPath.getType()) {
                 
                  case SVNLogEntryPath.TYPE_ADDED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      if ( entryPath.getCopyPath() == null ) {
                          // this entry was added
                          Add add = new Add( type, entryPath.getPath(), logEntry.getRevision());
                          scmLogEntry.addAction( add );
                          break;
                      } else {
                          // this entry was copied
                          Copy copy = new Copy( type, entryPath.getCopyPath(), entryPath.getCopyRevision(), entryPath.getPath(), logEntry.getRevision() );
                          scmLogEntry.addAction( copy );
                          break;                
                      }                     
                  }
                     
                  case SVNLogEntryPath.TYPE_DELETED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Delete delete = new Delete( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( delete );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_MODIFIED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Update update = new Update( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( update );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_REPLACED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Replaced replaced = new Replaced( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( replaced );
                      break;
                  }                                      
              }                           
          }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

          Map map = logEntry.getChangedPaths();
          Set changePathSet = map.keySet();         
         
          ScmLogEntry scmLogEntry = new ScmLogEntry(logEntry.getAuthor(),logEntry.getDate(), logEntry.getMessage() );
          for ( Iterator it2 = changePathSet.iterator(); it2.hasNext(); ) {             
              SVNLogEntryPath entryPath = ( SVNLogEntryPath ) map.get( it2.next() );             
             
              switch (entryPath.getType()) {
                 
                  case SVNLogEntryPath.TYPE_ADDED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      if ( entryPath.getCopyPath() == null ) {
                          // this entry was added
                          Add add = new Add( type, entryPath.getPath(), logEntry.getRevision());
                          scmLogEntry.addAction( add );
                          break;
                      } else {
                          // this entry was copied
                          Copy copy = new Copy( type, entryPath.getCopyPath(), entryPath.getCopyRevision(), entryPath.getPath(), logEntry.getRevision() );
                          scmLogEntry.addAction( copy );
                          break;                
                      }                     
                  }
                     
                  case SVNLogEntryPath.TYPE_DELETED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Delete delete = new Delete( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( delete );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_MODIFIED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Update update = new Update( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( update );
                      break;
                  }
                 
                  case SVNLogEntryPath.TYPE_REPLACED: {
                      SVNDirEntry dirEntry = this.repository.info( entryPath.getPath(), -1 );
                      char type = ( dirEntry.getKind() == SVNNodeKind.DIR ) ? 'D' : 'F';
                      Replaced replaced = new Replaced( type, entryPath.getPath(), logEntry.getRevision());
                      scmLogEntry.addAction( replaced );
                      break;
                  }                                      
              }                           
          }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

        return result;
    }
   
    private static String getPreviousLogPath(String path, SVNLogEntry logEntry, SVNNodeKind kind) throws SVNException {
        String prevPath = null;
        SVNLogEntryPath logPath = (SVNLogEntryPath) logEntry.getChangedPaths().get(path);
        if (logPath != null) {
            if (logPath.getType() != SVNLogEntryPath.TYPE_ADDED && logPath.getType() != SVNLogEntryPath.TYPE_REPLACED) {
                return logPath.getPath();
            }
            if (logPath.getCopyPath() != null) {
                return logPath.getCopyPath();
            }
            return null;
        } else if (!logEntry.getChangedPaths().isEmpty()){
            Map sortedMap = new SVNHashMap();
            sortedMap.putAll(logEntry.getChangedPaths());
            List pathsList = new ArrayList(sortedMap.keySet());
            Collections.sort(pathsList, SVNPathUtil.PATH_COMPARATOR);
            Collections.reverse(pathsList);
            for(Iterator paths = pathsList.iterator(); paths.hasNext();) {
                String p = (String) paths.next();
                if (path.startsWith(p + "/")) {
                    SVNLogEntryPath lPath = (SVNLogEntryPath) sortedMap.get(p);
                    if (lPath.getCopyPath() != null) {
                        prevPath = SVNPathUtil.append(lPath.getCopyPath(), path.substring(p.length()));
                        break;
                    }
                }
            }
        }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

    @SuppressWarnings({"unchecked"}) NavigableMap<String, Object> changes = new TreeMap<String, Object>(logEntry.getChangedPaths());
    if (logger.isDebugEnabled()) {
      logger.debug(changes.size() + " changes in change set: " + changes);
    }
    for (String changedPath : changes.navigableKeySet()) {
      SVNLogEntryPath logEntryPath = (SVNLogEntryPath) changes.get(changedPath);
      assert logEntryPath != null;
      String atomicDescription = logEntryPath.getType() + " " + logEntryPath.getPath();
      progressInfo.setAtomicWorkUnitDescription(atomicDescription);
      ActionData actionData = new ActionData(this, repository, logEntry, logEntryPath, cache);
      if (actionData.isFile()) {
        fileUpdateHandler.processAction(actionData);
      } else {
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

            // Check if it was a standard release
            if (isRelease(entry)) {
                LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundRelease, entry.getRevision()));
                TreeMap<String, SVNLogEntryPath> sortedPaths =
                        new TreeMap<String, SVNLogEntryPath>(entry.getChangedPaths());
                SVNLogEntryPath tagPath = sortedPaths.values().iterator().next();
                fModelMapper.deleteRelease(entry.getRevision(), entry.getAuthor(), tagPath.getPath());

            } else if (isBranch(entry, true) || isSubBranch(entry, true)) {
                LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundBranch, entry.getRevision()));
                Map<String, SVNLogEntryPath> sortedPaths =
                        new TreeMap<String, SVNLogEntryPath>(entry.getChangedPaths());
                SVNLogEntryPath tagPath = sortedPaths.values().iterator().next();
                fModelMapper.deleteBranch(entry.getRevision(), entry.getAuthor(), getBranchName(entry, tagPath));
            } else {
                LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundRevision, entry.getRevision()));
                String path = null;
                if (this.isInBranch(((SVNLogEntryPath) entry.getChangedPaths().values().iterator().next()).getPath())
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

     */
    @SuppressWarnings("unchecked")
    private void handleBranch(SVNLogEntry logEntry, boolean isSubBranch) throws SVNException, SVNImporterException {
        Map<String, SVNLogEntryPath> sortedPaths = new TreeMap<String, SVNLogEntryPath>(logEntry.getChangedPaths());

        SVNLogEntryPath tagPath = sortedPaths.values().iterator().next();
        String tag = getBranchName(logEntry, tagPath);
        String parentTag = null;
        if (isSubBranch) {
            parentTag = tagPath.getCopyPath().substring(tagPath.getCopyPath().lastIndexOf("/") + 1);
        }
        // Create the ChangeSet related to the branch creation
        Transaction changeSet = fModelMapper.createTransaction(logEntry.getDate());
        // Here I don't check whether the logEntryPath points to a directory as It should already be done in isBranch.
        Branch branch =
                fModelMapper.createBranch(
                        logEntry.getDate(),
                        changeSet,
                        logEntry.getMessage(),
                        logEntry.getAuthor(),
                        tag,
                        parentTag,
                        tagPath.getPath(),
                        tagPath.getCopyPath(),
                        tagPath.getCopyRevision(),
                        logEntry.getRevision());

        // I iterate over remaining log entry paths, as there might be some adds or deletes
        sortedPaths.remove(tagPath.getPath());
        ArrayList<SVNLogEntryPath> delete = new ArrayList<SVNLogEntryPath>();
        TreeMap<String, SVNLogEntryPath> add = new TreeMap<String, SVNLogEntryPath>();
        TreeMap<String, SVNLogEntryPath> replace = new TreeMap<String, SVNLogEntryPath>();
        ArrayList<SVNLogEntryPath> alreadyAdded = new ArrayList<SVNLogEntryPath>();
        for (SVNLogEntryPath logEntryPath : sortedPaths.values()) {
            if (logEntryPath.getType() == SVNLogEntryPath.TYPE_DELETED) {
                delete.add(logEntryPath);
            } else if (logEntryPath.getType() == SVNLogEntryPath.TYPE_ADDED) {
                add.put(logEntryPath.getPath().replace(tagPath.getPath(), ""), logEntryPath);
            } else if (logEntryPath.getType() == SVNLogEntryPath.TYPE_REPLACED) {
                replace.put(logEntryPath.getPath().replace(tagPath.getPath(), ""), logEntryPath);
            }
        }
        for (SVNLogEntryPath replaceEntry : replace.values()) {
            for (SVNLogEntryPath addEntry : add.values()) {
                if (replaceEntry.getPath().contains(addEntry.getPath())) {
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

         */
        TreeMap<String, SVNLogEntryPath> sortedPaths = new TreeMap<String, SVNLogEntryPath>(logEntry.getChangedPaths());
        Transaction changeSet = fModelMapper.createTransaction(logEntry.getDate());
        // I get the first logEntryPath, the one containing the creation of the tag folder and I create a release with
        // that
        SVNLogEntryPath tagPath = sortedPaths.values().iterator().next();
        SVNRelease release =
                fModelMapper.createRelease(
                        logEntry.getDate(),
                        changeSet,
                        logEntry.getMessage(),
                        logEntry.getAuthor(),
                        tagPath.getPath(),
                        tagPath.getCopyPath(),
                        tagPath.getCopyRevision(),
                        logEntry.getRevision());

        // I iterate over remaining log entry paths
        sortedPaths.remove(tagPath.getPath());
        ArrayList<SVNLogEntryPath> delete = new ArrayList<SVNLogEntryPath>();
        TreeMap<String, SVNLogEntryPath> add = new TreeMap<String, SVNLogEntryPath>();
        TreeMap<String, SVNLogEntryPath> replace = new TreeMap<String, SVNLogEntryPath>();
        ArrayList<SVNLogEntryPath> alreadyAdded = new ArrayList<SVNLogEntryPath>();

        // I get all the single log entry paths and classify them as delete, add or replace
        for (SVNLogEntryPath logEntryPath : sortedPaths.values()) {
            if (logEntryPath.getType() == SVNLogEntryPath.TYPE_DELETED) {
                delete.add(logEntryPath);
            } else if (logEntryPath.getType() == SVNLogEntryPath.TYPE_ADDED) {
                add.put(logEntryPath.getPath().replace(tagPath.getPath(), ""), logEntryPath);
            } else if (logEntryPath.getType() == SVNLogEntryPath.TYPE_REPLACED) {
                replace.put(logEntryPath.getPath().replace(tagPath.getPath(), ""), logEntryPath);
            }
        }

        /*
         * I iterate over the replaces of the log entry
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

         * otherwise, also file/directory moves inside a branch could end up counting as sub branch creations.
         * Look at isRelease for an explanation on why I use a TreeMap
         */
        Map<String, SVNLogEntryPath> sortedMap = new TreeMap<String, SVNLogEntryPath>(logEntry.getChangedPaths());
        Iterator<SVNLogEntryPath> logEntryPathIterator = sortedMap.values().iterator();
        SVNLogEntryPath firstLogEntryPath = logEntryPathIterator.next();

        if ((logEntry.getMessage() != null)
                && logEntry.getMessage().contains(ImporterMessages.EvolizerSVNImporter_cvs2svnBranch)
                && !isContainedInBranch(firstLogEntryPath.getPath())) {
            SVNNodeKind nodeKind = getEntryType(firstLogEntryPath, logEntry);
            if (nodeKind == SVNNodeKind.DIR) {
                int beginIndex;
                int endIndex;
                beginIndex = logEntry.getMessage().indexOf("'");
                endIndex = logEntry.getMessage().lastIndexOf("'");
                LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundcvs2svnBranch, logEntry.getMessage()
                        .substring(beginIndex + 1, endIndex)));
                return true;
            } else {
                return false;
            }
        } else {
            // Checking that CopyPath and CopyRevision are set and the copy is done from the trunk to the branches
            // folder
            if ((firstLogEntryPath.getType() == SVNLogEntryPath.TYPE_ADDED)
                    && (firstLogEntryPath.getCopyPath() != null) && this.isInTrunk(firstLogEntryPath.getCopyPath())
                    && (firstLogEntryPath.getCopyRevision() != -1) && this.isInBranch(firstLogEntryPath.getPath())) {
                /*
                 * I check that all the paths that are being added are children of the first found (which is thus the root folder for this branch)
                 * In this way I know that the first entry is a directory and that I'm dealing with a real branch creation,
                 * as there could actually be some commits, in which different branches are modified and that would otherwise end up as a branch creation.
                 */
                while (logEntryPathIterator.hasNext()) {
                    SVNLogEntryPath entry = logEntryPathIterator.next();
                    // To do so I just need to check that all their paths start with the supposed release path
                    if (!entry.getPath().startsWith(firstLogEntryPath.getPath())) {
                        LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_revisionBranchSimilarity, logEntry
                                .getRevision()));
                        return false;
                    }
                }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

         * It also checks that the ADD operation does not target an existing branch,
         * otherwise, also file/directory moves inside a branch could end up counting as sub branch creations.
         */
        Map<String, SVNLogEntryPath> sortedMap = new TreeMap<String, SVNLogEntryPath>(logEntry.getChangedPaths());
        Iterator<SVNLogEntryPath> logEntryPathIterator = sortedMap.values().iterator();
        SVNLogEntryPath firstLogEntryPath = logEntryPathIterator.next();
        if ((firstLogEntryPath.getType() == SVNLogEntryPath.TYPE_ADDED)
        // CopyPath is set
                && (firstLogEntryPath.getCopyPath() != null)
                // The copy is done from the branches folder
                && this.isInBranch(firstLogEntryPath.getCopyPath())
                // CopyRevision is set
                && (firstLogEntryPath.getCopyRevision() != -1)
                // and to the branches folder
                && this.isInBranch(firstLogEntryPath.getPath())) {
            /*
             * I check that all the paths that are being added are children of the first found (which is thus the root folder for this branch).
             * In this way I know that the first entry is a directory and that I'm dealing with a real branch creation,
             * as there could actually be some commits, in which different branches are modified that would otherwise end up as a branch creation.
             */
            while (logEntryPathIterator.hasNext()) {
                SVNLogEntryPath entry = logEntryPathIterator.next();
                // To do so I just need to check that all their paths start with the supposed release path
                if (!entry.getPath().startsWith(firstLogEntryPath.getPath())) {
                    LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_revisionBranchSimilarity, logEntry
                            .getRevision()));
                    return false;
                }
            }
View Full Code Here

Examples of org.tmatesoft.svn.core.SVNLogEntryPath

            String releaseTag = logEntry.getMessage().substring(beginIndex + 1, endIndex);
            LOGGER.debug(NLS.bind(ImporterMessages.EvolizerSVNImporter_foundRelease, releaseTag)
                    + ImporterMessages.EvolizerSVNImporter_exportedBycvs2svn);
            return true;
        } else {
            SVNLogEntryPath firstLogEntryPath = logEntryPathIterator.next();
            /*
             * A log entry, in order to be a standard release has to be made up of just one type of action:
             * an ADD from ONE folder to another of a directory (not of a file) and some optional addition of files to
             * that newly created directory.
             */
            if ((firstLogEntryPath.getType() == SVNLogEntryPath.TYPE_ADDED)
                    && (firstLogEntryPath.getCopyPath() != null) && (firstLogEntryPath.getCopyRevision() != -1)) {

                // I check whether all the additional logEntries are just additions of some additional files to the
                // newly created release.
                while (logEntryPathIterator.hasNext()) {
                    SVNLogEntryPath entry = logEntryPathIterator.next();
                    // To do so I just need to check that all their paths start with the supposed release path
                    if (!entry.getPath().startsWith(firstLogEntryPath.getPath())) {
                        return false;
                    }
                }
                /*
                 * If the project follows the standard SVN layout, I can be stricter and check that the ADD was from trunk to tags.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.