/** * Inserts the Feature to the index and stages it to be committed. */ public ObjectId insertAndAdd(Feature f) throws Exception { return insertAndAdd(null, f); }
/** * Inserts the Feature to the index and stages it to be committed. */ public ObjectId insertAndAdd(Feature f) throws Exception { return insertAndAdd(null, f); }
public void insertAndAdd(Feature... features) throws Exception { insertAndAdd(null, features); }
public void insertAndAdd(Feature... features) throws Exception { insertAndAdd(null, features); }
protected List<RevCommit> populate(boolean oneCommitPerFeature, List<Feature> features) throws Exception { List<RevCommit> commits = new ArrayList<RevCommit>(); for (Feature f : features) { insertAndAdd(f); if (oneCommitPerFeature) { commits.add(commit(f.getIdentifier().getID())); } } if (!oneCommitPerFeature) { String msg = Joiner.on(',') .join(Lists.transform(features, (f) -> f.getIdentifier().getID())); commits.add(commit(msg)); } return commits; }
protected List<RevCommit> populate(boolean oneCommitPerFeature, List<Feature> features) throws Exception { List<RevCommit> commits = new ArrayList<RevCommit>(); for (Feature f : features) { insertAndAdd(f); if (oneCommitPerFeature) { commits.add(commit(f.getIdentifier().getID())); } } if (!oneCommitPerFeature) { String msg = Joiner.on(',') .join(Lists.transform(features, (f) -> f.getIdentifier().getID())); commits.add(commit(msg)); } return commits; }
@Test public void testOneStaged() { try { super.insertAndAdd(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(2, summary.getCountStaged()); }
@Test public void testOneStaged() { try { super.insertAndAdd(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(2, summary.getCountStaged()); }
@Test public void testTwoStaged() { try { super.insert(points2); super.insertAndAdd(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(3, summary.getCountStaged()); }
@Test public void testTwoStaged() { try { super.insert(points2); super.insertAndAdd(points1_modified); } catch (Exception e) { e.printStackTrace(); } StatusSummary summary = geogig.command(StatusOp.class).call(); assertAllFieldsNotNull(summary); assertEquals(3, summary.getCountStaged()); }
@Test public void testBothBranchesSameGeometryChange() throws Exception { String ancestorLine = "LINESTRING (-75.1195282 38.7801263, -75.1195626 38.7806208, -75.1195701 38.780762, -75.1195916 38.7816402, -75.1195154 38.7820072)"; String leftLine = "LINESTRING (-75.1195282 38.7801263, -75.1195626 38.7806208, -75.1195645 38.7807768, -75.1195916 38.7816402, -75.1195841 38.7817429, -75.1195702 38.7818159, -75.1195333 38.7819121, -75.119487 38.7819971)"; String rightLine = "LINESTRING (-75.1195282 38.7801263, -75.1195626 38.7806208, -75.1195645 38.7807768, -75.1195916 38.7816402, -75.1195841 38.7817429, -75.1195702 38.7818159, -75.1195333 38.7819121, -75.119487 38.7819971)"; final String fid = "112233"; final Feature ancestor = super.feature(linesType, fid, "secondary", 1, ancestorLine); final Feature left = super.feature(linesType, fid, "secondary", 1, leftLine); final Feature right = super.feature(linesType, fid, "primary", 1, rightLine); super.insertAndAdd(ancestor); super.commit("common ancestor"); geogig.command(BranchCreateOp.class).setName("branch").call(); super.insertAndAdd(left); super.commit("master change"); assertEquals("branch", geogig.command(CheckoutOp.class).setSource("branch").call() .getNewRef().localName()); super.insertAndAdd(right); final RevCommit branchCommit = super.commit("branch change"); geogig.command(CheckoutOp.class).setSource("master").call(); geogig.command(MergeOp.class).addCommit(branchCommit.getId()).call(); }
@Test public void testBothBranchesSameGeometryChange() throws Exception { String ancestorLine = "LINESTRING (-75.1195282 38.7801263, -75.1195626 38.7806208, -75.1195701 38.780762, -75.1195916 38.7816402, -75.1195154 38.7820072)"; String leftLine = "LINESTRING (-75.1195282 38.7801263, -75.1195626 38.7806208, -75.1195645 38.7807768, -75.1195916 38.7816402, -75.1195841 38.7817429, -75.1195702 38.7818159, -75.1195333 38.7819121, -75.119487 38.7819971)"; String rightLine = "LINESTRING (-75.1195282 38.7801263, -75.1195626 38.7806208, -75.1195645 38.7807768, -75.1195916 38.7816402, -75.1195841 38.7817429, -75.1195702 38.7818159, -75.1195333 38.7819121, -75.119487 38.7819971)"; final String fid = "112233"; final Feature ancestor = super.feature(linesType, fid, "secondary", 1, ancestorLine); final Feature left = super.feature(linesType, fid, "secondary", 1, leftLine); final Feature right = super.feature(linesType, fid, "primary", 1, rightLine); super.insertAndAdd(ancestor); super.commit("common ancestor"); geogig.command(BranchCreateOp.class).setName("branch").call(); super.insertAndAdd(left); super.commit("master change"); assertEquals("branch", geogig.command(CheckoutOp.class).setSource("branch").call() .getNewRef().localName()); super.insertAndAdd(right); final RevCommit branchCommit = super.commit("branch change"); geogig.command(CheckoutOp.class).setSource("master").call(); geogig.command(MergeOp.class).addCommit(branchCommit.getId()).call(); }
final NodeRef branchChangeRef; super.insertAndAdd(ancestor); super.commit("common ancestor"); ancestorRef = geogig.command(FindTreeChild.class).setParent(repo.workingTree().getTree()) super.insertAndAdd(left); super.commit("master change"); super.insertAndAdd(right); super.commit("branch change");
final NodeRef branchChangeRef; super.insertAndAdd(ancestor); super.commit("common ancestor"); ancestorRef = geogig.command(FindTreeChild.class).setParent(repo.workingTree().getTree()) super.insertAndAdd(left); super.commit("master change"); super.insertAndAdd(right); super.commit("branch change");