Package org.eclipse.jgit.merge

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


        if (merger instanceof ResolveMerger) {
          ResolveMerger resolveMerger = (ResolveMerger) merger;
          resolveMerger.setCommitNames(new String[] {
              "BASE", "HEAD", ref.getName() });
          resolveMerger.setWorkingTreeIterator(new FileTreeIterator(repo));
          noProblems = merger.merge(headCommit, srcCommit);
          lowLevelResults = resolveMerger
              .getMergeResults();
          failingPaths = resolveMerger.getFailingPaths();
          unmergedPaths = resolveMerger.getUnmergedPaths();
        } else
View Full Code Here


          lowLevelResults = resolveMerger
              .getMergeResults();
          failingPaths = resolveMerger.getFailingPaths();
          unmergedPaths = resolveMerger.getUnmergedPaths();
        } else
          noProblems = merger.merge(headCommit, srcCommit);

        if (noProblems) {
          DirCacheCheckout dco = new DirCacheCheckout(repo,
              headCommit.getTree(), repo.lockDirCache(),
              merger.getResultTreeId());
View Full Code Here

  }

  private void mergeOneCommit(final CodeReviewCommit n) throws MergeException {
    final ThreeWayMerger m = newThreeWayMerger();
    try {
      if (m.merge(new AnyObjectId[] {mergeTip, n})) {
        writeMergeCommit(m.getResultTreeId(), n);

      } else {
        failed(n, CommitMergeStatus.PATH_CONFLICT);
      }
View Full Code Here

          // If there is only one parent, a cherry-pick can be done by
          // taking the delta relative to that one parent and redoing
          // that on the current merge tip.
          //
          m.setBase(n.getParent(0));
          if (m.merge(mergeTip, n)) {
            writeCherryPickCommit(m, n);

          } else {
            n.statusCode = CommitMergeStatus.PATH_CONFLICT;
          }
View Full Code Here

      throw new IOException("Change is already up to date.");
    }

    final ThreeWayMerger merger = MergeStrategy.RESOLVE.newMerger(git, true);
    merger.setBase(parentCommit);
    merger.merge(original, base);

    if (merger.getResultTreeId() == null) {
      throw new IOException(
          "The rebase failed since conflicts occured during the merge.");
    }
View Full Code Here

        if (merger instanceof ResolveMerger) {
          ResolveMerger resolveMerger = (ResolveMerger) merger;
          resolveMerger.setCommitNames(new String[] {
              "BASE", "HEAD", ref.getName() });
          resolveMerger.setWorkingTreeIterator(new FileTreeIterator(repo));
          noProblems = merger.merge(headCommit, srcCommit);
          lowLevelResults = resolveMerger
              .getMergeResults();
          failingPaths = resolveMerger.getFailingPaths();
        } else
          noProblems = merger.merge(headCommit, srcCommit);
View Full Code Here

          noProblems = merger.merge(headCommit, srcCommit);
          lowLevelResults = resolveMerger
              .getMergeResults();
          failingPaths = resolveMerger.getFailingPaths();
        } else
          noProblems = merger.merge(headCommit, srcCommit);

        if (noProblems) {
          DirCacheCheckout dco = new DirCacheCheckout(repo,
              headCommit.getTree(), repo.lockDirCache(),
              merger.getResultTreeId());
View Full Code Here

    ObjectId resultTreeId;
    if (nonNotesMergeStrategy instanceof ThreeWayMergeStrategy) {
      ThreeWayMerger m = ((ThreeWayMergeStrategy) nonNotesMergeStrategy)
          .newMerger(db, true);
      m.setBase(baseId);
      if (!m.merge(oursId, theirsId))
        throw new NotesMergeConflictException(baseList, oursList,
            theirsList);

      resultTreeId = m.getResultTreeId();
    } else {
View Full Code Here

            theirsList);

      resultTreeId = m.getResultTreeId();
    } else {
      Merger m = nonNotesMergeStrategy.newMerger(db, true);
      if (!m.merge(new AnyObjectId[] { oursId, theirsId }))
        throw new NotesMergeConflictException(baseList, oursList,
            theirsList);
      resultTreeId = m.getResultTreeId();
    }
    AbbreviatedObjectId none = AbbreviatedObjectId.fromString("");
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

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.