本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNCommitClient类的典型用法代码示例。如果您正苦于以下问题:Java SVNCommitClient类的具体用法?Java SVNCommitClient怎么用?Java SVNCommitClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVNCommitClient类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNCommitClient类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doImport
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
@Override
public long doImport(@NotNull File path,
@NotNull SVNURL url,
@Nullable Depth depth,
@NotNull String message,
boolean noIgnore,
@Nullable CommitEventHandler handler,
@Nullable ISVNCommitHandler commitHandler) throws VcsException {
SVNCommitClient client = myVcs.getSvnKitManager().createCommitClient();
client.setEventHandler(toEventHandler(handler));
client.setCommitHandler(commitHandler);
try {
SVNCommitInfo info = client.doImport(path, url, message, null, !noIgnore, false, toDepth(depth));
return info.getNewRevision();
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SvnKitImportClient.java
示例2: doDelete
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
private boolean doDelete(final SVNURL url, final String comment) {
final SVNException[] exception = new SVNException[1];
final Project project = myBrowserComponent.getProject();
Runnable command = new Runnable() {
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText(SvnBundle.message("progres.text.deleting", url.toString()));
}
SvnVcs vcs = SvnVcs.getInstance(project);
try {
SVNCommitClient committer = vcs.createCommitClient();
committer.doDelete(new SVNURL[]{url}, comment);
}
catch (SVNException e) {
exception[0] = e;
}
}
};
ProgressManager.getInstance().runProcessWithProgressSynchronously(command, SvnBundle.message("progress.title.browser.delete"), false, project);
if (exception[0] != null) {
Messages.showErrorDialog(exception[0].getMessage(), SvnBundle.message("message.text.error"));
}
return exception[0] == null;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:RepositoryBrowserDialog.java
示例3: doMkdir
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
protected static void doMkdir(final SVNURL url, final String comment, final Project project) {
final SVNException[] exception = new SVNException[1];
Runnable command = new Runnable() {
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText(SvnBundle.message("progress.text.browser.creating", url.toString()));
}
SvnVcs vcs = SvnVcs.getInstance(project);
try {
SVNCommitClient committer = vcs.createCommitClient();
committer.doMkDir(new SVNURL[] {url}, comment);
}
catch (SVNException e) {
exception[0] = e;
}
}
};
ProgressManager.getInstance().runProcessWithProgressSynchronously(command, SvnBundle.message("progress.text.create.remote.folder"), false, project);
if (exception[0] != null) {
Messages.showErrorDialog(exception[0].getMessage(), SvnBundle.message("message.text.error"));
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:RepositoryBrowserDialog.java
示例4: doSvnDelete
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
public void doSvnDelete (
String baseConfigUrl, List<File> filesToDelete,
String scmUserid, String encodedPass,
String svnBranch, String comment,
BufferedWriter outputWriter )
throws Exception {
updateProgress( outputWriter, "Starting delete of files: " + filesToDelete );
// if ( !fileToDelete.exists() ) {
// updateProgress( outputWriter, "Skipping - file does not exist" );
// logger.info( "File does not exist - do nothing" );
// }
SVNClientManager cm = buildSvnCredentials( scmUserid, encodedPass );
SVNCommitClient svnCommitClient = cm.getCommitClient();
// this will update output with files deleted
svnCommitClient.setEventHandler( buildSvnEventHandler( "Removing: ", outputWriter ) );
svnDelete( outputWriter, null, filesToDelete, baseConfigUrl, svnCommitClient, comment );
}
开发者ID:csap-platform,项目名称:csap-core,代码行数:22,代码来源:SourceControlManager.java
示例5: svnDelete
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
private void svnDelete ( BufferedWriter bw, File baseFolder, List<File> filesToDelete, String baseConfigUrl,
SVNCommitClient svnCommitClient, String comment )
throws SVNException {
List<SVNURL> urlsToDelete = new ArrayList<>();
filesToDelete.forEach( deleteFile -> {
try {
String deleteTarget = baseConfigUrl + "/" + deleteFile.getName();
if ( baseFolder != null ) {
String newPath = deleteFile.toURI().getPath().substring( baseFolder.toURI().getPath().length() );
deleteTarget = baseConfigUrl + "/" + newPath;
}
logger.info( "url to check: {}", deleteTarget );
SVNURL url = SVNURL.parseURIEncoded( deleteTarget );
urlsToDelete.add( url );
// deleting from fs now.
updateProgress( bw, "* Deleting from File system: " + deleteFile.getAbsolutePath() );
FileUtils.deleteQuietly( deleteFile );
} catch (SVNException ex) {
logger.error( "Failed to generated svn url for {}", deleteFile.getAbsolutePath(), ex );
}
} );
svnCommitClient.doDelete( urlsToDelete.toArray( new SVNURL[ 0 ] ), comment );
}
开发者ID:csap-platform,项目名称:csap-core,代码行数:27,代码来源:SourceControlManager.java
示例6: addToSvnIfNotThere
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
public void addToSvnIfNotThere ( File applicationFolder, File newOrUpdatedItem, String targetUrlFolder, SVNCommitClient svnCommitClient,
String comment ) {
try {
logger.info( "Checking for new file: {}", newOrUpdatedItem.getAbsolutePath() );
// stripping off the parent path
String newPath = newOrUpdatedItem.toURI().getPath().substring( applicationFolder.toURI().getPath().length() );
SVNURL url = SVNURL.parseURIEncoded( targetUrlFolder + "/" + newPath );
logger.info( "url to check: {}", url );
svnCommitClient.doImport( newOrUpdatedItem, url, "Agent adding proprs file: " + comment, null, true, true, SVNDepth.INFINITY );
} catch (Exception e) {
logger.info( "File already present: {}, \n svn response: \n {}", newOrUpdatedItem.getAbsolutePath(), e.getMessage() );
}
}
开发者ID:csap-platform,项目名称:csap-core,代码行数:16,代码来源:SourceControlManager.java
示例7: performSVNcommit
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
/**
* @param svnPathString
* String which contains the local SVN folder path.
* @param aComment
* The SVN Comment which has been entered.
* @param aConfig
* CommanderConfig for SVN Connect.
* @return Error code. If true --> SVN Operation failed.
*/
public final boolean performSVNcommit(final String svnPathString,
final String aComment, final CommanderConfig aConfig) {
SfdcCommander commander = SfdcCommander.getInstance();
boolean error = false;
File[] paths = new File[1];
// paths[0] = projectFile;
// boolean svnNew = false;
// svn add
SVNProperties props = new SVNProperties();
try {
ISVNAuthenticationManager authManager = getAuthManager(config);
// if (svnNew) {
// SVNWCClient addClient = new SVNWCClient(authManager,
// SVNWCUtil.createDefaultOptions(true));
// addClient.doAdd(projectFile, true, false, true,
// SVNDepth.INFINITY, true, true);
// commander.notify("Projectfile successfully added.");
// }
// commit
SVNCommitClient commitClient = new SVNCommitClient(authManager,
SVNWCUtil.createDefaultOptions(true));
commitClient.doCommit(paths, false, aComment, props, null, false,
true, SVNDepth.INFINITY);
commander.info("Projectfile successfully commited.");
} catch (SVNException e) {
commander.info(e.getMessage());
error = true;
}
return error;
}
开发者ID:jwiesel,项目名称:sfdcCommander,代码行数:44,代码来源:SvnHandler.java
示例8: executeCheckInCommand
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
ScmVersion tag )
throws ScmException
{
if ( getLogger().isInfoEnabled() )
{
getLogger().info( "SVN commit directory: " + fileSet.getBasedir().getAbsolutePath() );
}
SvnJavaScmProviderRepository javaRepo = (SvnJavaScmProviderRepository) repo;
CommitHandler handler = new CommitHandler( fileSet.getBasedir().getAbsolutePath() );
SVNCommitClient svnCommitClient = javaRepo.getClientManager().getCommitClient();
svnCommitClient.setCommitHandler( handler );
try
{
List<File> tmpPaths = fileSet.getFileList();
List<File> paths;
if ( tmpPaths == null || tmpPaths.isEmpty() )
{
paths = new ArrayList<File>( 1 );
paths.add( fileSet.getBasedir() );
}
else
{
paths = new ArrayList<File>( tmpPaths.size() );
for ( File f : tmpPaths )
{
if ( f.isAbsolute() )
{
paths.add( f );
}
else
{
paths.add( new File( fileSet.getBasedir(), f.toString() ) );
}
}
}
SVNCommitInfo svnCommitInfo =
SvnJavaUtil.commit( svnCommitClient, paths.toArray( new File[paths.size()] ), false, message, true );
List<ScmFile> files = new ArrayList<ScmFile>();
for ( String filePath : handler.getFiles() )
{
files.add( new ScmFile( filePath, ScmFileStatus.CHECKED_IN ) );
}
return new CheckInScmResult( SvnJavaScmProvider.COMMAND_LINE, files,
Long.toString( svnCommitInfo.getNewRevision() ) );
}
catch ( SVNException e )
{
return new CheckInScmResult( SvnJavaScmProvider.COMMAND_LINE, "SVN commit failed.", e.getMessage(), false );
}
finally
{
javaRepo.getClientManager().getCommitClient().setEventHandler( null );
}
}
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:67,代码来源:SvnJavaCheckInCommand.java
示例9: doInWorkingDirectory
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
static void doInWorkingDirectory(
final Logger logger,
final File userDir,
final String username,
final String password,
final SVNURL svnUrl,
final FileBasedProctorStore.ProctorUpdater updater,
final String comment) throws IOException, SVNException, Exception {
final BasicAuthenticationManager authManager = new BasicAuthenticationManager(username, password);
final SVNClientManager userClientManager = SVNClientManager.newInstance(null, authManager);
final SVNWCClient wcClient = userClientManager.getWCClient();
try {
// Clean up the UserDir
SvnProctorUtils.cleanUpWorkingDir(logger, userDir, svnUrl, userClientManager);
/*
if (previousVersion != 0) {
final Collection<?> changesSinceGivenVersion = repo.log(new String[] { "" }, null, previousVersion, -1, false, false);
if (! changesSinceGivenVersion.isEmpty()) {
// TODO: the baseline version is out of date, so need to go back to the user
}
}
updateClient.doCheckout(checkoutUrl, workingDir, null, SVNRevision.HEAD, SVNDepth.INFINITY, false);
*/
final FileBasedProctorStore.RcsClient rcsClient = new SvnPersisterCoreImpl.SvnRcsClient(wcClient);
final boolean thingsChanged = updater.doInWorkingDirectory(rcsClient, userDir);
if (thingsChanged) {
final SVNCommitClient commitClient = userClientManager.getCommitClient();
final SVNCommitPacket commit = commitClient.doCollectCommitItems(new File[]{userDir}, false, false, SVNDepth.INFINITY, new String[0]);
long elapsed = -System.currentTimeMillis();
final SVNCommitInfo info = commitClient.doCommit(commit, /* keepLocks */ false, comment);
elapsed += System.currentTimeMillis();
if (logger.isDebugEnabled()) {
final StringBuilder changes = new StringBuilder("Committed " + commit.getCommitItems().length + " changes: ");
for (final SVNCommitItem item : commit.getCommitItems()) {
changes.append(item.getKind() + " - " + item.getPath() + ", ");
}
changes.append(String.format(" in %d ms new revision: r%d", elapsed, info.getNewRevision()));
logger.debug(changes.toString());
}
}
} finally {
userClientManager.dispose();
}
}
开发者ID:indeedeng,项目名称:proctor,代码行数:49,代码来源:SvnProctorUtils.java
示例10: commit
import org.tmatesoft.svn.core.wc.SVNCommitClient; //导入依赖的package包/类
/**
* Commits changes in a working copy to a repository. Like
* 'svn commit PATH -m "some comment"' command. It's done by invoking
* <p/>
* SVNCommitClient.doCommit(File[] paths, boolean keepLocks, String commitMessage,
* boolean force, boolean recursive)
* <p/>
* which takes the following parameters:
* <p/>
* paths - working copy paths which changes are to be committed;
* <p/>
* keepLocks - if true then doCommit(..) won't unlock locked paths; otherwise they will
* be unlocked after a successful commit;
* <p/>
* commitMessage - a commit log message;
* <p/>
* force - if true then a non-recursive commit will be forced anyway;
* <p/>
* recursive - if true and a path corresponds to a directory then doCommit(..) recursively
* commits changes for the entire directory, otherwise - only for child entries of the
* directory;
*/
public static SVNCommitInfo commit( SVNCommitClient clientManager, File[] paths, boolean keepLocks,
String commitMessage, boolean recursive )
throws SVNException
{
/*
* Returns SVNCommitInfo containing information on the new revision committed
* (revision number, etc.)
*/
return clientManager.doCommit( paths, keepLocks, commitMessage, false, recursive );
}
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:33,代码来源:SvnJavaUtil.java
注:本文中的org.tmatesoft.svn.core.wc.SVNCommitClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论