org.tigris.subversion.svnclientadapter.ISVNLogMessage Java Examples

The following examples show how to use org.tigris.subversion.svnclientadapter.ISVNLogMessage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LogTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void assertLogs(ISVNLogMessage[] logsRef, ISVNLogMessage[] logsNb) {
    assertEquals(logsRef.length, logsNb.length);
    for (int i = 0; i < logsNb.length; i++) {
        ISVNLogMessage lognb = logsNb[i];
        ISVNLogMessage logref = logsRef[i];            
        
        assertEquals(logref.getAuthor(), lognb.getAuthor());
        assertEquals(logref.getDate().toString(), lognb.getDate().toString());
        assertEquals(logref.getMessage(), lognb.getMessage());
        assertEquals(logref.getRevision(), lognb.getRevision());
        
        ISVNLogMessageChangePath[] pathsnb = lognb.getChangedPaths();
        ISVNLogMessageChangePath[] pathsref = lognb.getChangedPaths();
        assertChangePaths(pathsref, pathsnb);
    }
}
 
Example #2
Source File: CommitAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private static void afterCommit(Collection<SvnHook> hooks, List<File> files, String message, List<ISVNLogMessage> logs) {
    if(hooks.isEmpty()) {
        return;
    }
    List<SvnHookContext.LogEntry> entries = new ArrayList<SvnHookContext.LogEntry>(logs.size());
    for (int i = 0; i < logs.size(); i++) {
        entries.add(
            new SvnHookContext.LogEntry(
                    logs.get(i).getMessage(),
                    logs.get(i).getAuthor(),
                    logs.get(i).getRevision().getNumber(),
                    logs.get(i).getDate()));
    }
    SvnHookContext context = new SvnHookContext(files.toArray(new File[files.size()]), message, entries);
    for (SvnHook hook : hooks) {
        hook.afterCommit(context);
    }
}
 
Example #3
Source File: ResolveTreeConflictWizard.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private ISVNLogMessage[] getLogMessages() throws Exception {
	if (logMessages == null) {
		ISVNClientAdapter svnClient = null;
		try {
			svnClient = svnResource.getRepository().getSVNClient();
			IProject project = treeConflict.getResource().getProject();
			ISVNLocalResource svnProject =  SVNWorkspaceRoot.getSVNResourceFor(project);
			SVNRevision revision1 = new SVNRevision.Number(treeConflict.getConflictDescriptor().getSrcLeftVersion().getPegRevision());
			SVNRevision revision2 = new SVNRevision.Number(treeConflict.getConflictDescriptor().getSrcRightVersion().getPegRevision());
			logMessages = svnClient.getLogMessages(svnProject.getUrl(), revision1, revision2, true); 
		} catch (Exception e) {
			throw e;
		}
		finally {
			svnResource.getRepository().returnSVNClient(svnClient);
		}
	}
	return logMessages;
}
 
Example #4
Source File: CommitAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Returns log message for given revision
 * @param client
 * @param file
 * @param revision
 * @return log message
 * @throws org.tigris.subversion.svnclientadapter.SVNClientException
 */
private static ISVNLogMessage getLogMessage (ISVNClientAdapter client, File file, long revision) throws SVNClientException {
    SVNRevision rev = SVNRevision.HEAD;
    ISVNLogMessage log = null;
    try {
        rev = SVNRevision.getRevision(String.valueOf(revision));
    } catch (ParseException ex) {
        Subversion.LOG.log(Level.WARNING, "" + revision, ex);
    }
    if (Subversion.LOG.isLoggable(Level.FINER)) {
        Subversion.LOG.log(Level.FINER, "{0}: getting last commit message for svn hooks", CommitAction.class.getName());
    }
    // log has to be called directly on the file
    final SVNUrl fileRepositoryUrl = SvnUtils.getRepositoryUrl(file);
    ISVNLogMessage[] ls = client.getLogMessages(fileRepositoryUrl, rev, rev);
    if (ls.length > 0) {
        log = ls[0];
    } else {
        Subversion.LOG.log(Level.WARNING, "no logs available for file {0} with repo url {1}", new Object[]{file, fileRepositoryUrl});
    }
    return log;
}
 
