/** * @deprecated as of 1.23 */ public SubversionSCM(List<ModuleLocation> locations, boolean useUpdate, boolean doRevert, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions) { this(locations, useUpdate?(doRevert?new UpdateWithRevertUpdater():new UpdateUpdater()):new CheckoutUpdater(), browser, excludedRegions, excludedUsers, excludedRevprop, excludedCommitMessages, includedRegions); }
/** * @deprecated as of 1.23 */ public SubversionSCM(List<ModuleLocation> locations, boolean useUpdate, boolean doRevert, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions) { this(locations, useUpdate ? (doRevert ? new UpdateWithRevertUpdater() : new UpdateUpdater()) : new CheckoutUpdater(), browser, excludedRegions, excludedUsers, excludedRevprop, excludedCommitMessages, includedRegions); }
/** * @deprecated as of 1.23 */ public SubversionSCM(List<ModuleLocation> locations, boolean useUpdate, boolean doRevert, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions) { this(locations, useUpdate ? (doRevert ? new UpdateWithRevertUpdater() : new UpdateUpdater()) : new CheckoutUpdater(), browser, excludedRegions, excludedUsers, excludedRevprop, excludedCommitMessages, includedRegions); }
@Exported public WorkspaceUpdater getWorkspaceUpdater() { if (workspaceUpdater != null) { return workspaceUpdater; } // data must have been read from old configuration. if (useUpdate != null && !useUpdate.booleanValue()) { return new CheckoutUpdater(); } if (doRevert != null && doRevert.booleanValue()) { return new UpdateWithRevertUpdater(); } return new UpdateUpdater(); }
@Exported public WorkspaceUpdater getWorkspaceUpdater() { if (workspaceUpdater!=null) return workspaceUpdater; // data must have been read from old configuration. if (useUpdate!=null && !useUpdate) return new CheckoutUpdater(); if (doRevert!=null && doRevert) return new UpdateWithRevertUpdater(); return new UpdateUpdater(); }
@Exported public WorkspaceUpdater getWorkspaceUpdater() { if (workspaceUpdater != null) { return workspaceUpdater; } // data must have been read from old configuration. if (useUpdate != null && !useUpdate) { return new CheckoutUpdater(); } if (doRevert != null && doRevert) { return new UpdateWithRevertUpdater(); } return new UpdateUpdater(); }
@Issue("JENKINS-7944") @Test public void configRoundtrip2() throws Exception { FreeStyleProject p = r.createFreeStyleProject(); SubversionSCM scm = new SubversionSCM( Arrays.asList( new ModuleLocation("https://svn.jenkins-ci.org/trunk/hudson/test-projects/testSubversionExclusion", "")), new UpdateUpdater(),null,null,null,null,null,null); p.setScm(scm); r.configRoundtrip((Item)p); verify(scm,(SubversionSCM)p.getScm()); }
@Issue("JENKINS-9143") @Test public void checkEmptyRemoteRemoved() throws Exception { FreeStyleProject p = r.createFreeStyleProject(); List<ModuleLocation> locs = new ArrayList<>(); locs.add(new ModuleLocation("https://svn.jenkins-ci.org/trunk/hudson/test-projects/testSubversionExclusion", "c")); locs.add(new ModuleLocation("", "d")); locs.add(new ModuleLocation(" ", "e")); SubversionSCM scm = new SubversionSCM( locs, new UpdateUpdater(), new Sventon(new URL("http://www.sun.com/"), "test"), "exclude", "user", "revprop", "excludeMessage",null); p.setScm(scm); r.submit(r.createWebClient().getPage(p, "configure").getFormByName("config")); ModuleLocation[] ml = ((SubversionSCM) p.getScm()).getLocations(); assertEquals(1, ml.length); assertEquals("https://svn.jenkins-ci.org/trunk/hudson/test-projects/testSubversionExclusion", ml[0].remote); }
@Issue("JENKINS-18099") @Test public void globalExclusionRevprop() throws Exception { SubversionSCM scm = new SubversionSCM( Arrays.asList(new SubversionSCM.ModuleLocation("file://some/repo", ".")), new UpdateUpdater(), null, null, null, null, null, null, false); scm.getDescriptor().setGlobalExcludedRevprop("ignoreme"); SVNProperties p = new SVNProperties(); p.put("ignoreme", "*"); Map<String, SVNLogEntryPath> paths = new HashMap<>(); paths.put("/foo", new SVNLogEntryPath("/foo", SVNLogEntryPath.TYPE_MODIFIED, null, -1)); SVNLogEntry e = new SVNLogEntry(paths, 1234L, p, false); SVNLogFilter filter = scm.createSVNLogFilter(); assertFalse(filter.isIncluded(e)); }
/** * Test that multiple repository URLs are all polled. */ @Issue("JENKINS-7461") @Test public void multipleRepositories() throws Exception { // fetch the current workspaces FreeStyleProject p = r.createFreeStyleProject(); String svnBase = "file://" + new CopyExisting(getClass().getResource("/svn-repo.zip")).allocate().toURI().toURL().getPath(); SubversionSCM scm = new SubversionSCM( Arrays.asList(new ModuleLocation(svnBase + "trunk", "trunk")), new UpdateUpdater(), null, null, null, null, null, null); p.setScm(scm); Run r1 = p.scheduleBuild2(0, new Cause.UserIdCause()).get(); r.assertLogContains("Cleaning local Directory trunk", r1); scm = new SubversionSCM( Arrays.asList(new ModuleLocation(svnBase + "trunk", "trunk"), new ModuleLocation(svnBase + "branches", "branches")), new UpdateUpdater(), null, null, null, null, null, null); p.setScm(scm); Run r2 = p.scheduleBuild2(0, new Cause.UserIdCause()).get(); r.assertLogContains("Updating " + svnBase + "trunk", r2); r.assertLogContains("Cleaning local Directory branches", r2); }
@Test @Ignore("TODO use docker-fixtures for a reproducible test case") public void excludeByUser() throws Exception { FreeStyleProject p = r.createFreeStyleProject( "testExcludeByUser" ); p.setScm(new SubversionSCM( Arrays.asList( new ModuleLocation( "https://svn.jenkins-ci.org/trunk/hudson/test-projects/testSubversionExclusions@19438", null )), new UpdateUpdater(), null, "", "dty", "", "", null) ); // Do a build to force the creation of the workspace. This works around // pollChanges returning true when the workspace does not exist. p.scheduleBuild2(0).get(); boolean foundChanges = p.poll(r.createTaskListener()).hasChanges(); assertFalse("Polling found changes that should have been ignored", foundChanges); }
SubversionSCM scm = new SubversionSCM(ModuleLocation.parse(new String[]{"file://" + repo.toURI().toURL().getPath()}, new String[]{"."}, null, null), new UpdateUpdater(), null, ".*/bar", "", "", "", "");
@Test public void configRoundtrip() throws Exception { FreeStyleProject p = r.createFreeStyleProject(); SubversionSCM scm = new SubversionSCM( Arrays.asList( new ModuleLocation("https://svn.jenkins-ci.org/trunk/hudson/test-projects/testSubversionExclusion", "c"), new ModuleLocation("https://svn.jenkins-ci.org/trunk/hudson/test-projects/testSubversionExclusion", "d")), new UpdateUpdater(),new Sventon(new URL("http://www.sun.com/"),"test"),"exclude","user","revprop","excludeMessage",null); p.setScm(scm); r.submit(r.createWebClient().getPage(p,"configure").getFormByName("config")); verify(scm,(SubversionSCM)p.getScm()); scm = new SubversionSCM( Arrays.asList( new ModuleLocation("https://svn.jenkins-ci.org/trunk/hudson/test-projects/testSubversionExclusion", "c")), new CheckoutUpdater(),null,"","","","",null); p.setScm(scm); r.submit(r.createWebClient().getPage(p,"configure").getFormByName("config")); verify(scm,(SubversionSCM)p.getScm()); }
@Issue("JENKINS-777") @Test public void changingDepthWithUpdateUpdater() throws Exception { Proc p = runSvnServe(getClass().getResource("JENKINS-777.zip")); try { // enable 1.6 mode HtmlForm f = r.createWebClient().goTo("configure").getFormByName("config"); f.getSelectByName("svn.workspaceFormat").setSelectedAttribute("10",true); r.submit(f); FreeStyleProject b = r.createFreeStyleProject(); ModuleLocation[] locations = { new ModuleLocation("svn://localhost/jenkins-777/proja", "proja", "infinity", true) }; // Do initial update with infinite depth and check that file1 exists b.setScm(new SubversionSCM(Arrays.asList(locations), new UpdateUpdater(), null, null, null, null, null, null)); FreeStyleBuild build = r.assertBuildStatusSuccess(b.scheduleBuild2(0)); FilePath ws = build.getWorkspace(); assertTrue(ws.child("proja").child("file1").exists()); // Trigger new build with depth empty and check that file1 no longer exists ModuleLocation[] locations2 = { new ModuleLocation("svn://localhost/jenkins-777/proja", "proja", "empty", true) }; b.setScm(new SubversionSCM(Arrays.asList(locations2), new UpdateUpdater(), null, null, null, null, null, null)); FreeStyleBuild build2 = r.assertBuildStatusSuccess(b.scheduleBuild2(0)); ws = build2.getWorkspace(); assertTrue(!(ws.child("proja").child("file1").exists())); } finally { p.kill(); } }
SubversionSCM scm = new SubversionSCM(ModuleLocation.parse(new String[]{"file://" + repo.toURI().toURL().getPath()}, new String[]{"."},null,null), new UpdateUpdater(), null, "/z.*", "", "", "", "", false, shouldFilterLog, null);
SubversionSCM scm = new SubversionSCM(ModuleLocation.parse(new String[]{"file://" + repo.toURI().toURL().getPath()}, new String[]{"."}, null, null), new UpdateUpdater(), null, "", "", "", "", ".*/foo");
b.setScm(new SubversionSCM(Arrays.asList(locations), new UpdateUpdater(), null, null, null, null, null, null)); FreeStyleBuild build = r.assertBuildStatusSuccess(b.scheduleBuild2(0)); FilePath ws = build.getWorkspace(); new ModuleLocation("svn://localhost/jenkins-777/proja", "proja", "undefined", true) }; b.setScm(new SubversionSCM(Arrays.asList(locations2), new UpdateUpdater(), null, null, null, null, null, null)); FreeStyleBuild build2 = r.assertBuildStatusSuccess(b.scheduleBuild2(0)); ws = build2.getWorkspace();
SubversionSCM scm = new SubversionSCM( Arrays.asList( new ModuleLocation( "file://" + repo.toURI().toURL().getPath() + "/p", "." )), new UpdateUpdater(), null, null, null, null, null, null, true); p.setScm(scm);