Examples of DraftRevision


Examples of com.google.devtools.moe.client.writer.DraftRevision

   *
   * @return a DraftRevision on success, or null on failure
   */
  public static DraftRevision change(
      Codebase c, Writer destination, @Nullable RevisionMetadata rm) {
    DraftRevision r;
    try {
      Ui.Task t = AppContext.RUN.ui.pushTask(
          "push_codebase",
          "Putting files from Codebase into Writer");
      r = (rm == null) ? destination.putCodebase(c) : destination.putCodebase(c, rm);
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

      return 1;
    }

    AppContext.RUN.ui.info(String.format("Migrating '%s' to '%s'", fromRepoEx, toRepoEx));

    DraftRevision r = OneMigrationLogic.migrate(c, destination, revs, context, revs.get(0));
    if (r == null) {
      return 1;
    }

    AppContext.RUN.ui.info("Created Draft Revision: " + r.getLocation());
    return 0;
  }
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

        toWriter = toRe.createWriter(context);
      } catch (WritingError e) {
        throw new MoeProblem("Couldn't create local repo " + toRe + ": " + e);
      }

      DraftRevision dr = null;
      Revision lastMigratedRevision = null;
      if (lastEq != null) {
        lastMigratedRevision = lastEq.getRevisionForRepository(migrationConfig.getFromRepository());
      }

      for (Migration m : migrations) {
        // For each migration, the reference to-codebase for inverse translation is the Writer,
        // since it contains the latest changes (i.e. previous migrations) to the to-repository.
        Expression referenceToCodebase = new RepositoryExpression(migrationConfig.getToRepository())
              .withOption("localroot", toWriter.getRoot().getAbsolutePath());

        Ui.Task oneMigrationTask = AppContext.RUN.ui.pushTask(
            "perform_individual_migration",
            String.format("Performing individual migration '%s'", m.toString()));
        dr = OneMigrationLogic.migrate(m, context, toWriter, referenceToCodebase);
        lastMigratedRevision = m.fromRevisions.get(m.fromRevisions.size() - 1);
        AppContext.RUN.ui.popTask(oneMigrationTask, "");
      }

      // TODO(user): Add properly formatted one-DraftRevison-per-Migration message for svn.
      migrationsMadeBuilder.add(String.format(
          "%s in repository %s", dr.getLocation(), migrationConfig.getToRepository()));
      toWriter.printPushMessage();
      AppContext.RUN.ui.popTaskAndPersist(migrationTask, toWriter.getRoot());
    }

    List<String> migrationsMade = migrationsMadeBuilder.build();
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

    } catch (WritingError e) {
      AppContext.RUN.ui.error(e, "Error writing change");
      return 1;
    }

    DraftRevision r = ChangeLogic.change(c, destination);
    if (r == null) {
      return 1;
    }

    AppContext.RUN.ui.popTaskAndPersist(changeTask, destination.getRoot());
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

    // Expect no other mockFs calls from GitWriter.putFile().

    control.replay();

    GitWriter w = new GitWriter(mockRevClone);
    DraftRevision dr = w.putCodebase(codebase);

    control.verify();

    assertEquals(writerRoot.getAbsolutePath(), dr.getLocation());
  }
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

    expectGitCmd("add", "file1");

    control.replay();

    GitWriter w = new GitWriter(mockRevClone);
    DraftRevision dr = w.putCodebase(codebase);

    control.verify();
  }
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

    expectGitCmd("add", "file1");

    control.replay();

    GitWriter w = new GitWriter(mockRevClone);
    DraftRevision dr = w.putCodebase(codebase);

    control.verify();
  }
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

    expectGitCmd("rm", "file1");

    control.replay();

    GitWriter w = new GitWriter(mockRevClone);
    DraftRevision dr = w.putCodebase(codebase);

    control.verify();
  }
View Full Code Here

Examples of com.google.devtools.moe.client.writer.DraftRevision

    expectGitCmd("rm", "not_really_ignored_dir/file1");

    control.replay();

    GitWriter w = new GitWriter(mockRevClone);
    DraftRevision dr = w.putCodebase(codebase);

    control.verify();

    assertEquals(writerRoot.getAbsolutePath(), dr.getLocation());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.