@Test public void testFetchFullDepth() throws Exception { prepareForFetch(false); // clone the repository CloneOp clone = cloneOp(); clone.setDepth(2); // clone.setRepositoryURL(remoteGeogig.envHome.toURI().toString()).call(); clone.setRemoteURI(remoteGeogig.envHome.toURI()).setCloneURI(localGeogig.envHome.toURI()) .call(); FetchOp fetch = fetchOp(); fetch.setFullDepth(true); fetch.call(); verifyFetch(); }
@Test public void testSparseShallowClone() throws Exception { Map<String, String> filter = new HashMap<String, String>(); filter.put("default", "BBOX(pp,9, -80, 15, -70,'EPSG:4326')"); createFilterFile(filter); CloneOp clone = cloneOp(); clone.setDepth(3).setBranch("master"); exception.expect(IllegalStateException.class); clone.setRemoteURI(remoteGeogig.envHome.toURI()).call(); }
clone.setBranch(branch)// .setRemoteURI(remoteURI)// .setCloneURI(cloneURI)// .setUserName(username)// .setPassword(password)// .setDepth(depth)// .setCloneIndexes(withIndexes)// .setProgressListener(cli.getProgressListener()); clone.call(); succeeded = true; } catch (RuntimeException e) {
@Override String params(CloneOp c) { return format( "url=%s, branch=%s, depth=%s", c.getRemoteURI(), c.getBranch().orNull(), c.getDepth().orNull()); } }
checkPreconditions(); final Repository cloneRepo = createClone(); try { final Remote remote = addRemote(cloneRepo); final Iterable<RefDiff> localRemoteRefs; try (IRemoteRepo remoteRepo = openRemote(remote)) { final Integer depth = this.depth.or(remoteRepo.getDepth()).or(0); setDepth(cloneRepo, depth); localRemoteRefs = fetchRemoteData(cloneRepo, remote, depth); setUpRemoteTrackingBranches(cloneRepo, remote, localRemoteRefs); } catch (Exception e) {
/** * Override to set setCloneIndexes(true) and add a command hook that creates the indexes on the * remote repo before cloning it */ protected @Override CloneOp cloneOp() { CloneOp cloneOp = super.cloneOp().setCloneIndexes(true); cloneOp.addListener(createSpatialIndexBeforeCloneListener); return cloneOp; }
clone.setRemoteURI(remoteGeogig.envHome.toURI()).setBranch("master").call();
clone.setRemoteURI(remoteGeogig.envHome.toURI())// .setCloneURI(localGeogig.envHome.toURI())// .setBranch("master").call();
@Test public void testCloneEmptyRepo() throws Exception { CloneOp clone = cloneOp(); // clone.setRepositoryURL(remoteGeogig.envHome.toURI().toString()).call(); clone.setRemoteURI(remoteGeogig.envHome.toURI()).setCloneURI(localGeogig.envHome.toURI()) .call(); TestSupport.verifyRepositoryContents(cloneRepo); }
@Test public void testCloneEmptyRepoString() throws Exception { CloneOp clone = cloneOp(); exception.expect(IllegalArgumentException.class); // clone.setRepositoryURL("").call(); clone.setRemoteURI(null).call(); }
clone.setRemoteURI(remoteGeogig.envHome.toURI()).setCloneURI(localGeogig.envHome.toURI()) .call(); assertEquals(expectedMaster, logged); upstreamRepo.command(CloneOp.class).setRemoteURI(originRepo.getLocation()) .setRemoteName("origin").call();
/** * Set up multiple repositories with a shallow clone for testing. * * @return Collection of repository names created. * * @throws Exception */ public Collection<String> setUpDefaultMultiRepoServerWithShallowClone() throws Exception { Repository repo1 = createRepo("full")// .init("geogigUser", "full_Owner@geogig.org")// .loadDefaultData()// .getRepo(); Repository repo2 = createRepo("shallow")// .init("geogigUser", "shallow_Owner@geogig.org").getRepo(); repo2.command(CloneOp.class).setRemoteURI(repo1.getLocation()).setDepth(1).call(); repo1.close(); repo2.close(); return Arrays.asList("full", "shallow"); }
public TestData clone(TestData origin, String name) { TestData clone = newRepo(name); clone.getRepo().command(CloneOp.class).setCloneIndexes(true).setRemoteURI(origin.getRepo().getLocation()).call(); return clone; } }
@Test public void testCloneNoRepoSpecified() throws Exception { CloneOp clone = cloneOp(); exception.expect(IllegalArgumentException.class); clone.call(); }
public @Override void postCall(AbstractGeoGigOp<?> command, @Nullable Object result, @Nullable RuntimeException exception) { Repository remote = CloneOpWithIndexTest.this.remoteRepo; Repository local = command.context().repository(); CloneOp op = (CloneOp) command; if (result != null) { verifyClonedIndexes(local, remote, op.getBranch()); } } };
clone.setRemoteURI(remoteGeogig.envHome.toURI()).setBranch("master").call();
clone.setRemoteURI(remoteGeogig.envHome.toURI())// .setCloneURI(localGeogig.envHome.toURI())// .setBranch("master").call();
@Test public void testCloneEmptyRepo() throws Exception { CloneOp clone = cloneOp(); // clone.setRepositoryURL(remoteGeogig.envHome.toURI().toString()).call(); clone.setRemoteURI(remoteGeogig.envHome.toURI()).setCloneURI(localGeogig.envHome.toURI()) .call(); TestSupport.verifyRepositoryContents(cloneRepo); }
@Test public void testCloneEmptyRepoString() throws Exception { CloneOp clone = cloneOp(); exception.expect(IllegalArgumentException.class); // clone.setRepositoryURL("").call(); clone.setRemoteURI(null).call(); }
clone.setRemoteURI(remoteGeogig.envHome.toURI()).setCloneURI(localGeogig.envHome.toURI()) .call(); upstreamRepo = upstreamGeogig.repo; upstreamRepo.command(CloneOp.class).setRemoteURI(originRepo.getLocation()) .setRemoteName("origin").call();