当前位置: 首页>>代码示例>>Java>>正文


Java SVNLogEntryPath类代码示例

本文整理汇总了Java中org.tmatesoft.svn.core.SVNLogEntryPath的典型用法代码示例。如果您正苦于以下问题:Java SVNLogEntryPath类的具体用法?Java SVNLogEntryPath怎么用?Java SVNLogEntryPath使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SVNLogEntryPath类属于org.tmatesoft.svn.core包,在下文中一共展示了SVNLogEntryPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleLogEntry

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
@Override
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
    String filter = logFilterName.getText().toLowerCase();
    String author = logEntry.getAuthor().toLowerCase();
    String msg = logEntry.getMessage().toLowerCase();
    if (filter != null && !filter.isEmpty() && !(author.contains(filter) || msg.contains(filter))) {
        return;
    }
    detailData.put(logEntry.getRevision(), logEntry.getChangedPaths());
    String str1 = projectName + "|" + logEntry.getRevision() + "|" + logEntry.getAuthor() + "|" + sdf.format(logEntry.getDate()) + "|" + logEntry.getMessage();
    logs.add(str1);
    ((DefaultTableModel) logTable.getModel()).setRowCount(0);
    ((DefaultTableModel) detailTable.getModel()).setRowCount(0);
    for (int i = logs.size() - 1; i >= 0; i--) {
        String str = logs.get(i);
        ((DefaultTableModel) logTable.getModel()).addRow(str.split("\\|"));
    }
    for (Map.Entry<String, SVNLogEntryPath> entry : logEntry.getChangedPaths().entrySet()) {
        SVNLogEntryPath path = entry.getValue();
        ((DefaultTableModel) detailTable.getModel()).addRow(new Object[]{path.getPath(), getType(path.getType()), path.getCopyPath(), getCopyRevision(path.getCopyRevision())});
    }
}
 
开发者ID:ajtdnyy,项目名称:PackagePlugin,代码行数:23,代码来源:MainFrame.java

