Examples of DiffCommand


Examples of com.aragost.javahg.commands.DiffCommand

    public final String getCommandName() {
        return "diff";
    }

    public static DiffCommand on(Repository repository) {
        return new DiffCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.DiffCommand

    public final String getCommandName() {
        return "diff";
    }

    public static DiffCommand on(Repository repository) {
        return new DiffCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.DiffCommand

    public final String getCommandName() {
        return "diff";
    }

    public static DiffCommand on(Repository repository) {
        return new DiffCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.DiffCommand

    public final String getCommandName() {
        return "diff";
    }

    public static DiffCommand on(Repository repository) {
        return new DiffCommand(repository);
    }
View Full Code Here

Examples of com.aragost.javahg.commands.DiffCommand

    public final String getCommandName() {
        return "diff";
    }

    public static DiffCommand on(Repository repository) {
        return new DiffCommand(repository);
    }
View Full Code Here

Examples of liquibase.command.DiffCommand

    public static void doDiff(Database referenceDatabase, Database targetDatabase, String snapshotTypes) throws LiquibaseException {
        doDiff(referenceDatabase, targetDatabase, snapshotTypes, null);
    }

    public static void doDiff(Database referenceDatabase, Database targetDatabase, String snapshotTypes, CompareControl.SchemaComparison[] schemaComparisons) throws LiquibaseException {
        DiffCommand diffCommand = new DiffCommand()
                .setReferenceDatabase(referenceDatabase)
                .setTargetDatabase(targetDatabase)
                .setCompareControl(new CompareControl(schemaComparisons, snapshotTypes))
                .setSnapshotTypes(snapshotTypes)
                .setOutputStream(System.out);

        System.out.println("");
        System.out.println("Diff Results:");
        try {
            diffCommand.execute();
        } catch (CommandExecutionException e) {
            throw new LiquibaseException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.command.DiffCommand

            throws Exception {
        Command<String> command;
        if (depth == 0) {
            command = new OneLevelDiffCommand(this, fromRevision, toRevision, path);
        } else {
            command = new DiffCommand(this, fromRevision, toRevision, path, depth);
        }
        return commandExecutor.execute(command);
    }
View Full Code Here

Examples of org.eclipse.orion.server.git.jobs.DiffCommand

          "An error occured while getting a diff.", e));
    }
  }

  private boolean handleGetDiffs(HttpServletRequest request, HttpServletResponse response, Repository db, String scope, String pattern) throws Exception {
    DiffCommand command = getDiff(request, response, db, scope, pattern, NullOutputStream.INSTANCE);
    if (command == null)
      return true;

    List<DiffEntry> l = command.call();
    JSONArray diffs = new JSONArray();
    URI diffLocation = getURI(request);
    if (pattern != null) {
      IPath patternPath = new Path(pattern);
      IPath diffPath = new Path(diffLocation.getPath());
View Full Code Here

Examples of org.eclipse.orion.server.git.jobs.DiffCommand

        .toString(), cloneLocation.getQuery(), cloneLocation.getFragment());
  }

  private boolean handleGetDiff(HttpServletRequest request, HttpServletResponse response, Repository db, String scope, String pattern, OutputStream out)
      throws Exception {
    DiffCommand command = getDiff(request, response, db, scope, pattern, new BufferedOutputStream(out));
    if (command != null)
      command.call();
    return true;
  }
View Full Code Here

Examples of org.eclipse.orion.server.git.jobs.DiffCommand

  private DiffCommand getDiff(HttpServletRequest request, HttpServletResponse response, Repository db, String scope, String pattern, OutputStream out)
      throws Exception {
    boolean ignoreWS = Boolean.parseBoolean(request.getParameter("ignoreWS")); //$NON-NLS-1$
    // Git git = new Git(db);
    DiffCommand diff = new DiffCommand(db);
    diff.setOutputStream(out);
    diff.setIgnoreWhiteSpace(ignoreWS);
    AbstractTreeIterator oldTree;
    AbstractTreeIterator newTree = new FileTreeIterator(db);
    if (scope.contains("..")) { //$NON-NLS-1$
      String[] commits = scope.split("\\.\\."); //$NON-NLS-1$
      if (commits.length != 2) {
        String msg = NLS.bind("Failed to generate diff for {0}", scope);
        statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
        return null;
      }
      oldTree = getTreeIterator(db, commits[0]);
      newTree = getTreeIterator(db, commits[1]);
    } else if (scope.equals(GitConstants.KEY_DIFF_CACHED)) {
      ObjectId head = db.resolve(Constants.HEAD + "^{tree}"); //$NON-NLS-1$
      if (head == null) {
        String msg = NLS.bind("Failed to generate diff for {0}, no HEAD", scope);
        statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST, msg, null));
        return null;
      }
      CanonicalTreeParser p = new CanonicalTreeParser();
      ObjectReader reader = db.newObjectReader();
      try {
        p.reset(reader, head);
      } finally {
        reader.release();
      }
      oldTree = p;
      newTree = new DirCacheIterator(db.readDirCache());
    } else if (scope.equals(GitConstants.KEY_DIFF_DEFAULT)) {
      oldTree = new DirCacheIterator(db.readDirCache());
    } else {
      oldTree = getTreeIterator(db, scope);
    }

    String[] paths = request.getParameterValues(ProtocolConstants.KEY_PATH);
    TreeFilter filter = null;
    TreeFilter pathFilter = null;
    if (paths != null) {
      if (paths.length > 1) {
        Set<TreeFilter> pathFilters = new HashSet<TreeFilter>(paths.length);
        for (String path : paths) {
          pathFilters.add(PathFilter.create(path));
        }
        pathFilter = OrTreeFilter.create(pathFilters);
      } else if (paths.length == 1) {
        pathFilter = PathFilter.create(paths[0]);
      }
    }
    if (pattern != null) {
      PathFilter patternFilter = PathFilter.create(pattern);
      if (pathFilter != null)
        filter = AndTreeFilter.create(patternFilter, pathFilter);
      else
        filter = patternFilter;
    } else {
      filter = pathFilter;
    }
    if (filter != null)
      diff.setPathFilter(filter);

    diff.setOldTree(oldTree);
    diff.setNewTree(newTree);
    return diff;
  }
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.