Package org.eclipse.jgit.merge

Examples of org.eclipse.jgit.merge.ResolveMerger.merge()


         ResolveMerger merger = (ResolveMerger) MergeStrategy.RESOLVE
                  .newMerger(repo);
         merger.setWorkingTreeIterator(new FileTreeIterator(repo));
         merger.setBase(srcParent.getTree());
         if (merger.merge(headCommit, srcCommit))
         {
            DirCacheCheckout dco = new DirCacheCheckout(repo,
                     headCommit.getTree(), repo.lockDirCache(),
                     merger.getResultTreeId());
            dco.setFailOnConflict(true);
View Full Code Here


      ResolveMerger merger = (ResolveMerger) strategy.newMerger(repo);
      merger.setCommitNames(new String[] { "stashed HEAD", "HEAD",
          "stash" });
      merger.setBase(stashHeadCommit);
      merger.setWorkingTreeIterator(new FileTreeIterator(repo));
      if (merger.merge(headCommit, stashCommit)) {
        DirCache dc = repo.lockDirCache();
        DirCacheCheckout dco = new DirCacheCheckout(repo, headTree,
            dc, merger.getResultTreeId());
        dco.setFailOnConflict(true);
        dco.checkout(); // Ignoring failed deletes....
View Full Code Here

          ResolveMerger ixMerger = (ResolveMerger) strategy
              .newMerger(repo, true);
          ixMerger.setCommitNames(new String[] { "stashed HEAD",
              "HEAD", "stashed index" });
          ixMerger.setBase(stashHeadCommit);
          boolean ok = ixMerger.merge(headCommit, stashIndexCommit);
          if (ok) {
            resetIndex(revWalk
                .parseTree(ixMerger.getResultTreeId()));
          } else {
            throw new StashApplyFailureException(
View Full Code Here

          ResolveMerger untrackedMerger = (ResolveMerger) strategy
              .newMerger(repo, true);
          untrackedMerger.setCommitNames(new String[] {
              "stashed HEAD", "HEAD", "untracked files" }); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
          untrackedMerger.setBase(stashHeadCommit);
          boolean ok = untrackedMerger.merge(headCommit,
              untrackedCommit);
          if (ok)
            try {
              RevTree untrackedTree = revWalk
                  .parseTree(untrackedMerger
View Full Code Here

        ResolveMerger merger = (ResolveMerger) strategy.newMerger(repo);
        merger.setWorkingTreeIterator(new FileTreeIterator(repo));
        merger.setBase(srcParent.getTree());
        merger.setCommitNames(new String[] { "BASE", ourName,
            cherryPickName });
        if (merger.merge(newHead, srcCommit)) {
          if (AnyObjectId.equals(newHead.getTree().getId(), merger
              .getResultTreeId()))
            continue;
          DirCacheCheckout dco = new DirCacheCheckout(repo,
              newHead.getTree(), repo.lockDirCache(),
View Full Code Here

        String shortMessage = "Revert \"" + srcCommit.getShortMessage() //$NON-NLS-1$
            + "\""; //$NON-NLS-1$
        String newMessage = shortMessage + "\n\n" //$NON-NLS-1$
            + "This reverts commit " + srcCommit.getId().getName() //$NON-NLS-1$
            + ".\n"; //$NON-NLS-1$
        if (merger.merge(headCommit, srcParent)) {
          if (AnyObjectId.equals(headCommit.getTree().getId(), merger
              .getResultTreeId()))
            continue;
          DirCacheCheckout dco = new DirCacheCheckout(repo,
              headCommit.getTree(), repo.lockDirCache(),
View Full Code Here

        }
      };
      // use #merge to set sourceObjects
      String tip0 = GitUtils.decode(commits[0]);
      String tip1 = GitUtils.decode(commits[1]);
      merger.merge(new ObjectId[] { db.resolve(tip0), db.resolve(tip1) });
      RevCommit baseCommit = merger.getBaseCommit(0, 1);

      IPath p = new Path(GitServlet.GIT_URI + '/' + Commit.RESOURCE).append(baseCommit.getId().getName()).append(path.removeFirstSegments(1));
      return new URI(location.getScheme(), location.getUserInfo(), location.getHost(), location.getPort(), p.toString(), "parts=body", null); //$NON-NLS-1$
    } else if (scope.equals(GitConstants.KEY_DIFF_CACHED)) {
View Full Code Here

      ResolveMerger merger = (ResolveMerger) strategy.newMerger(repo);
      merger.setCommitNames(new String[] { "stashed HEAD", "HEAD", "stash" });
      merger.setBase(stashHeadCommit);
      merger.setWorkingTreeIterator(new FileTreeIterator(repo));
      if (merger.merge(headCommit, stashCommit)) {
        DirCache dc = repo.lockDirCache();
        DirCacheCheckout dco = new DirCacheCheckout(repo, headTree, dc, merger.getResultTreeId());
        dco.setFailOnConflict(true);
        dco.checkout(); // Ignoring failed deletes....
        if (applyIndex) {
View Full Code Here

        dco.checkout(); // Ignoring failed deletes....
        if (applyIndex) {
          ResolveMerger ixMerger = (ResolveMerger) strategy.newMerger(repo, true);
          ixMerger.setCommitNames(new String[] { "stashed HEAD", "HEAD", "stashed index" });
          ixMerger.setBase(stashHeadCommit);
          boolean ok = ixMerger.merge(headCommit, stashIndexCommit);
          if (ok) {
            resetIndex(revWalk.parseTree(ixMerger.getResultTreeId()));
          } else {
            throw new StashApplyFailureException(JGitText.get().stashApplyConflict);
          }
View Full Code Here

        if (untrackedCommit != null) {
          ResolveMerger untrackedMerger = (ResolveMerger) strategy.newMerger(repo, true);
          untrackedMerger.setCommitNames(new String[] { "stashed HEAD", "HEAD", "untracked files" }); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
          untrackedMerger.setBase(stashHeadCommit);
          boolean ok = untrackedMerger.merge(stashHeadCommit, untrackedCommit);
          if (ok)
            try {
              RevTree untrackedTree = revWalk.parseTree(untrackedMerger.getResultTreeId());
              resetUntracked(untrackedTree);
            } catch (CheckoutConflictException e) {
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.