示例2: create

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
@Nullable
public static LogEntry create(@Nullable SVNLogEntry entry) {
  LogEntry result = null;

  if (entry != null) {
    LogEntry.Builder builder = new LogEntry.Builder();

    if (entry.getChangedPaths() != null) {
      for (SVNLogEntryPath path : entry.getChangedPaths().values()) {
        builder.addPath(LogEntryPath.create(path));
      }
    }

    result = builder.setRevision(entry.getRevision()).setAuthor(entry.getAuthor()).setDate(entry.getDate()).setMessage(entry.getMessage())
      .setHasChildren(entry.hasChildren()).build();
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:LogEntry.java

示例3: logEntryToChangeInfos

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<ChangeInfo> logEntryToChangeInfos(final String rootPath, final String loggedPath, final SVNLogEntry entry, final LogEntryFilter logEntryFilter) throws SVNException {
  final String fullLoggedPathFromAppend = SVNPathUtil.append(rootPath, loggedPath);
  final String fullLoggedPath = fixFullLoggedPath(fullLoggedPathFromAppend);
  final List<ChangeInfo> results = new LinkedList<ChangeInfo>();
  for (Map.Entry<String, SVNLogEntryPath> pathEntry : (Iterable<Map.Entry<String, SVNLogEntryPath>>) entry.getChangedPaths().entrySet()) {
    final String changedPath = pathEntry.getKey();
    if (logEntryFilter.accept(fullLoggedPath, pathEntry.getValue())) {
      ChangeInfo change = classifiedChange(_repository, entry, rootPath, changedPath);
      // Might want to put this at a higher level if we can ever do
      // something useful with 'other' changes.
      if (change.getKind() != StoreKind.OTHER) {
        results.add(change);
      }
    }
  }
  return results;
}
 
开发者ID:CoreFiling,项目名称:reviki,代码行数:19,代码来源:RepositoryBasicSVNOperations.java

示例4: retrieveRevisions

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
@Cacheable("svnRevisions")
public Revisions retrieveRevisions(ScmConnectionSettings connectionSettings, int numberOfCommits) throws SVNException {
  log.info("Retrieve revisions on last {} commits for {}", numberOfCommits, connectionSettings);
  final SVNRepository repository = SvnRepositoryFactory.create(connectionSettings);

  final Multimap<String, SvnFileRevision> revisions = ArrayListMultimap.create();
  repository.log(null, repository.getLatestRevision(), 0L, true, true, numberOfCommits, new ISVNLogEntryHandler() {

    @Override
    public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
      log.debug("Process revision {}", logEntry.getRevision());
      for (SVNLogEntryPath logEntryPath : logEntry.getChangedPaths().values()) {
        if (logEntryPath.getCopyPath() != null) {
          revisions.put(logEntryPath.getPath(), new SvnFileRevision(logEntry.getRevision(), logEntryPath.getCopyPath(), logEntryPath.getPath()));
        } else {
          revisions.put(logEntryPath.getPath(), new SvnFileRevision(logEntry.getRevision(), logEntryPath.getPath(), logEntryPath.getPath()));
        }
      }
    }
  });

  log.info("Found {} changes for last {} commits with connection {}", revisions.values().size(), numberOfCommits, connectionSettings);
  return new Revisions(revisions);
}
 
开发者ID:CodeQInvest,项目名称:codeq-invest,代码行数:29,代码来源:DefaultSvnRevisionsRetriever.java

示例5: buildChangePath

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
/**
 * Builds a ChangePath from an SVNLogEntryPath object.
 * @param svnLogEntryPath The SVNLogEntryPath object from which to
 * build the ChangePath.
 * @return The populated ChangePath object.
 */
private ChangePath buildChangePath(final SVNLogEntryPath svnLogEntryPath) {
   ChangePath result = null;
   
   final String svnChangePath = svnLogEntryPath.getPath();
   final String svnChangeType =
         Character.toString(svnLogEntryPath.getType());
   
   if (svnLogEntryPath.getCopyPath() != null) {
      final String svnCopyPath = svnLogEntryPath.getCopyPath();
      final long svnCopyRevision =
            svnLogEntryPath.getCopyRevision();
      result =
            new ChangePath(
                  svnChangePath,
                  svnChangeType,
                  svnCopyPath,
                  svnCopyRevision
            );
   } else {
      result = new ChangePath(svnChangePath, svnChangeType);
   }

   return result;
}
 
开发者ID:fuerve,项目名称:VillageElder,代码行数:31,代码来源:SubversionRepository.java

示例6: buildRevisionInfo

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
/**
 * Builds a RevisionInfo object from an SVNLogEntry.
 * @param entry The SVNLogEntry from which to build the
 * RevisionInfo.
 * @return The populated RevisionInfo object.
 */
private RevisionInfo buildRevisionInfo(final SVNLogEntry entry) {
   final long svnRevision = entry.getRevision();
   final String svnAuthor = entry.getAuthor();
   final Date svnDate = entry.getDate();
   final String svnMessage = entry.getMessage();
   
   RevisionInfo result =
         new RevisionInfo(svnRevision, svnAuthor, svnDate, svnMessage);
   
   if (entry.getChangedPaths().size() > 0) {
      final Map<String, SVNLogEntryPath> changedPaths =
            entry.getChangedPaths();
      for (Entry<String, SVNLogEntryPath> changedPath :
         changedPaths.entrySet()) {
         
         final SVNLogEntryPath svnLogEntryPath = changedPath.getValue();
         final ChangePath changePath = buildChangePath(svnLogEntryPath);
         if (changePath != null) {
            result.addChangePath(changePath);
         }
      }
   }
   
   return result;
}
 
开发者ID:fuerve,项目名称:VillageElder,代码行数:32,代码来源:SubversionRepository.java

示例7: tableValueChanged

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
/**
 * 表选择事件处理
 * <p>
 * @param e
 */
public void tableValueChanged(ListSelectionEvent e) {
    DefaultListSelectionModel t = (DefaultListSelectionModel) e.getSource();
    if (t.equals(tablesList.getSelectionModel())) {
        try {
            if (tablesList.getSelectedRowCount() <= 0) {
                return;
            }
            String info1 = "当前数据库:" + lastDatabase;
            info1 += " 共计" + tablesList.getModel().getRowCount() + "张表";
            info1 += "共选中表" + tablesList.getSelectedRowCount() + "(未选中时将当前数据库所有表进行生成)";
            databaseInfoBar.setText(info1);
        } catch (Exception ex) {
            showIbatisInfo(ex.getLocalizedMessage());
            LOGGER.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
        }
    } else if (t.equals(detailTable.getSelectionModel())) {
        if (detailTable.getSelectedRowCount() > 0 && e.getValueIsAdjusting()) {
            statusLabel.setText("共选择了" + logTable.getSelectedRowCount() + "条日志,共选择了" + detailTable.getSelectedRowCount() + "个文件(不选择默认全部[" + detailTable.getRowCount() + "])");
        }
    } else if (t.equals(logTable.getSelectionModel())) {
        if (logTable.getSelectedRowCount() > 0 && e.getValueIsAdjusting()) {
            int[] cols = logTable.getSelectedRows();
            DefaultTableModel mod = (DefaultTableModel) detailTable.getModel();
            mod.setRowCount(0);
            Map<String, SVNLogEntryPath> map = new HashMap<>();
            for (int i : cols) {
                i = logTable.convertRowIndexToModel(i);//排序后要转移行号
                Object key1 = logTable.getModel().getValueAt(i, 1);
                map.putAll(detailData.get(Long.valueOf(key1.toString())));
            }
            for (Map.Entry<String, SVNLogEntryPath> entrySet : map.entrySet()) {
                SVNLogEntryPath path1 = entrySet.getValue();
                mod.addRow(new Object[]{path1.getPath(), getType(path1.getType()), path1.getCopyPath(), getCopyRevision(path1.getCopyRevision())});
            }
            statusLabel.setText("共选择了" + logTable.getSelectedRowCount() + "条日志,共选择了" + detailTable.getSelectedRowCount() + "个文件(不选择默认全部[" + detailTable.getRowCount() + "])");
        }
    }
}
 
开发者ID:ajtdnyy,项目名称:PackagePlugin,代码行数:44,代码来源:MainFrame.java

示例8: listVersions

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
/**
 * Lists all versions of this metadata object available in the subversion
 * repository
 *
 * @return all stored versions of this metadata object
 */
@SuppressWarnings("unchecked")
public List<MCRMetadataVersion> listVersions() throws IOException {
    try {
        List<MCRMetadataVersion> versions = new ArrayList<>();
        SVNRepository repository = getStore().getRepository();
        String path = getFilePath();
        String dir = getDirectory();

        Collection<SVNLogEntry> entries = null;
        try {
            entries = repository.log(new String[] { dir }, null, 0, repository.getLatestRevision(), true, true);
        } catch (Exception ioex) {
            LOGGER.error("Could not get versions", ioex);
            return versions;
        }

        for (SVNLogEntry entry : entries) {
            SVNLogEntryPath svnLogEntryPath = entry.getChangedPaths().get(path);
            if (svnLogEntryPath != null) {
                char type = svnLogEntryPath.getType();
                versions.add(new MCRMetadataVersion(this, entry, type));
            }
        }
        return versions;
    } catch (SVNException svnExc) {
        throw new IOException(svnExc);
    }
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:35,代码来源:MCRVersionedMetadata.java

示例9: getRevision

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
public MCRMetadataVersion getRevision(long revision) throws IOException {
    try {
        if (revision < 0) {
            revision = getLastPresentRevision();
            if (revision < 0) {
                LOGGER.warn(
                    MessageFormat.format("Metadata object {0} in store {1} has no last revision!", getID(),
                        getStore().getID()));
                return null;
            }
        }
        SVNRepository repository = getStore().getRepository();
        String path = getFilePath();
        String dir = getDirectory();
        @SuppressWarnings("unchecked")
        Collection<SVNLogEntry> log = repository.log(new String[] { dir }, null, revision, revision, true, true);
        for (SVNLogEntry logEntry : log) {
            SVNLogEntryPath svnLogEntryPath = logEntry.getChangedPaths().get(path);
            if (svnLogEntryPath != null) {
                char type = svnLogEntryPath.getType();
                return new MCRMetadataVersion(this, logEntry, type);
            }
        }
        LOGGER.warn(MessageFormat.format("Metadata object {0} in store {1} has no revision ''{2}''!", getID(),
            getStore().getID(),
            getRevision()));
        return null;
    } catch (SVNException svnExc) {
        throw new IOException(svnExc);
    }
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:32,代码来源:MCRVersionedMetadata.java

示例10: handleLogEntry

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
@Override
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
    SVNLogEntryPath svnLogEntryPath = logEntry.getChangedPaths().get(path);
    if (svnLogEntryPath != null) {
        char type = svnLogEntryPath.getType();
        if (deleted || type != SVNLogEntryPath.TYPE_DELETED) {
            lastRevision = logEntry.getRevision();
            //no other way to stop svnkit from logging
            throw new LastRevisionFoundException();
        }
    }
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:13,代码来源:MCRVersionedMetadata.java

示例11: createStream

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
/**
 * @작성자 : KYJ
 * @작성일 : 2016. 7. 19.
 * @param allLogs
 * @return
 */
public Stream<GargoyleSVNLogEntryPath> createStream(Collection<SVNLogEntry> allLogs) {
	Stream<GargoyleSVNLogEntryPath> filter = allLogs.stream().flatMap(v -> {
		Map<String, SVNLogEntryPath> changedPaths = v.getChangedPaths();
		long revision = v.getRevision();
		Date date = v.getDate();
		if (ValueUtil.isNotEmpty(changedPaths)) {
			Set<String> keySet = changedPaths.keySet();
			Iterator<String> iterator = keySet.iterator();

			Set<GargoyleSVNLogEntryPath> arrayList = new HashSet<>(changedPaths.size());
			while (iterator.hasNext()) {
				String next = iterator.next();
				SVNLogEntryPath svnLogEntryPath = changedPaths.get(next);
				SVNNodeKind kind = svnLogEntryPath.getKind();
				/*2016-09-02 File이면서 UNKNOWN으로 리턴되는 경우가 존재해서 추가.*/
				if (SVNNodeKind.FILE == kind || SVNNodeKind.UNKNOWN == kind ) {
					GargoyleSVNLogEntryPath e = new GargoyleSVNLogEntryPath(svnLogEntryPath.getPath(), svnLogEntryPath.getType(),
							svnLogEntryPath.getPath(), revision, kind);
					e.setDate(date);
					arrayList.add(e);
				}
			}
			return arrayList.stream();
		}
		return null;
	}).filter(v -> v != null).sorted((a1, a2) ->{
		return ~Long.compare(a1.getDate().getTime(), a2.getDate().getTime());
	}).distinct();

	return filter;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:38,代码来源:SimpleSVNHistoryDataSupplier.java

示例12: equals

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
/**
 * Compares this object with another one.
 *
 * @param obj
 *            an object to compare with
 * @return <span class="javakeyword">true</span> if this object is the same as the <code>obj</code> argument
 */
public boolean equals(Object obj) {
	if (this == obj) {
		return true;
	}
	if (obj == null || !(obj instanceof SVNLogEntryPath)) {
		return false;
	}
	final SVNLogEntryPath other = (SVNLogEntryPath) obj;
	return getCopyRevision() == other.getCopyRevision() && getPath().equals(other.getPath());
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:18,代码来源:GargoyleSVNLogEntryPath.java

示例13: handleLogEntry

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
@Override
public void handleLogEntry(SVNLogEntry entry) throws SVNException {
	Map<String, SVNLogEntryPath> paths = entry.getChangedPaths();
	Collection<SVNLogEntryPath> files = paths.values();
	Commit commit = new Commit(entry.getMessage());
	commit.setRevision(String.valueOf(entry.getRevision()));
	commit.setDate(String.valueOf(entry.getDate()));
	for (SVNLogEntryPath svnLogEntryPath : files) {
		commit.addFile(svnLogEntryPath.getPath());
	}
	commits.add(commit);
}
 
开发者ID:aserg-ufmg,项目名称:ModularityCheck,代码行数:13,代码来源:SVNLogHandler.java

示例14: log

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
public List<ChangeInfo> log(final String path, final long limit, final LogEntryFilter logEntryFilter, final boolean stopOnCopy, final long startRevision, final long endRevision) throws PageStoreAuthenticationException, PageStoreException {
  return execute(new SVNAction<List<ChangeInfo>>() {
    public List<ChangeInfo> perform(final BasicSVNOperations operations, final SVNRepository repository) throws SVNException, PageStoreException {
      final List<ChangeInfo> entries = new LinkedList<ChangeInfo>();
      // Start and end reversed to get newest changes first.
      SVNRepository repos = getSVNReposForRevision(_repository, endRevision);
      try {
        final String[] rootPath = {repos.getRepositoryPath("")};
        repos.log(new String[] { path }, endRevision, startRevision, true, stopOnCopy, limit, new ISVNLogEntryHandler() {
          public void handleLogEntry(final SVNLogEntry logEntry) throws SVNException {
            // Has the wiki root been renamed?  If so then follow the rename.
            if (logEntry.getChangedPaths().containsKey(rootPath[0])) {
              SVNLogEntryPath changedPath = (SVNLogEntryPath) logEntry.getChangedPaths().get(rootPath[0]);
              if (changedPath.getCopyPath() != null) {
                rootPath[0] = changedPath.getCopyPath();
              }
            }
            entries.addAll(logEntryToChangeInfos(rootPath[0], path, logEntry, logEntryFilter));
          }
        });
        return entries;
      }
      finally {
        repos.closeSession();
      }
    }
  });
}
 
开发者ID:CoreFiling,项目名称:reviki,代码行数:29,代码来源:RepositoryBasicSVNOperations.java

示例15: testPageRenameInWiki

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入依赖的package包/类
public void testPageRenameInWiki() throws Exception {
  // NB. Testing renaming into another wiki isn't possible here as a call to 'svn info' will occur when trying to work out the repository root.
  String rootPath = "/wiki2";
  String path = rootPath + "/ThisIsAPage";
  ChangeInfo changeInfo = RepositoryBasicSVNOperations.classifiedChange(getTestRepo(), new SVNLogEntry(Collections.singletonMap(path, new SVNLogEntryPath(rootPath + "/NewPage", 'A', path, 3)), 11, "", null, ""), rootPath, path);
  assertNotNull(changeInfo.getRenamedTo());
  assertEquals("NewPage", changeInfo.getRenamedTo().getPageName());
}
 
开发者ID:CoreFiling,项目名称:reviki,代码行数:9,代码来源:TestRepositoryBasicSVNOperations.java


注:本文中的org.tmatesoft.svn.core.SVNLogEntryPath类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。