Example #5
Source File: RemoteResource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public ISVNLogMessage[] getLogMessages(SVNRevision pegRevision,
		SVNRevision revisionStart, SVNRevision revisionEnd,
		boolean stopOnCopy, boolean fetchChangePath, long limit, boolean includeMergedRevisions)
		throws TeamException {
   	ISVNClientAdapter svnClient = repository.getSVNClient();
	try {
		return svnClient.getLogMessages(getUrl(),
				pegRevision, revisionStart, revisionEnd, stopOnCopy, fetchChangePath,
				limit, includeMergedRevisions);
	} catch (SVNClientException e) {
		throw new TeamException("Failed in RemoteResource.getLogMessages()",
				e);
	}
	finally {
		repository.returnSVNClient(svnClient);
	}
}
 
Example #6
Source File: BaseResource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public ISVNLogMessage[] getLogMessages(SVNRevision pegRevision,
		SVNRevision revisionStart, SVNRevision revisionEnd,
		boolean stopOnCopy, boolean fetchChangePath, long limit, boolean includeMergedRevisions)
		throws TeamException {
   	ISVNClientAdapter svnClient = getRepository().getSVNClient();
	try {
		return svnClient.getLogMessages(getFile(), pegRevision,
				revisionStart, revisionEnd, stopOnCopy, fetchChangePath,
				limit, includeMergedRevisions);
	} catch (SVNClientException e) {
		throw new TeamException("Failed in BaseResource.getLogMessages()",
				e);
	}
	finally {
		getRepository().returnSVNClient(svnClient);
	}
}
 
Example #7
Source File: ShowAnnotationOperation.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private String getSingleEntry(ISVNRemoteFile file, Long revLong) {
	ISVNClientAdapter client = null;
	try {
		client = file.getRepository().getSVNClient();
		SVNRevision revision = SVNRevision.getRevision(revLong.toString());
		ISVNLogMessage [] messages = client.getLogMessages(file.getRepository().getRepositoryRoot(), revision, revision, false);
		if (messages.length == 1)
			return messages[0].getMessage();
		else
			return null;
	} catch (Exception e) {
		return null;
	}
	finally {
		file.getRepository().returnSVNClient(client);
	}
}
 
Example #8
Source File: LogEntry.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * create the LogEntry for the logMessages
 * @param logMessages
 * @return
 */
public static ILogEntry[] createLogEntriesFrom(ISVNRemoteFile remoteFile, ISVNLogMessage[] logMessages, Tags[] tags, SVNUrl[] urls) {
    ILogEntry[] result = new ILogEntry[logMessages.length]; 
    for (int i = 0; i < logMessages.length;i++) {
        ISVNLogMessage logMessage = logMessages[i];
        ISVNRemoteResource correspondingResource;
        correspondingResource = new RemoteFile(
                    null,
                    remoteFile.getRepository(), 
                    urls[i], 
                    logMessage.getRevision(), 
                    logMessage.getRevision(), 
                    logMessage.getDate(), 
                    logMessage.getAuthor());  
        result[i] = new LogEntry(logMessage, remoteFile, correspondingResource, (tags[i] != null) ? tags[i].getTags() : null);
    }
    return result;
}
 
Example #9
Source File: LogEntry.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private ISVNLogMessageChangePath[] getPathsOnDemand(SVNUrl url) {
ISVNLogMessage[] tmpMessage;
ISVNClientAdapter client = null;
      try {
          client = SVNProviderPlugin.getPlugin().getSVNClient(); // errors will not log to console
          SVNProviderPlugin.disableConsoleLogging(); 
          tmpMessage = client.getLogMessages(url, getRevision(), getRevision(), true);
          SVNProviderPlugin.enableConsoleLogging(); 
       if (tmpMessage != null && tmpMessage.length > 0)
	    return tmpMessage[0].getChangedPaths();
	else
	    return null;
      } catch (Exception e) {
          SVNProviderPlugin.enableConsoleLogging(); 
          return null;
      } finally {
       SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
      }
  }
 
