Package org.eclipse.jgit.api.RebaseCommand

Examples of org.eclipse.jgit.api.RebaseCommand.InteractiveHandler


    // update files on master
    commitFile(FILE1, "blah", "master");
    RevCommit c4 = commitFile("file2", "more change", "master");

    RebaseResult res = git.rebase().setUpstream("HEAD~2")
        .runInteractively(new InteractiveHandler() {
          public void prepareSteps(List<RebaseTodoLine> steps) {
            steps.add(0, new RebaseTodoLine(
                "# Comment that should not be processed"));
          }

          public String modifyCommitMessage(String commit) {
            fail("modifyCommitMessage() was not expected to be called");
            return commit;
          }
        }).call();

    assertEquals(RebaseResult.Status.FAST_FORWARD, res.getStatus());

    RebaseResult res2 = git.rebase().setUpstream("HEAD~2")
        .runInteractively(new InteractiveHandler() {
          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              // delete RevCommit c4
              steps.get(0).setAction(Action.COMMENT);
            } catch (IllegalTodoFileModification e) {
View Full Code Here


    writeTrashFile("file2", "more change");
    git.add().addFilepattern("file2").call();
    git.commit().setMessage("update file2 on side").call();

    RebaseResult res = git.rebase().setUpstream("HEAD~2")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(0).setAction(Action.REWORD);
            } catch (IllegalTodoFileModification e) {
View Full Code Here

    writeTrashFile("file2", "more change");
    git.add().addFilepattern("file2").call();
    git.commit().setMessage("update file2 on side").call();

    RebaseResult res = git.rebase().setUpstream("HEAD~2")
        .runInteractively(new InteractiveHandler() {
          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(0).setAction(Action.EDIT);
            } catch (IllegalTodoFileModification e) {
              fail("unexpected exception: " + e);
View Full Code Here

    writeTrashFile("file2", "more change");
    git.add().addFilepattern("file2").call();
    git.commit().setMessage("update file2 on master\nnew line").call();

    git.rebase().setUpstream("HEAD~3")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(1).setAction(Action.SQUASH);
            } catch (IllegalTodoFileModification e) {
View Full Code Here

    writeTrashFile("file2", "more change");
    git.add().addFilepattern("file2").call();
    git.commit().setMessage("update file2 on master\nnew line").call();

    git.rebase().setUpstream("HEAD~4")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(1).setAction(Action.SQUASH);
              steps.get(2).setAction(Action.SQUASH);
View Full Code Here

    writeTrashFile("file2", "more change");
    git.add().addFilepattern("file2").call();
    git.commit().setMessage("update file2 on master\nnew line").call();

    git.rebase().setUpstream("HEAD~4")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(1).setAction(Action.FIXUP);
              steps.get(2).setAction(Action.SQUASH);
View Full Code Here

    writeTrashFile("file2", "more change");
    git.add().addFilepattern("file2").call();
    git.commit().setMessage("update file2 on master\nnew line").call();

    git.rebase().setUpstream("HEAD~3")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(1).setAction(Action.FIXUP);
            } catch (IllegalTodoFileModification e) {
View Full Code Here

    writeTrashFile(FILE1, "blah");
    git.add().addFilepattern(FILE1).call();
    git.commit().setMessage("updated file1 on master\n\nsome text").call();

    git.rebase().setUpstream("HEAD~2")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(1).setAction(Action.FIXUP);
            } catch (IllegalTodoFileModification e) {
View Full Code Here

    git.add().addFilepattern("file2").call();
    git.commit().setMessage("Add file2\nnew line").call();
    assertTrue(new File(db.getWorkTree(), "file2").exists());

    git.rebase().setUpstream("HEAD~1")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(0).setAction(Action.FIXUP);
            } catch (IllegalTodoFileModification e) {
View Full Code Here

    git.add().addFilepattern("file2").call();
    git.commit().setMessage("Add file2\nnew line").call();
    assertTrue(new File(db.getWorkTree(), "file2").exists());

    git.rebase().setUpstream("HEAD~1")
        .runInteractively(new InteractiveHandler() {

          public void prepareSteps(List<RebaseTodoLine> steps) {
            try {
              steps.get(0).setAction(Action.SQUASH);
            } catch (IllegalTodoFileModification e) {
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.api.RebaseCommand.InteractiveHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.