Package org.eclipse.jgit.internal.storage.pack

Examples of org.eclipse.jgit.internal.storage.pack.PackWriter.release()


      pw.setTagTargets(tagTargets);
      pw.preparePack(pm, allHeads, Collections.<ObjectId> emptySet());
      if (0 < pw.getObjectCount())
        writePack(GC, pw, pm);
    } finally {
      pw.release();
    }
  }

  private void packRest(ProgressMonitor pm) throws IOException {
    if (nonHeads.isEmpty())
View Full Code Here


        pw.excludeObjects(packedObjs);
      pw.preparePack(pm, nonHeads, allHeads);
      if (0 < pw.getObjectCount())
        writePack(GC, pw, pm);
    } finally {
      pw.release();
    }
  }

  private void packGarbage(ProgressMonitor pm) throws IOException {
    // TODO(sop) This is ugly. The garbage pack needs to be deleted.
View Full Code Here

      }
      pm.endTask();
      if (0 < pw.getObjectCount())
        writePack(UNREACHABLE_GARBAGE, pw, pm);
    } finally {
      pw.release();
    }
  }

  private boolean anyPackHas(AnyObjectId id) {
    for (PackWriter.ObjectIdSet packedObjs : newPackObj)
View Full Code Here

    } finally {
      statistics = pw.getStatistics();
      if (statistics != null)
        logger.onPackStatistics(statistics);
      pw.release();
    }

    if (sideband)
      pckOut.end();
  }
View Full Code Here

          }
        }
      }
      return repo.getObjectDatabase().openPack(realPack);
    } finally {
      pw.release();
      if (tmpPack != null && tmpPack.exists())
        tmpPack.delete();
      for (File tmpExt : tmpExts.values()) {
        if (tmpExt.exists())
          tmpExt.delete();
View Full Code Here

      w.write('\n');
      w.flush();
      packWriter.writePack(monitor, monitor, os);
    } finally {
      packWriter.release();
    }
  }
}
View Full Code Here

      writer.setReuseValidatingObjects(false);
      writer.setDeltaBaseAsOffset(capableOfsDelta);
      writer.preparePack(monitor, newObjects, remoteObjects);
      writer.writePack(monitor, monitor, out);
    } finally {
      writer.release();
    }
    packTransferTime = writer.getStatistics().getTimeWriting();
  }

  private void readStatusReport(final Map<String, RemoteRefUpdate> refUpdates)
View Full Code Here

      safeDelete(pathIdx);
      safeDelete(pathPack);

      throw new TransportException(uri, JGitText.get().cannotStoreObjects, err);
    } finally {
      writer.release();
    }
  }

  private void safeDelete(final String path) {
    if (path != null) {
View Full Code Here

    final RevObject o2 = writeBlob(eden, "o2");
    final PackWriter pw = new PackWriter(eden);
    pw.addObject(o2);
    pw.addObject(o1);
    write(out1, pw);
    pw.release();

    // Try the old name, then the new name. The old name should cause the
    // pack to reload when it opens and the index and pack mismatch.
    //
    assertEquals(o1.name(), parse(o1).name());
View Full Code Here

    final ObjectId name = pw.computeName();
    final File packFile = fullPackFileName(name, ".pack");
    final File idxFile = fullPackFileName(name, ".idx");
    final File[] files = new File[] { packFile, idxFile };
    write(files, pw);
    pw.release();
    return files;
  }

  private static void write(final File[] files, final PackWriter pw)
      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.