Example #10
Source File: MoveTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testMoveURL2URLPrevRevision(String srcPath,
                                         String targetFileName) throws Exception {
    createAndCommitParentFolders(srcPath);
    File file = createFile(srcPath);
    write(file, 1);
    add(file);
    commit(file);
    SVNRevision prevRev = getRevision(file);
    write(file, 2);
    commit(getWC());        
    
    File filemove = createFile(renameFile(srcPath, targetFileName));
    filemove.delete(); // we're operating with repository directly, cannot leave unversioned files lying on disk (they would be committed in the next round)
    
    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(file), getFileUrl(filemove), "move", prevRev);

    ISVNLogMessage[] logs = getLog(getFileUrl(filemove));
    assertEquals(((SVNRevision.Number)prevRev).getNumber() ,logs[0].getChangedPaths()[0].getCopySrcRevision().getNumber());

    InputStream is = getContent(getFileUrl(filemove));
    assertContents(is, 1);
    assertNotifiedFiles(new File[] {});        
}
 
Example #11
Source File: CopyTestHidden.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void testCopyURL2URLPrevRevision(String srcPath,
                                         String targetFileName) throws Exception {
    createAndCommitParentFolders(srcPath);
    File file = createFile(srcPath);
    write(file, 1);
    add(file);
    commit(file);
    SVNRevision prevRev = getRevision(file);
    write(file, 2);
    commit(getWC());

    File filecopy = createFile(renameFile(srcPath, targetFileName));
    filecopy.delete();

    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(file), getFileUrl(filecopy), "copy", prevRev);

    ISVNLogMessage[] logs = getLog(getFileUrl(filecopy));
    assertEquals(((SVNRevision.Number)prevRev).getNumber() ,logs[0].getChangedPaths()[0].getCopySrcRevision().getNumber());

    InputStream is = getContent(getFileUrl(filecopy));
    assertContents(is, 1);
    assertNotifiedFiles(new File[] {});
}
 
Example #12
Source File: AbstractJhlClientAdapter.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private ISVNLogMessage[] getMergeinfoLog(int kind, String target,
		SVNRevision pegRevision, SVNUrl mergeSourceUrl,
		SVNRevision srcPegRevision, boolean discoverChangedPaths)
		throws SVNClientException {
	try {
		notificationHandler
				.setCommand(ISVNNotifyListener.Command.MERGEINFO);
		String show = "";
		org.apache.subversion.javahl.types.Mergeinfo.LogKind mergeKind = org.apache.subversion.javahl.types.Mergeinfo.LogKind.eligible;
		if (kind == ISVNMergeinfoLogKind.eligible)
			show = show + " --show-revs eligible ";
		if (kind == ISVNMergeinfoLogKind.merged) {
			show = show + " --show-revs merged ";
			mergeKind = org.apache.subversion.javahl.types.Mergeinfo.LogKind.merged;
		}
		notificationHandler.logCommandLine("mergeinfo " + show
				+ mergeSourceUrl.toString() + " " + target);
		SVNLogMessageCallback worker = new SVNLogMessageCallback();
		JhlLogMessageCallback callback = new JhlLogMessageCallback(worker);
		Set<String> revProps = new HashSet<String>();
		revProps.add("svn:author");
		revProps.add("svn:date");
		revProps.add("svn:log");
		svnClient.getMergeinfoLog(mergeKind, target,
				JhlConverter.convert(pegRevision),
				mergeSourceUrl.toString(),
				JhlConverter.convert(srcPegRevision), discoverChangedPaths,
				Depth.infinity, revProps, callback);
		return worker.getLogMessages();
	} catch (ClientException e) {
		if (e.getAprError() == ErrorCodes.unsupportedFeature) {
			return this.getLogMessages(mergeSourceUrl, srcPegRevision,
					new SVNRevision.Number(0), SVNRevision.HEAD, true,
					discoverChangedPaths, 0, false);
		}
		notificationHandler.logException(e);
		throw new SVNClientException(e);
	}
}
 
