Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNLogEntry


    }
   
    private List toScm(Collection collection) throws SVNException {
      List list = new ArrayList();
      for ( Iterator it = collection.iterator(); it.hasNext(); ) {
          SVNLogEntry logEntry = ( SVNLogEntry ) it.next();
          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


    }
   
    private List toScm(Collection collection) throws SVNException {
      List list = new ArrayList();
      for ( Iterator it = collection.iterator(); it.hasNext(); ) {
          SVNLogEntry logEntry = ( SVNLogEntry ) it.next();
          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

    Collection logEntries = repository.log(new String[0], null, startRevision, endRevision, true, true);
    for (Object logEntryObject : logEntries) {
      if (cancel) {
        break;
      }
      SVNLogEntry log = (SVNLogEntry) logEntryObject;
      String changeSetInfo = "Import revision " + log.getRevision()
          + " (" + importer.getCollabReview().getNewDateFormatter().format(log.getDate())
          + "), Author " + log.getAuthor() + ": " + log.getMessage();
      progressInfo.setTaskDescription(changeSetInfo);
      workChangeSet(log, cache);
      state.setValue("revision", log.getRevision());
      state.commit();
      progressInfo.setTaskDescription("Revision " + log.getRevision() + " successfully imported");
    }
  }
View Full Code Here

   *
   * @throws SVNException
   */
  private void doplnZmenoveInformace(Zmena z) throws SVNException {

    SVNLogEntry logEntry = vsechnyVerze.get(z.getVerze());
    if (logEntry == null) {
      log.warn("doplnZmenoveInformace: logEntry == null ... ZmÄ›na: " + z);     
    } else {
    z.setAutor(logEntry.getAuthor());
    z.setDatum(logEntry.getDate());
    z.setKomentar(logEntry.getMessage());
    }
  }
View Full Code Here

    private void resumeImport() throws SVNImporterException, SVNException {
        // First I reconnect to SVN repository
        fConnector.connectSVN();
        LOGGER.info(ImporterMessages.EvolizerSVNImporter_reconnected);
        fMonitor.subTask(NLS.bind(ImporterMessages.EvolizerSVNImporter_performingRollback, fCurrRev));
        SVNLogEntry entry = null;
        try {
            entry = fConnector.getRevision(fCurrRev);
        } catch (NoSuchElementException e) {
            throw new SVNImporterException(NLS.bind(
                    ImporterMessages.EvolizerSVNImporter_problemResumingFromRevision,
                    fCurrRev));
        }
        /*
         * I proceed to clean up the data of the last revision found, so I don't run into inconsistencies.
         * The way I do it depends on whether the repository is a standard one or not.
         */
        // Sometimes log entries can be empty, I will just skip them
        if (!entry.getChangedPaths().isEmpty()) {
            // 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())
                        && (this.fConnector.isStandardSVNLayout() || this.usingCustomPaths)) {
                    path = ((SVNLogEntryPath) entry.getChangedPaths().values().iterator().next()).getPath();
                }
                fModelMapper.deleteRevision(entry.getRevision(), entry.getAuthor(), path);
            }
        }

        fBeginImport = fCurrRev;
        // Then I create a representation
View Full Code Here

     * @throws SVNException
     *             In case of SVN related problems while fetching the revision.
     */
    public SVNLogEntry getRevision(long revision) throws SVNException {

        SVNLogEntry entry;
        LOGGER.debug(NLS.bind(SVNConnectorMessages.SVNConnector_retrievingSingleRevision, revision));
        if (fPaths != null) {
            entry = (SVNLogEntry) fRepository.log(fPaths, null, revision, revision, true, true).iterator().next();
        } else {
            entry =
View Full Code Here

                    myRevProps.put(SVNRevisionProperty.LOG, myComment);
                }
                if (myDate != null) {
                    myRevProps.put(SVNRevisionProperty.DATE, SVNDate.formatDate(myDate));
                }
                SVNLogEntry logEntry = new SVNLogEntry(myPaths, myRevision, myRevProps, myHasChildren);
                myLogEntryHandler.handleLogEntry(logEntry);
                if (logEntry.hasChildren()) {
                    myNestLevel++;
                }
                if (logEntry.getRevision() < 0) {
                    myNestLevel = myNestLevel <= 0 ? 0 : myNestLevel -1;
                }
            }
            myPaths = null;
            myRevProps = null;
View Full Code Here

        }
        return nextRevision;
    }

    private void sendLog(long revision, boolean hasChildren) throws SVNException {
        SVNLogEntry logEntry = fillLogEntry(revision);
        logEntry.setHasChildren(hasChildren);
        if (myHandler != null) {
            myHandler.handleLogEntry(logEntry);
        }
    }
View Full Code Here

            changedPaths = new SVNHashMap();
        }
        if (entryRevProps == null) {
            entryRevProps = new SVNProperties();
        }
        SVNLogEntry entry = new SVNLogEntry(changedPaths, revision, entryRevProps, false);
        return entry;
    }
View Full Code Here

                            }
                        }
                    }
                }
                if (handler != null && !(limit > 0 && count > limit && nestLevel == 0)) {
                    SVNLogEntry logEntry = new SVNLogEntry(changedPathsMap, revision, logEntryProperties, hasChildren);
                    handler.handleLogEntry(logEntry);
                    if (logEntry.hasChildren()) {
                        nestLevel++;
                    }
                    if (logEntry.getRevision() < 0) {
                        nestLevel--;
                        if (nestLevel < 0) {
                            nestLevel = 0;
                        }
                    }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNLogEntry

Copyright © 2018 www.massapicom. 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.