Package org.tmatesoft.hg.repo

Examples of org.tmatesoft.hg.repo.HgRepositoryLock.acquire()


  public void execute(Mediator mediator) throws HgCallbackTargetException, HgRepositoryLockException, HgIOException, HgLibraryFailureException, CancelledException {
    if (firstCset == BAD_REVISION || secondCset == BAD_REVISION || ancestorCset == BAD_REVISION) {
      throw new IllegalArgumentException("Merge heads and their ancestors are not initialized");
    }
    final HgRepositoryLock wdLock = repo.getWorkingDirLock();
    wdLock.acquire();
    try {
      Pool<Nodeid> cacheRevs = new Pool<Nodeid>();
      Pool<Path> cacheFiles = new Pool<Path>();

      Internals implRepo = Internals.getInstance(repo);
View Full Code Here


    final OutputParser.Stub p = new OutputParser.Stub();
    ExecHelper eh = new ExecHelper(p, repoLoc);
    HgRepository hgRepo = new HgLookup().detect(repoLoc);
    final HgRepositoryLock wdLock = hgRepo.getWorkingDirLock();
    try {
      wdLock.acquire();
      eh.run("hg", "tag", "tag-aaa");
      Assert.assertNotSame(0 /*returns 0 on success*/, eh.getExitValue());
      Assert.assertTrue(p.result().toString().contains("abort"));
    } finally {
      wdLock.release();
View Full Code Here

      HgRepository hgRepo = hgLookup.detect(repoLoc);
      final HgRepositoryLock wcLock = hgRepo.getWorkingDirLock();
      final HgRepositoryLock storeLock = hgRepo.getStoreLock();
      wcLock.acquire();
      System.out.print(".");
      storeLock.acquire();
      System.out.print(".");
      try {
        new HgStatusCommand(hgRepo).execute(new TestStatus.StatusCollector());
        System.out.printf("%d ms)\n", (System.nanoTime() - start) / 1000000);
      } finally {
View Full Code Here

   * @throws HgRepositoryLockException if failed to lock the repo for modifications
   * @throws CancelledException if execution of the command was cancelled
   */
  public void execute() throws HgException, HgRepositoryLockException, CancelledException {
    final HgRepositoryLock wdLock = repo.getWorkingDirLock();
    wdLock.acquire();
    try {
      final ProgressSupport progress = getProgressSupport(null);
      final CancelSupport cancellation = getCancelSupport(null, true);
      cancellation.checkCancelled();
      progress.start(2 + toAdd.size() + toRemove.size());
View Full Code Here

   * @throws HgException subclass thereof to indicate specific issue with the command arguments or repository state
   * @throws CancelledException if execution of the command was cancelled
   */
  public void execute() throws HgException, CancelledException {
    final HgRepositoryLock wdLock = repo.getWorkingDirLock();
    wdLock.acquire();
    try {
      final ProgressSupport progress = getProgressSupport(null);
      final CancelSupport cancellation = getCancelSupport(null, true);
      cancellation.checkCancelled();
      progress.start(files.size() + 2);
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.