Example #13
Source File: RepositoryRevision.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public RepositoryRevision(ISVNLogMessage message, SVNUrl rootUrl, File[] selectionRoots,
        Map<String,File> pathToRoot, Map<String, SVNRevision> pegRevisions) {
    this.message = message;
    this.repositoryRootUrl = rootUrl;
    this.selectionRoots = selectionRoots;
    support = new PropertyChangeSupport(this);
    this.pathToRoot = pathToRoot;
    this.pegRevisions = pegRevisions;
    initFakeRootEvent();
}
 
Example #14
Source File: LogTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void assertLogMessage(ISVNInfo info, ISVNLogMessage logsNb, String msg, ISVNLogMessageChangePath[] changePaths) {
    assertEquals(info.getLastCommitAuthor(), logsNb.getAuthor());
    assertEquals(info.getLastChangedDate().toString(), logsNb.getDate().toString());
    assertEquals(msg, logsNb.getMessage());
    assertEquals(info.getRevision(), logsNb.getRevision());
    assertChangePaths(changePaths, logsNb.getChangedPaths());
}
 
Example #15
Source File: SvnSearchView.java    From netbeans with Apache License 2.0 5 votes vote down vote up
SVNRevision getSelectedValue() {
    Object selection = resultsList.getSelectedValue();
    if(selection == null) {
        return null;
    }
    if(!(selection instanceof ISVNLogMessage)) {
        return null;
    }
    ISVNLogMessage message = (ISVNLogMessage) selection;
    return message.getRevision();
}
 
Example #16
Source File: LogTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void logLimit(Log log) throws Exception {                                
    File file = createFile("file");
    add(file);
    write(file, "1");        
    commit(file, "msg1");
    ISVNInfo info1 = getInfo(file);        
    
    write(file, "2");
    commit(file, "msg2");
    ISVNInfo info2 = getInfo(file);
    
    write(file, "3");
    commit(file, "msg3");

    ISVNLogMessage[] logsNb = null;
    switch(log) {
        case file:
            logsNb = getNbClient().getLogMessages(file, new SVNRevision.Number(0), SVNRevision.HEAD, false, true, 2);
            break;
        case url:
            logsNb = getNbClient().getLogMessages(getFileUrl(file), null, new SVNRevision.Number(0), SVNRevision.HEAD, false, true, 2);
            break;
        default:
            fail("no idea!");
    }
    
    // test
    assertEquals(2, logsNb.length);         
    String testName = getName();        
    assertLogMessage(info1, logsNb[0], "msg1",  new ISVNLogMessageChangePath[] { new ChangePath('A', "/" + testName + "/" + testName + "_wc/file", null, null) });
    assertLogMessage(info2, logsNb[1], "msg2",  new ISVNLogMessageChangePath[] { new ChangePath('M', "/" + testName + "/" + testName + "_wc/file", null, null) });
}
 
Example #17
Source File: CancelableSVNLogMessageCallback.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void singleMessage(ISVNLogMessage msg) {
	super.singleMessage(msg);
	if (monitor != null && monitor.isCanceled() && !canceled) {
		try {
			svnClient.cancelOperation();
			canceled = true;
		} catch (SVNClientException e) {
			SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
		}
	}
}
 
