Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCache.unlock()


            FileUtils.delete(fileToDelete, FileUtils.RECURSIVE
                | FileUtils.RETRY);
        }
      }
    } finally {
      dc.unlock();
    }
    RevWalk rw = new RevWalk(repo);
    RevCommit commit = rw.parseCommit(repo.resolve(Constants.HEAD));
    rw.release();
    return commit;
View Full Code Here


      conflictListFailure = true;
    } finally {
      if (rw != null)
        rw.release();
      if (dc != null)
        dc.unlock();
    }

    boolean mergeToolAvailable = true;
    final CheckResult checkResult;
    if (!conflictListFailure) {
View Full Code Here

    } catch (IOException e) {
      Activator.handleError(
          UIText.CompareWithIndexAction_errorOnAddToIndex, e, true);
    } finally {
      if (cache != null)
        cache.unlock();
    }
  }

  private static class DirCacheEntryEditor extends DirCacheEditor.PathEdit {
View Full Code Here

    DirCache dirc = null;
    try {
      dirc = map.getRepository().lockDirCache();
      final int first = dirc.findEntry(repoRelativePath);
      if (first < 0) {
        dirc.unlock();
        return false;
      }

      final DirCacheBuilder edit = dirc.builder();
      if (first > 0)
View Full Code Here

    } catch (IOException e) {
      tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(), 0,
          CoreText.MoveDeleteHook_operationError, e));
    } finally {
      if (dirc != null)
        dirc.unlock();
    }
    return true;
  }

  public boolean deleteFolder(final IResourceTree tree, final IFolder folder,
View Full Code Here

    } catch (IOException e) {
      tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(), 0,
          CoreText.MoveDeleteHook_operationError, e));
    } finally {
      if (sCache != null)
        sCache.unlock();
    }
    return I_AM_DONE;
  }

  public boolean moveFolder(final IResourceTree tree, final IFolder srcf,
View Full Code Here

    final DirCache sCache = srcm.getRepository().lockDirCache();
    try {
      final DirCacheEntry[] sEnt = sCache.getEntriesWithin(sPath);
      if (sEnt.length == 0) {
        sCache.unlock();
        return MoveResult.UNTRACKED;
      }

      final DirCacheEditor sEdit = sCache.editor();
      sEdit.add(new DirCacheEditor.DeleteTree(sPath));
View Full Code Here

        return MoveResult.SUCCESS;
      else
        return MoveResult.FAILED;
    } finally {
      if (sCache != null)
        sCache.unlock();
    }
  }

  private boolean cannotModifyRepository(final IResourceTree tree) {
    tree.failed(new Status(IStatus.ERROR, Activator.getPluginId(), 0,
View Full Code Here

    assertTrue(new File(destinationRepo, SampleTestRepository.A_txt_name)
        .exists());
    DirCacheEntry fileEntry = null;
    DirCache dc = repository.lockDirCache();
    fileEntry = dc.getEntry(SampleTestRepository.A_txt_name);
    dc.unlock();
    // check that we have the file in the index
    assertNotNull(fileEntry);
    // No project has been imported
    assertEquals(0,
        ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
View Full Code Here

    try {
      for (DirCacheEntry entry : entries)
        builder.add(entry);
      builder.commit();
    } finally {
      dirCache.unlock();
    }
  }

  private DirCacheEntry entry(String path, int stage, String data)
      throws IOException {
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.