Package org.eclipse.jgit.treewalk

Examples of org.eclipse.jgit.treewalk.NameConflictTreeWalk


    updated.clear();
    conflicts.clear();

    builder = dc.builder();

    walk = new NameConflictTreeWalk(repo);
    addTree(walk, mergeCommitTree);
    walk.addTree(new DirCacheBuildIterator(builder));
    walk.addTree(workingTree);

    while (walk.next()) {
View Full Code Here


   * @throws CorruptObjectException
   * @throws IOException
   */
  private boolean isModifiedSubtree_IndexWorkingtree(String path)
      throws CorruptObjectException, IOException {
    NameConflictTreeWalk tw = new NameConflictTreeWalk(repo);
    try {
      tw.addTree(new DirCacheIterator(dc));
      tw.addTree(new FileTreeIterator(repo));
      tw.setRecursive(true);
      tw.setFilter(PathFilter.create(path));
      DirCacheIterator dcIt;
      WorkingTreeIterator wtIt;
      while (tw.next()) {
        dcIt = tw.getTree(0, DirCacheIterator.class);
        wtIt = tw.getTree(1, WorkingTreeIterator.class);
        if (dcIt == null || wtIt == null)
          return true;
        if (wtIt.isModified(dcIt.getDirCacheEntry(), true,
            this.walk.getObjectReader())) {
          return true;
        }
      }
      return false;
    } finally {
      tw.release();
    }
  }
View Full Code Here

   * @throws CorruptObjectException
   * @throws IOException
   */
  private boolean isModifiedSubtree_IndexTree(String path, ObjectId tree)
      throws CorruptObjectException, IOException {
    NameConflictTreeWalk tw = new NameConflictTreeWalk(repo);
    try {
      tw.addTree(new DirCacheIterator(dc));
      tw.addTree(tree);
      tw.setRecursive(true);
      tw.setFilter(PathFilter.create(path));
      while (tw.next()) {
        AbstractTreeIterator dcIt = tw.getTree(0,
            DirCacheIterator.class);
        AbstractTreeIterator treeIt = tw.getTree(1,
            AbstractTreeIterator.class);
        if (dcIt == null || treeIt == null)
          return true;
        if (dcIt.getEntryRawMode() != treeIt.getEntryRawMode())
          return true;
        if (!dcIt.getEntryObjectId().equals(treeIt.getEntryObjectId()))
          return true;
      }
      return false;
    } finally {
      tw.release();
    }
  }
View Full Code Here

      throws IOException {

    builder = dircache.builder();
    DirCacheBuildIterator buildIt = new DirCacheBuildIterator(builder);

    tw = new NameConflictTreeWalk(reader);
    tw.addTree(baseTree);
    tw.addTree(headTree);
    tw.addTree(mergeTree);
    tw.addTree(buildIt);
    if (workingTreeIterator != null)
View Full Code Here

      if (i % 4 == 0)
        fsTick(lastFile);
    }
    FileTreeIteratorWithTimeControl fileIt = new FileTreeIteratorWithTimeControl(
        db, modTimes);
    NameConflictTreeWalk tw = new NameConflictTreeWalk(db);
    tw.addTree(fileIt);
    tw.setRecursive(true);
    FileTreeIterator t;
    long t0 = 0;
    for (int i = 0; i < 10; i++) {
      assertTrue(tw.next());
      t = tw.getTree(0, FileTreeIterator.class);
      if (i == 0)
        t0 = t.getEntryLastModified();
      else
        assertEquals(t0, t.getEntryLastModified());
    }
    long t1 = 0;
    for (int i = 0; i < 10; i++) {
      assertTrue(tw.next());
      t = tw.getTree(0, FileTreeIterator.class);
      if (i == 0) {
        t1 = t.getEntryLastModified();
        assertTrue(t1 > t0);
      } else
        assertEquals(t1, t.getEntryLastModified());
    }
    long t2 = 0;
    for (int i = 0; i < 10; i++) {
      assertTrue(tw.next());
      t = tw.getTree(0, FileTreeIterator.class);
      if (i == 0) {
        t2 = t.getEntryLastModified();
        assertTrue(t2 > t1);
      } else
        assertEquals(t2, t.getEntryLastModified());
View Full Code Here

    try {
      builder = dircache.builder();
      DirCacheBuildIterator buildIt = new DirCacheBuildIterator(builder);

      tw = new NameConflictTreeWalk(db);
      tw.addTree(mergeBase());
      tw.addTree(sourceTrees[0]);
      tw.addTree(sourceTrees[1]);
      tw.addTree(buildIt);
      if (workingTreeIterator != null)
View Full Code Here

   */
  public void preScanTwoTrees() throws CorruptObjectException, IOException {
    removed.clear();
    updated.clear();
    conflicts.clear();
    walk = new NameConflictTreeWalk(repo);
    builder = dc.builder();

    addTree(walk, headCommitTree);
    addTree(walk, mergeCommitTree);
    walk.addTree(new DirCacheBuildIterator(builder));
View Full Code Here

    updated.clear();
    conflicts.clear();

    builder = dc.builder();

    walk = new NameConflictTreeWalk(repo);
    walk.addTree(mergeCommitTree);
    walk.addTree(new DirCacheBuildIterator(builder));
    walk.addTree(workingTree);

    while (walk.next()) {
View Full Code Here

      removeEmptyParents(file);
    }
  }

  private boolean isModified(String path) throws CorruptObjectException, IOException {
    NameConflictTreeWalk tw = new NameConflictTreeWalk(repo);
    tw.addTree(new DirCacheIterator(dc));
    tw.addTree(new FileTreeIterator(repo));
    tw.setRecursive(true);
    tw.setFilter(PathFilter.create(path));
    DirCacheIterator dcIt;
    WorkingTreeIterator wtIt;
    while(tw.next()) {
      dcIt = tw.getTree(0, DirCacheIterator.class);
      wtIt = tw.getTree(1, WorkingTreeIterator.class);
      if (dcIt == null || wtIt == null)
        return true;
      if (wtIt.isModified(dcIt.getDirCacheEntry(), true)) {
        return true;
      }
View Full Code Here

      for (int i=0; i<dc.getEntryCount(); ++i)
        timeStamps.add(Long.valueOf(dc.getEntry(i).getLastModified()));
    }

    // iterate again, now produce the result string
    NameConflictTreeWalk tw = new NameConflictTreeWalk(db);
    tw.setRecursive(true);
    tw.reset();
    tw.addTree(new DirCacheIterator(dc));
    while (tw.next()) {
      DirCacheIterator dcIt = tw.getTree(0, DirCacheIterator.class);
      sb.append("["+tw.getPathString()+", mode:" + dcIt.getEntryFileMode());
      int stage = dcIt.getDirCacheEntry().getStage();
      if (stage != 0)
        sb.append(", stage:" + stage);
      if (0 != (includedOptions & MOD_TIME)) {
        sb.append(", time:t"+
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.treewalk.NameConflictTreeWalk

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.