Example #18
Source File: MergeTestHidden.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void testFolderMergeRec() throws Exception {                                        
    File folder = createFolder("folder");
    add(folder);
    commit(folder);
    assertInfo(folder, getFileUrl(folder));
    
    File foldercopy = new File(getWC(), "foldercopy");
    
    ISVNClientAdapter c = getNbClient();
    c.copy(getFileUrl(folder), getFileUrl(foldercopy), "copy", SVNRevision.HEAD);
    c.switchToUrl(folder, getFileUrl(foldercopy), SVNRevision.HEAD, true);

    assertCopy(getFileUrl(foldercopy));
    assertInfo(folder, getFileUrl(foldercopy));
    
    File folder1 = createFolder(folder, "folder1");
    File file = createFile(folder, "file");
    File file1 = createFile(folder1, "file");
    add(file);
    add(folder1);
    add(file1);
    commit(folder);
    assertTrue(file.exists());
    
    c.switchToUrl(folder, getFileUrl(folder), SVNRevision.HEAD, true);
    assertCopy(getFileUrl(folder));
    assertInfo(folder, getFileUrl(folder));        
    assertFalse(file.exists());
    assertFalse(file1.exists());
    assertFalse(folder1.exists());
    
    ISVNLogMessage[] log = getCompleteLog(getFileUrl(folder));
    c.merge(getFileUrl(foldercopy), log[0].getRevision(), getFileUrl(foldercopy), SVNRevision.HEAD, folder, false, true);
    assertTrue(file.exists());
    assertTrue(file1.exists());
    assertTrue(folder1.exists());
    assertNotifiedFiles(new File[] {file, file1, folder1});        
}
 
Example #19
Source File: CommitAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private ISVNLogMessage getLogMessage (File[] files, long revision) throws SVNClientException {
    ISVNLogMessage revisionLog = null;
    long maxPause = COMMIT_PAUSE;
    long nextPause = 500;
    for (int i = 0; i < files.length && revisionLog == null; ++i) {
        try {
            File f = files[i];
            // an existing file needs to be found, log over a deleted file fails
            while (!f.exists()) {
                f = f.getParentFile();
            }
            revisionLog = CommitAction.getLogMessage(client, f, revision);
        } catch (SVNClientException ex) {
            if (SvnClientExceptionHandler.isNoSuchRevision(ex.getMessage())) {
                Logger.getLogger(CommitAction.class.getName()).log(Level.INFO,
                        "After commit pause for {0} ms. No such revision {1}", //NOI18N
                        new Object[] { nextPause, revision });
                if (maxPause > 0) {
                    try {
                        Thread.sleep(nextPause);
                    } catch (InterruptedException ex1) {
                        // not interested
                    }
                    maxPause -= nextPause;
                    nextPause = nextPause * 2;
                    i--;
                    continue;
                }
            }
            if (!SvnClientExceptionHandler.isFileNotFoundInRevision(ex.getMessage())) {
                throw ex;
            }
        }
    }
    return revisionLog;
}
 
Example #20
Source File: SVNChangeSetCollector.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
   * Fetch the comment of the given SyncInfo
   * @param info info to get comment for
   * @return the comment
   */
  private String fetchComment(SVNStatusSyncInfo info) {
String fetchedComment = Policy.bind("SynchronizeView.standardIncomingChangeSetComment"); // $NON-NLS-1$
  	IResourceVariant remoteResource = info.getRemote();
  	if (remoteResource instanceof ISVNRemoteResource) {
  		ISVNRemoteResource svnRemoteResource = (ISVNRemoteResource)remoteResource;
  		ISVNClientAdapter client = null;
  		try {
		client = svnRemoteResource.getRepository().getSVNClient();
   		SVNUrl url = svnRemoteResource.getRepository().getRepositoryRoot();
   		SVNRevision rev = svnRemoteResource.getLastChangedRevision();
   		ISVNLogMessage[] logMessages = client.getLogMessages(url, rev, rev, false);
		if (logMessages.length != 0) {
			String logComment = logMessages[0].getMessage();
			if (logComment.trim().length() != 0) {
				fetchedComment = flattenComment(logComment); 
			} else {
				fetchedComment = "";
			}
		}
	} catch (SVNException e1) {
		if (!e1.operationInterrupted()) {
			SVNUIPlugin.log(e1);
		}
	} catch (SVNClientException e) {
		SVNUIPlugin.log(SVNException.wrapException(e));
	}
  		finally {
  			svnRemoteResource.getRepository().returnSVNClient(client);
  		}
 		}
  	return fetchedComment;
  }
 
