Examples of PackLock


Examples of org.eclipse.jgit.internal.storage.file.PackLock

      WalkRemoteObjectDatabase.FileStream s = connection.open(name);
      PackParser parser = inserter.newPackParser(s.in);
      parser.setAllowThin(false);
      parser.setObjectChecker(objCheck);
      parser.setLockMessage(lockMessage);
      PackLock lock = parser.parse(monitor);
      if (lock != null)
        packLocks.add(lock);
      inserter.flush();
    }
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.PackLock

      WalkRemoteObjectDatabase.FileStream s = connection.open(name);
      PackParser parser = inserter.newPackParser(s.in);
      parser.setAllowThin(false);
      parser.setObjectChecker(objCheck);
      parser.setLockMessage(lockMessage);
      PackLock lock = parser.parse(monitor);
      if (lock != null)
        packLocks.add(lock);
      inserter.flush();
    }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.PackLock

      WalkRemoteObjectDatabase.FileStream s = connection.open(name);
      PackParser parser = inserter.newPackParser(s.in);
      parser.setAllowThin(false);
      parser.setObjectChecker(objCheck);
      parser.setLockMessage(lockMessage);
      PackLock lock = parser.parse(monitor);
      if (lock != null)
        packLocks.add(lock);
      inserter.flush();
    }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.PackLock

      WalkRemoteObjectDatabase.FileStream s = connection.open(name);
      PackParser parser = inserter.newPackParser(s.in);
      parser.setAllowThin(false);
      parser.setObjectChecker(objCheck);
      parser.setLockMessage(lockMessage);
      PackLock lock = parser.parse(monitor);
      if (lock != null)
        packLocks.add(lock);
      inserter.flush();
    }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.PackLock

      s = connection.open("pack/" + packName);
      ip = IndexPack.create(local, s.in);
      ip.setFixThin(false);
      ip.setObjectChecker(objCheck);
      ip.index(monitor);
      final PackLock keep = ip.renameAndOpenPack(lockMessage);
      if (keep != null)
        packLocks.add(keep);
    }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.PackLock

    final String name = ObjectId.fromRaw(d.digest()).name();
    final File packDir = new File(repo.getObjectsDirectory(), "pack");
    final File finalPack = new File(packDir, "pack-" + name + ".pack");
    final File finalIdx = new File(packDir, "pack-" + name + ".idx");
    final PackLock keep = new PackLock(finalPack, repo.getFS());

    if (!packDir.exists() && !packDir.mkdir() && !packDir.exists()) {
      // The objects/pack directory isn't present, and we are unable
      // to create it. There is no way to move this pack in.
      //
      cleanupTemporaryFiles();
      throw new IOException(MessageFormat.format(JGitText.get().cannotCreateDirectory, packDir.getAbsolutePath()));
    }

    if (finalPack.exists()) {
      // If the pack is already present we should never replace it.
      //
      cleanupTemporaryFiles();
      return null;
    }

    if (lockMessage != null) {
      // If we have a reason to create a keep file for this pack, do
      // so, or fail fast and don't put the pack in place.
      //
      try {
        if (!keep.lock(lockMessage))
          throw new IOException(MessageFormat.format(JGitText.get().cannotLockPackIn, finalPack));
      } catch (IOException e) {
        cleanupTemporaryFiles();
        throw e;
      }
    }

    if (!dstPack.renameTo(finalPack)) {
      cleanupTemporaryFiles();
      keep.unlock();
      throw new IOException(MessageFormat.format(JGitText.get().cannotMovePackTo, finalPack));
    }

    if (!dstIdx.renameTo(finalIdx)) {
      cleanupTemporaryFiles();
      keep.unlock();
      if (!finalPack.delete())
        finalPack.deleteOnExit();
      throw new IOException(MessageFormat.format(JGitText.get().cannotMoveIndexTo, finalIdx));
    }

    try {
      repo.openPack(finalPack, finalIdx);
    } catch (IOException err) {
      keep.unlock();
      finalPack.delete();
      finalIdx.delete();
      throw err;
    }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.PackLock

      WalkRemoteObjectDatabase.FileStream s = connection.open(name);
      PackParser parser = inserter.newPackParser(s.in);
      parser.setAllowThin(false);
      parser.setObjectChecker(objCheck);
      parser.setLockMessage(lockMessage);
      PackLock lock = parser.parse(monitor);
      if (lock != null)
        packLocks.add(lock);
      inserter.flush();
    }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.PackLock

  @Override
  public PackLock parse(ProgressMonitor receiving, ProgressMonitor resolving)
      throws IOException {
    boolean success = false;
    try {
      PackLock lock = super.parse(receiving, resolving);

      chunkReadBackCache = null;
      openChunks = null;
      openEdges = null;
      treeParser = null;
View Full Code Here

Examples of org.eclipse.jgit.storage.file.PackLock

      WalkRemoteObjectDatabase.FileStream s = connection.open(name);
      PackParser parser = inserter.newPackParser(s.in);
      parser.setAllowThin(false);
      parser.setObjectChecker(objCheck);
      parser.setLockMessage(lockMessage);
      PackLock lock = parser.parse(monitor);
      if (lock != null)
        packLocks.add(lock);
      inserter.flush();
    }
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.