checkout("master")// .addAndCommit("point1, line1, poly1", point1, line1, poly1)// .branchAndCheckout("branch1")// .addAndCommit("point2, line2, poly2", point2, line2, poly2)// .checkout("master")// .branchAndCheckout("branch2")// .addAndCommit("point3, line3, poly3", point3, line3, poly3)// .checkout("master")//
checkout("master")// .addAndCommit("point1, line1, poly1", point1, line1, poly1)// .branchAndCheckout("branch1")// .addAndCommit("point2, line2, poly2", point2, line2, poly2)// .checkout("master")// .branchAndCheckout("branch2")// .addAndCommit("point3, line3, poly3", point3, line3, poly3)// .checkout("master")//
.branchAndCheckout("newbranch")//
@Given("^There are multiple branches on the \"([^\"]*)\" repo$") public void There_are_multiple_branches(String repoName) throws Throwable { Repository repo = context.getRepo(repoName); TestData data = new TestData(repo); data.addAndCommit("Added Point.1", TestData.point1); ObjectId master = repo.command(RefParse.class).setName("master").call().get().getObjectId(); repo.command(UpdateRef.class).setName(Ref.REMOTES_PREFIX + "origin/master_remote") .setNewValue(master).call(); data.branchAndCheckout("branch1"); data.addAndCommit("Added Point.2", TestData.point2); ObjectId branch1 = repo.command(RefParse.class).setName("branch1").call().get() .getObjectId(); repo.command(UpdateRef.class).setName(Ref.REMOTES_PREFIX + "origin/branch1_remote") .setNewValue(branch1).call(); data.branchAndCheckout("branch2"); data.addAndCommit("Added Line.1", TestData.line1); ObjectId branch2 = repo.command(RefParse.class).setName("branch2").call().get() .getObjectId(); repo.command(UpdateRef.class).setName(Ref.REMOTES_PREFIX + "origin/branch2_remote") .setNewValue(branch2).call(); data.checkout("master"); // add the repo to the set so it can be closed openedRepos.add(repoName); }
public @Test void testResolve() { origin.loadDefaultData()// .checkout("branch1")// .branchAndCheckout("issuerBranch")// .remove(TestData.line2).add().commit("remove line2"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(origin.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("branch1")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getRepo().context()); PR request = prinit.call(); Optional<PR> resolved = origin.getRepo().command(PRFindOp.class).setId(request.getId()) .call(); assertTrue(resolved.isPresent()); assertEquals(request, resolved.get()); assertFalse(origin.getRepo().command(PRFindOp.class).setId(1 + request.getId()).call() .isPresent()); } }
.branchAndCheckout("newbranch")//
public @Test void testCreatePullRequest() { final RevCommit commonAncestor = Iterators.getLast(origin.log("master")); clone.branchAndCheckout("issuerBranch")//
public @Test void testReOpenPullRequest() { final RevCommit commonAncestor = Iterators.getLast(origin.log("master")); clone.branchAndCheckout("issuerBranch")//
public @Before void before() { origin = testSupport.newRepo("origin"); origin.loadDefaultData(); clone = testSupport.clone(origin, "clone"); commonAncestor = Iterators.getLast(origin.log("master")); origin.resetHard(commonAncestor.getId()); TestData.point1_modified.setAttribute("sp", "modified by clone"); clone.branchAndCheckout("issuerBranch")// .resetHard(commonAncestor.getId())// .remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(clone.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("master")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getContext()); request = prinit.call(); assertNotNull(request); }
public @Before void before() { origin = testSupport.newRepo("origin"); origin.loadDefaultData(); clone = testSupport.clone(origin, "clone"); commonAncestor = Iterators.getLast(origin.log("master")); origin.resetHard(commonAncestor.getId()); TestData.point1_modified.setAttribute("sp", "modified by clone"); clone.branchAndCheckout("issuerBranch")// .resetHard(commonAncestor.getId())// .remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(clone.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("master")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getContext()); request = prinit.call(); assertNotNull(request); }
public @Before void before() { origin = testSupport.newRepo("origin"); origin.loadDefaultData(); clone = testSupport.clone(origin, "clone"); commonAncestor = Iterators.getLast(origin.log("master")); origin.resetHard(commonAncestor.getId()); TestData.point1_modified.setAttribute("sp", "modified by clone"); clone.branchAndCheckout("issuerBranch")// .resetHard(commonAncestor.getId())// .remove(TestData.line1).add().commit("remove line1")// .insert(TestData.poly4).add().commit("add poly 4")// .insert(TestData.point1_modified).add().commit("modify point1"); PRInitOp prinit = PRInitOp.builder()// .id(1)// .remoteURI(clone.getRepo().getLocation())// .remoteBranch("issuerBranch")// .targetBranch("master")// .title("first PR")// .description(null)// .build(); prinit.setContext(origin.getRepo().context()); request = prinit.call(); assertNotNull(request); }
public @Test void tryReOpenMergedPullRequest() { final RevCommit commonAncestor = Iterators.getLast(origin.log("master")); clone.branchAndCheckout("issuerBranch")//
public @Test void testUpdatePullRequest() { final RevCommit commonAncestor = Iterators.getLast(origin.log("master")); clone.branchAndCheckout("issuerBranch")// clone.checkout("master").branchAndCheckout("newbranch") .insert(TestData.point1_modified, TestData.poly1_modified1).add() .commit("on branch2");