Example #21
Source File: GetLogsCommand.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private Tags[] getTags(ISVNLogMessage[] logMessages) throws NumberFormatException {
	Tags[] tags = new Tags[logMessages.length]; 
       for (int i = 0; i < logMessages.length;i++) {
       	if (tagManager != null) {
       		String rev = logMessages[i].getRevision().toString();
       		int revNo = Integer.parseInt(rev);
       		tags[i] = new Tags(tagManager.getTags(revNo));
       	}
       }
	return tags;
}
 
Example #22
Source File: CommandlineClient.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public ISVNLogMessage[] getLogMessages(File file, SVNRevision pegRevision, SVNRevision revStart, SVNRevision revEnd, boolean stopOnCopy, boolean fetchChangePath, long limit, boolean includeMergedRevisions) throws SVNClientException {
    LogCommand logCmd;
    ISVNInfo info = getInfoFromWorkingCopy(file);
    if (info.getSchedule().equals(SVNScheduleKind.ADD) &&
        info.getCopyUrl() != null)
    {
        logCmd = new LogCommand(info.getCopyUrl(), null, revStart, revEnd, pegRevision, stopOnCopy, fetchChangePath, limit);
    } else {
        logCmd = new LogCommand(file, revStart, revEnd, pegRevision, stopOnCopy, fetchChangePath, limit);
    }
    return getLog(logCmd);
}
 
Example #23
Source File: LogEntry.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
    * creates a LogEntry
    * @param logMessage
    * @param resource the corresponding remote resource or null
    * @param repository
    */
private LogEntry(
           ISVNLogMessage logMessage,
           ISVNResource resource,
           ISVNRemoteResource remoteResource,
           Alias[] tags) {
       this.logMessage = logMessage;
       this.remoteResource = remoteResource;
       this.resource = resource;
       this.tags = tags;
}
 
Example #24
Source File: LogEntry.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * create the LogEntry for the logMessages
 * @param logMessages
 * @return
 */
public static ILogEntry[] createLogEntriesFrom(ISVNRemoteFolder remoteFolder, ISVNLogMessage[] logMessages, Tags[] tags) {
    // if we get the history for a folder, we get the history for all
    // its members
	// so there is no remoteResource associated with each LogEntry
    ILogEntry[] result = new ILogEntry[logMessages.length]; 
    for (int i = 0; i < logMessages.length;i++) {
    	result[i] = new LogEntry(logMessages[i], remoteFolder, null, (tags[i] != null) ? tags[i].getTags() : null); 
    }
    return result;
}
 
Example #25
Source File: LogEntry.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public ILogEntry[] getChildMessages() {
	ISVNLogMessage[] childMessages = logMessage.getChildMessages();
	if (childMessages == null) return null;
	ILogEntry[] childEntries = new ILogEntry[childMessages.length];
	for (int i = 0; i < childMessages.length; i++) {
		childEntries[i] = new LogEntry(childMessages[i], resource, remoteResource, null);
	}
	return childEntries;
}
 
Example #26
Source File: JhlLogMessage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public ISVNLogMessage[] getChildMessages() {
	if (hasChildren && children != null) {
		ISVNLogMessage[] childArray = new JhlLogMessage[children.size()];
		children.toArray(childArray);
		return childArray;
	} else
		return null;
}
 
Example #27
Source File: AbstractJhlClientAdapter.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public ISVNLogMessage[] getMergeinfoLog(int kind, File path,
		SVNRevision pegRevision, SVNUrl mergeSourceUrl,
		SVNRevision srcPegRevision, boolean discoverChangedPaths)
		throws SVNClientException {
	return this.getMergeinfoLog(kind, fileToSVNPath(path, false),
			pegRevision, mergeSourceUrl, srcPegRevision,
			discoverChangedPaths);
}
 
Example #28
Source File: AbstractJhlClientAdapter.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public ISVNLogMessage[] getMergeinfoLog(int kind, SVNUrl url,
		SVNRevision pegRevision, SVNUrl mergeSourceUrl,
		SVNRevision srcPegRevision, boolean discoverChangedPaths)
		throws SVNClientException {
	return this.getMergeinfoLog(kind, url.toString(), pegRevision,
			mergeSourceUrl, srcPegRevision, discoverChangedPaths);
}
 
