@Override public void add(final File file) throws Exception { wcClient.doAdd(file, false, false, false, SVNDepth.UNKNOWN, false, true); }
@Override public void add(final File file) throws Exception { wcClient.doAdd(file, false, false, false, SVNDepth.UNKNOWN, false, true); }
doAdd(path, force, mkdir, climbUnversionedParents, recursive, false);
@Override public void addForCommit(String path) throws Exception { File f = new File(baseDirectory, path); filesForCommit.add(f); ourClientManager.getWCClient().doAdd(f, true, false, true, SVNDepth.EMPTY, false, true); }
public void add(String path, boolean recurse, boolean force) throws ClientException { SVNWCClient wcClient = getSVNWCClient(); try { wcClient.doAdd(new File(path).getAbsoluteFile(), force, false, false, recurse, false); } catch (SVNException e) { throwException(e); } }
/** * Puts directories and files under version control scheduling them for addition * to a repository. They will be added in a next commit. Like 'svn add PATH' * command. It's done by invoking * <p/> * SVNWCClient.doAdd(File path, boolean force, * boolean mkdir, boolean climbUnversionedParents, boolean recursive) * <p/> * which takes the following parameters: * <p/> * path - an entry to be scheduled for addition; * <p/> * force - set to true to force an addition of an entry anyway; * <p/> * mkdir - if true doAdd(..) creates an empty directory at path and schedules * it for addition, like 'svn mkdir PATH' command; * <p/> * climbUnversionedParents - if true and the parent of the entry to be scheduled * for addition is not under version control, then doAdd(..) automatically schedules * the parent for addition, too; * <p/> * recursive - if true and an entry is a directory then doAdd(..) recursively * schedules all its inner dir entries for addition as well. */ public static void add( SVNClientManager clientManager, File wcPath, boolean recursive, boolean force ) throws SVNException { clientManager.getWCClient().doAdd( wcPath, force, false, true, recursive ? SVNDepth.INFINITY : SVNDepth.EMPTY, true, false ); }
boolean recursive) throws SVNException { SVNDepth depth = SVNDepth.getInfinityOrEmptyDepth(recursive); doAdd(path, force, mkdir, climbUnversionedParents, depth, false, false, climbUnversionedParents);
boolean recursive, boolean includeIgnored) throws SVNException { SVNDepth depth = SVNDepth.getInfinityOrEmptyDepth(recursive); doAdd(path, force, mkdir, climbUnversionedParents, depth, false, includeIgnored, climbUnversionedParents);
boolean recursive, boolean includeIgnored) throws SVNException { SVNDepth depth = SVNDepth.getInfinityOrEmptyDepth(recursive); doAdd(path, force, mkdir, climbUnversionedParents, depth, false, includeIgnored, climbUnversionedParents);
/** * Method description * * * * @param files * * @throws RepositoryClientException */ private void addFiles(List<File> files) throws RepositoryClientException { SVNWCClient wClient = client.getWCClient(); try { wClient.doAdd(files.toArray(new File[0]), true, false, false, SVNDepth.INFINITY, false, false, false); } catch (SVNException ex) { throw new RepositoryClientException(ex); } }
private void addLocalParents(File path, ISVNEventHandler handler) throws SVNException { boolean created = path.mkdirs(); SVNWCClient wcClient = new SVNWCClient((ISVNAuthenticationManager) null, null); try { wcClient.setEventHandler(handler); wcClient.doAdd(path, false, false, true, SVNDepth.EMPTY, true, true); } catch (SVNException e) { if (created) { SVNFileUtil.deleteAll(path, true); } throw e; } }
private void addLocalParents(File path, ISVNEventHandler handler) throws SVNException { boolean created = path.mkdirs(); SVNWCClient wcClient = new SVNWCClient((ISVNAuthenticationManager) null, null); try { wcClient.setEventHandler(handler); wcClient.doAdd(path, false, false, true, SVNDepth.EMPTY, true, true); } catch (SVNException e) { if (created) { SVNFileUtil.deleteAll(path, true); } throw e; } }
public void add(String path, int depth, boolean force, boolean noIgnores, boolean addParents) throws ClientException { SVNWCClient wcClient = getSVNWCClient(); try { wcClient.doAdd(new File(path).getAbsoluteFile(), force, false, false, JavaHLObjectFactory.getSVNDepth(depth), noIgnores, addParents); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public void add(String path, int depth, boolean force, boolean noIgnores, boolean addParents) throws ClientException { SVNWCClient wcClient = getSVNWCClient(); try { wcClient.doAdd(new File(path).getAbsoluteFile(), force, false, false, JavaHLObjectFactory.getSVNDepth(depth), noIgnores, addParents); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public void add(String path, int depth, boolean force, boolean noIgnores, boolean addParents) throws ClientException { SVNWCClient wcClient = getSVNWCClient(); try { wcClient.doAdd(new File(path).getAbsoluteFile(), force, false, false, JavaHLObjectFactory.getSVNDepth(depth), noIgnores, addParents); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
File file = files[i]; try { getSVNWCClient().doAdd(file, false, true, false, false, false); } catch (SVNException e) { throwException(e);
private void addFiles(String... paths) throws Exception { SvnClientManager svnm = SubversionSCM.createClientManager((AbstractProject) null); for (String path : paths) { FilePath newFile = workingcopy.child(path); newFile.touch(System.currentTimeMillis()); svnm.getWCClient().doAdd(new File(newFile.getRemote()), false, false, false, SVNDepth.INFINITY, false, false); } }
wcClient.doAdd(file, // File path true, // boolean force false, // boolean mkdir
/** * Manufactures commits by adding files in the given names. */ private void createCommit(SubversionSCM scm, String... paths) throws Exception { FreeStyleProject forCommit = r.createFreeStyleProject(); forCommit.setScm(scm); forCommit.setAssignedLabel(r.jenkins.getSelfLabel()); FreeStyleBuild b = r.assertBuildStatusSuccess(forCommit.scheduleBuild2(0).get()); SvnClientManager svnm = SubversionSCM.createClientManager((AbstractProject)null); List<File> added = new ArrayList<>(); for (String path : paths) { FilePath newFile = b.getWorkspace().child(path); added.add(new File(newFile.getRemote())); if (!newFile.exists()) { newFile.touch(System.currentTimeMillis()); svnm.getWCClient().doAdd(new File(newFile.getRemote()),false,false,false, SVNDepth.INFINITY, false,false); } else newFile.write("random content","UTF-8"); } SVNCommitClient cc = svnm.getCommitClient(); cc.doCommit(added.toArray(new File[added.size()]),false,"added",null,null,false,false,SVNDepth.EMPTY); }
@Test public void masterPolling() throws Exception { File repo = new CopyExisting(getClass().getResource("two-revisions.zip")).allocate(); SubversionSCM scm = new SubversionSCM("file://" + repo.toURI().toURL().getPath()); scm.setPollFromMaster(true); FreeStyleProject p = r.createFreeStyleProject(); p.setScm(scm); p.setAssignedLabel(r.createSlave().getSelfLabel()); r.assertBuildStatusSuccess(p.scheduleBuild2(2).get()); // initial polling on the master for the code path that doesn't find any change assertFalse(p.poll(StreamTaskListener.fromStdout()).hasChanges()); // create a commit FreeStyleProject forCommit = r.createFreeStyleProject(); forCommit.setScm(scm); forCommit.setAssignedLabel(r.jenkins.getSelfLabel()); FreeStyleBuild b = r.assertBuildStatusSuccess(forCommit.scheduleBuild2(0).get()); FilePath newFile = b.getWorkspace().child("foo"); newFile.touch(System.currentTimeMillis()); SvnClientManager svnm = SubversionSCM.createClientManager(p); svnm.getWCClient().doAdd(new File(newFile.getRemote()),false,false,false, SVNDepth.INFINITY, false,false); SVNCommitClient cc = svnm.getCommitClient(); cc.doCommit(new File[]{new File(newFile.getRemote())},false,"added",null,null,false,false,SVNDepth.INFINITY); // polling on the master for the code path that doesn't find any change assertTrue(p.poll(StreamTaskListener.fromStdout()).hasChanges()); }