Package com.google.devtools.moe.client

Examples of com.google.devtools.moe.client.MoeProblem


            // -N treats absent files as empty.
            ImmutableList.of("-N", file1.getAbsolutePath(), file2.getAbsolutePath()), "");
      } catch (CommandRunner.CommandException e) {
        if (e.returnStatus != DIFF_ERROR_CODE_FILES_DIFFERENT &&
            e.returnStatus != DIFF_ERROR_CODE_FILES_BINARY) {
          throw new MoeProblem(String.format("diff returned unknown status: %d", e.returnStatus));
        }
        contentDiff = e.stdout;
      }

      return new FileDifference(
View Full Code Here


          return transConfig;
        }
      }
      throw new InvalidProject("Couldn't find translator!");
    } catch (InvalidProject e) {
      throw new MoeProblem("Error getting translations for migration: " + e);
    }
  }
View Full Code Here

              localCloneTempDir.getAbsolutePath()),
          "" /*workingDirectory*/);
      clonedLocally = true;
      revId = HgRevisionHistory.DEFAULT_BRANCH;
    } catch (CommandException e) {
      throw new MoeProblem(
          "Could not clone from hg repo at " + repositoryUrl + ": " + e.stderr);
    }
  }
View Full Code Here

    Preconditions.checkState(HgRevisionHistory.DEFAULT_BRANCH.equals(this.revId));
    try {
      runHgCommand("update", revId);
      this.revId = revId;
    } catch (CommandException e) {
      throw new MoeProblem(
          "Could not clone from hg repo at " + localCloneTempDir + ": " + e.stderr);
    }
  }
View Full Code Here

          localCloneTempDir.getAbsolutePath() /*workingDirectory*/);
      clonedLocally = true;

      AppContext.RUN.fileSystem.deleteRecursively(new File(archiveLocation, ".hg_archival.txt"));
    } catch (CommandException e) {
      throw new MoeProblem(
          "Could not archive hg clone at " + localCloneTempDir.getAbsolutePath() + ": " + e.stderr);
    } catch (IOException e) {
      throw new MoeProblem(
          "IOException archiving clone at " + localCloneTempDir.getAbsolutePath() +
          " to revision " + revId + ": " + e);
    }
    return archiveLocation;
  }
View Full Code Here

    // NB(yparghi): There may be a simpler way to do this, e.g. git diff or git commit --dry-run
    // using exit codes, but those appear flaky and this is the only reliable way I've found.
    try {
      return !Strings.isNullOrEmpty(revClone.runGitCommand("status", "--short"));
    } catch (CommandException e) {
      throw new MoeProblem("Error in git status: " + e);
    }
  }
View Full Code Here

  public void printPushMessage() {
    String moeBranchName;
    try {
      moeBranchName = revClone.runGitCommand("rev-parse", "--abbrev-ref", "HEAD").trim();
    } catch (CommandException e) {
      throw new MoeProblem("'git' command error: " + e);
    }

    Ui ui = AppContext.RUN.ui;
    ui.info("=====");
    ui.info("MOE changes have been committed to a clone at " + getRoot());
View Full Code Here

    try {
      AppContext.RUN.fileSystem.makeDirsForFile(destFile);
      AppContext.RUN.fileSystem.copyFile(inputFile, destFile);
    } catch (IOException e) {
      AppContext.RUN.ui.error(e, e.getMessage());
      throw new MoeProblem(e.getMessage());
    }
  }
View Full Code Here

    String changesetID;
    HgClonedRepository tipClone = tipCloneSupplier.get();
    try {
      changesetID = HgRepository.runHgCommand(args, tipClone.getLocalTempDir().getAbsolutePath());
    } catch (CommandException e) {
      throw new MoeProblem(
          String.format(
              "Failed hg run: %s %d %s %s",
              args.toString(),
              e.returnStatus,
              e.stdout,
View Full Code Here

   */
  @Override
  public RevisionMetadata getMetadata(Revision revision) {
    HgClonedRepository tipClone = tipCloneSupplier.get();
    if (!tipClone.getRepositoryName().equals(revision.repositoryName)) {
      throw new MoeProblem(
          String.format("Could not get metadata: Revision %s is in repository %s instead of %s",
                        revision.revId, revision.repositoryName, tipClone.getRepositoryName()));
    }
    ImmutableList<String> args = ImmutableList.of(
        "log",
        "--rev=" + revision.revId,
        // Ensure one revision only, to be safe.
        "--limit=1",
        // Format output as "changesetID < author < date < description < parents".
        // Since parents is a list, need to use stringify before applying another filter.
        "--template={node|escape} < {author|escape} < {date|date|escape} < " +
                    "{desc|escape} < {parents|stringify|escape}",
        // Use the debug option to get all parents
        "--debug");
    String log;
    try {
      log = HgRepository.runHgCommand(args, tipClone.getLocalTempDir().getAbsolutePath());
    } catch (CommandException e) {
      throw new MoeProblem(
          String.format("Failed hg run: %s %d %s %s",
                        args.toString(),
                        e.returnStatus,
                        e.stdout,
                        e.stderr));
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.MoeProblem

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.