Example #29
Source File: GetLogsCommand.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
/**
 * execute the command
 * @param aMonitor
 * @throws SVNException
 */
public void run(IProgressMonitor aMonitor) throws SVNException {
	ISVNRepositoryLocation repository = null;
	ISVNClientAdapter svnClient = null;
    logEntries = null;
    IProgressMonitor monitor = Policy.monitorFor(aMonitor);
    monitor.beginTask(Policy.bind("RemoteFile.getLogEntries"), 100); //$NON-NLS-1$
    
    ISVNLogMessage[] logMessages;
    try {
    	if (callback == null) {
         logMessages = remoteResource.getLogMessages(
                 pegRevision,
                 revisionStart,
                 revisionEnd, 
                 stopOnCopy,
                 !SVNProviderPlugin.getPlugin().getSVNClientManager().isFetchChangePathOnDemand(),
                 limit, includeMergedRevisions);
    	} else {
    		repository = remoteResource.getRepository();
    		svnClient = repository.getSVNClient();
    		if (remoteResource instanceof BaseResource) {
    			boolean logMessagesRetrieved = false;
    			ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(remoteResource.getResource());
    			if (svnResource != null) {
    				LocalResourceStatus status = svnResource.getStatus();
    				if (status != null && status.isCopied()) {
    					ISVNInfo info = svnClient.getInfoFromWorkingCopy(svnResource.getFile());
    					SVNUrl copiedFromUrl = info.getCopyUrl();
    					if (copiedFromUrl != null) {
    						svnClient.getLogMessages(copiedFromUrl, SVNRevision.HEAD, revisionStart, revisionEnd, stopOnCopy, !SVNProviderPlugin.getPlugin().getSVNClientManager().isFetchChangePathOnDemand(), limit, includeMergedRevisions, ISVNClientAdapter.DEFAULT_LOG_PROPERTIES, callback);
    						logMessagesRetrieved = true;
    		        		GetRemoteResourceCommand getRemoteResourceCommand = new GetRemoteResourceCommand(remoteResource.getRepository(), copiedFromUrl, SVNRevision.HEAD);
    		        		getRemoteResourceCommand.run(null);
    		        		remoteResource = getRemoteResourceCommand.getRemoteResource();
    					}
    				}
    			}
    			if (!logMessagesRetrieved) svnClient.getLogMessages(((BaseResource)remoteResource).getFile(), pegRevision, revisionStart, revisionEnd, stopOnCopy, !SVNProviderPlugin.getPlugin().getSVNClientManager().isFetchChangePathOnDemand(), limit, includeMergedRevisions, ISVNClientAdapter.DEFAULT_LOG_PROPERTIES, callback);
    		} else {
    			svnClient.getLogMessages(remoteResource.getUrl(), pegRevision, revisionStart, revisionEnd, stopOnCopy, !SVNProviderPlugin.getPlugin().getSVNClientManager().isFetchChangePathOnDemand(), limit, includeMergedRevisions, ISVNClientAdapter.DEFAULT_LOG_PROPERTIES, callback);
    		}
    		logMessages = callback.getLogMessages();
    	}
        if (remoteResource.isFolder()) {
            logEntries = LogEntry.createLogEntriesFrom((ISVNRemoteFolder) remoteResource, logMessages, getTags(logMessages));   
        } else {
        	logEntries = LogEntry.createLogEntriesFrom((ISVNRemoteFile) remoteResource, logMessages, getTags(logMessages), getUrls(logMessages));
        }

    } catch (Exception e) {
        throw SVNException.wrapException(e);
    } finally {
    	if (repository != null) {
    		repository.returnSVNClient(svnClient);
    	}
    	monitor.done();
    }
}
 
Example #30
Source File: JhlLogMessage.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void addChild(ISVNLogMessage msg) {
	if (children == null)
		children = new ArrayList<ISVNLogMessage>();
	children.add(msg);
}