Package org.eclipse.jgit.diff

Examples of org.eclipse.jgit.diff.RawText


   * @throws IOException
   */
  private MergeResult<RawText> contentMerge(CanonicalTreeParser base,
      CanonicalTreeParser ours, CanonicalTreeParser theirs)
      throws IOException {
    RawText baseText = base == null ? RawText.EMPTY_TEXT : getRawText(
        base.getEntryObjectId(), db);
    RawText ourText = ours == null ? RawText.EMPTY_TEXT : getRawText(
        ours.getEntryObjectId(), db);
    RawText theirsText = theirs == null ? RawText.EMPTY_TEXT : getRawText(
        theirs.getEntryObjectId(), db);
    return (mergeAlgorithm.merge(RawTextComparator.DEFAULT, baseText,
        ourText, theirsText));
  }
View Full Code Here


  }

  private static RawText getRawText(ObjectId id, Repository db)
      throws IOException {
    if (id.equals(ObjectId.zeroId()))
      return new RawText(new byte[] {});
    return new RawText(db.open(id, Constants.OBJ_BLOB).getCachedBytes());
  }
View Full Code Here

   * @throws IOException
   *             the repository cannot be read.
   */
  public BlameGenerator push(String description, byte[] contents)
      throws IOException {
    return push(description, new RawText(contents));
  }
View Full Code Here

    if (ldr.getType() == OBJ_BLOB) {
      if (description == null)
        description = JGitText.get().blameNotCommittedYet;
      BlobCandidate c = new BlobCandidate(description, resultPath);
      c.sourceBlob = id.toObjectId();
      c.sourceText = new RawText(ldr.getCachedBytes(Integer.MAX_VALUE));
      c.regionList = new Region(0, 0, c.sourceText.size());
      remaining = c.sourceText.size();
      push(c);
      return this;
    }
View Full Code Here

          if (0 <= entry)
            gen.push(null, dc.getEntry(entry).getObjectId());

          File inTree = new File(repo.getWorkTree(), path);
          if (inTree.isFile())
            gen.push(null, new RawText(inTree));
        }
      }
      return gen.computeBlameResult();
    } catch (IOException e) {
      throw new JGitInternalException(e.getMessage(), e);
View Full Code Here

   * @throws IOException
   *             the repository cannot be read.
   */
  public BlameGenerator push(String description, byte[] contents)
      throws IOException {
    return push(description, new RawText(contents));
  }
View Full Code Here

    if (ldr.getType() == OBJ_BLOB) {
      if (description == null)
        description = JGitText.get().blameNotCommittedYet;
      BlobCandidate c = new BlobCandidate(description, resultPath);
      c.sourceBlob = id.toObjectId();
      c.sourceText = new RawText(ldr.getCachedBytes(Integer.MAX_VALUE));
      c.regionList = new Region(0, 0, c.sourceText.size());
      remaining = c.sourceText.size();
      push(c);
      return this;
    }
View Full Code Here

        }

        unmergedPaths.add(tw.getPathString());

        // generate a MergeResult for the deleted file
        RawText baseText = base == null ? RawText.EMPTY_TEXT
            : getRawText(base.getEntryObjectId(), db);
        RawText ourText = ours == null ? RawText.EMPTY_TEXT
            : getRawText(ours.getEntryObjectId(), db);
        RawText theirsText = theirs == null ? RawText.EMPTY_TEXT
            : getRawText(theirs.getEntryObjectId(), db);
        MergeResult<RawText> result = mergeAlgorithm.merge(
            RawTextComparator.DEFAULT, baseText, ourText,
            theirsText);
        mergeResults.put(tw.getPathString(), result);
View Full Code Here

  private boolean contentMerge(CanonicalTreeParser base,
      CanonicalTreeParser ours, CanonicalTreeParser theirs)
      throws FileNotFoundException, IllegalStateException, IOException {
    MergeFormatter fmt = new MergeFormatter();

    RawText baseText = base == null ? RawText.EMPTY_TEXT : getRawText(
        base.getEntryObjectId(), db);

    // do the merge
    MergeResult<RawText> result = mergeAlgorithm.merge(
        RawTextComparator.DEFAULT, baseText,
View Full Code Here

  }

  private static RawText getRawText(ObjectId id, Repository db)
      throws IOException {
    if (id.equals(ObjectId.zeroId()))
      return new RawText(new byte[] {});
    return new RawText(db.open(id, Constants.OBJ_BLOB).getCachedBytes());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.diff.RawText

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.