Ver código fonte

Move PackWriter over to storage.pack.PackWriter

Similar to what we did with the file code, move the pack writer
into its own package so the related classes and their package
private methods are hidden from the rest of the library.

Change-Id: Ic1b5c7c8c8d266e90c910d8d68dfc8e93586854f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.9.1
Shawn O. Pearce 14 anos atrás
pai
commit
ea21c111cb
26 arquivos alterados com 53 adições e 33 exclusões
  1. 1
    0
      org.eclipse.jgit.junit/META-INF/MANIFEST.MF
  2. 1
    1
      org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
  3. 1
    0
      org.eclipse.jgit.test/META-INF/MANIFEST.MF
  4. 1
    1
      org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java
  5. 1
    1
      org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java
  6. 1
    0
      org.eclipse.jgit/META-INF/MANIFEST.MF
  7. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java
  8. 1
    0
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
  9. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/CachedObjectDirectory.java
  10. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileObjectDatabase.java
  11. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LocalObjectRepresentation.java
  12. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LocalObjectToPack.java
  13. 2
    2
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
  14. 3
    3
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
  15. 4
    4
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java
  16. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/BinaryDelta.java
  17. 2
    1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectReuseAsIs.java
  18. 3
    1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java
  19. 2
    1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackOutputStream.java
  20. 13
    3
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java
  21. 3
    1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/StoredObjectRepresentation.java
  22. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
  23. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java
  24. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
  25. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
  26. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java

+ 1
- 0
org.eclipse.jgit.junit/META-INF/MANIFEST.MF Ver arquivo

@@ -19,6 +19,7 @@ Import-Package: junit.framework;version="[3.8.2,4.0.0)",
org.eclipse.jgit.revwalk;version="[0.9.0,0.10.0)",
org.eclipse.jgit.revwalk.filter;version="[0.9.0,0.10.0)",
org.eclipse.jgit.storage.file;version="[0.9.0,0.10.0)",
org.eclipse.jgit.storage.pack;version="[0.9.0,0.10.0)",
org.eclipse.jgit.transport;version="[0.9.0,0.10.0)",
org.eclipse.jgit.treewalk;version="[0.9.0,0.10.0)",
org.eclipse.jgit.treewalk.filter;version="[0.9.0,0.10.0)",

+ 1
- 1
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java Ver arquivo

@@ -77,7 +77,6 @@ import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectChecker;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectInserter;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefUpdate;
@@ -96,6 +95,7 @@ import org.eclipse.jgit.storage.file.LockFile;
import org.eclipse.jgit.storage.file.ObjectDirectory;
import org.eclipse.jgit.storage.file.PackFile;
import org.eclipse.jgit.storage.file.PackIndex.MutableEntry;
import org.eclipse.jgit.storage.pack.PackWriter;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;


+ 1
- 0
org.eclipse.jgit.test/META-INF/MANIFEST.MF Ver arquivo

@@ -29,6 +29,7 @@ Import-Package: junit.framework;version="[3.8.2,4.0.0)",
org.eclipse.jgit.revwalk;version="[0.9.0,0.10.0)",
org.eclipse.jgit.revwalk.filter;version="[0.9.0,0.10.0)",
org.eclipse.jgit.storage.file;version="[0.9.0,0.10.0)",
org.eclipse.jgit.storage.pack;version="[0.9.0,0.10.0)",
org.eclipse.jgit.transport;version="[0.9.0,0.10.0)",
org.eclipse.jgit.treewalk;version="[0.9.0,0.10.0)",
org.eclipse.jgit.treewalk.filter;version="[0.9.0,0.10.0)",

+ 1
- 1
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java Ver arquivo

@@ -59,11 +59,11 @@ import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.ObjectWriter;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryTestCase;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.storage.pack.PackWriter;

public class ConcurrentRepackTest extends RepositoryTestCase {
public void setUp() throws Exception {

+ 1
- 1
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java Ver arquivo

@@ -60,12 +60,12 @@ import java.util.List;

import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
import org.eclipse.jgit.lib.TextProgressMonitor;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.storage.file.PackIndex.MutableEntry;
import org.eclipse.jgit.storage.pack.PackWriter;
import org.eclipse.jgit.transport.IndexPack;
import org.eclipse.jgit.util.JGitTestUtil;


+ 1
- 0
org.eclipse.jgit/META-INF/MANIFEST.MF Ver arquivo

@@ -20,6 +20,7 @@ Export-Package: org.eclipse.jgit;version="0.9.0",
org.eclipse.jgit.revwalk;version="0.9.0",
org.eclipse.jgit.revwalk.filter;version="0.9.0",
org.eclipse.jgit.storage.file;version="0.9.0",
org.eclipse.jgit.storage.pack;version="0.9.0",
org.eclipse.jgit.transport;version="0.9.0",
org.eclipse.jgit.treewalk;version="0.9.0",
org.eclipse.jgit.treewalk.filter;version="0.9.0",

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java Ver arquivo

@@ -43,7 +43,7 @@

package org.eclipse.jgit.errors;

import org.eclipse.jgit.lib.ObjectToPack;
import org.eclipse.jgit.storage.pack.ObjectToPack;

/** A previously selected representation is no longer available. */
public class StoredObjectRepresentationNotAvailableException extends Exception {

+ 1
- 0
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java Ver arquivo

@@ -46,6 +46,7 @@ package org.eclipse.jgit.lib;
import java.io.IOException;

import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.storage.pack.ObjectReuseAsIs;

/**
* Reads an {@link ObjectDatabase} for a single thread.

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/CachedObjectDirectory.java Ver arquivo

@@ -54,8 +54,8 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdSubclassMap;
import org.eclipse.jgit.lib.ObjectInserter;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.ObjectToPack;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.storage.pack.ObjectToPack;
import org.eclipse.jgit.storage.pack.PackWriter;

/**
* The cached instance of an {@link ObjectDirectory}.

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileObjectDatabase.java Ver arquivo

@@ -50,8 +50,8 @@ import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.ObjectDatabase;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.ObjectToPack;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.storage.pack.ObjectToPack;
import org.eclipse.jgit.storage.pack.PackWriter;

abstract class FileObjectDatabase extends ObjectDatabase {
@Override

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LocalObjectRepresentation.java Ver arquivo

@@ -46,7 +46,7 @@ package org.eclipse.jgit.storage.file;
import java.io.IOException;

import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.StoredObjectRepresentation;
import org.eclipse.jgit.storage.pack.StoredObjectRepresentation;

class LocalObjectRepresentation extends StoredObjectRepresentation {
static LocalObjectRepresentation newWhole(PackFile f, long p, long length) {

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LocalObjectToPack.java Ver arquivo

@@ -43,9 +43,9 @@

package org.eclipse.jgit.storage.file;

import org.eclipse.jgit.lib.ObjectToPack;
import org.eclipse.jgit.lib.StoredObjectRepresentation;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.storage.pack.ObjectToPack;
import org.eclipse.jgit.storage.pack.StoredObjectRepresentation;

/** {@link ObjectToPack} for {@link ObjectDirectory}. */
class LocalObjectToPack extends ObjectToPack {

+ 2
- 2
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java Ver arquivo

@@ -68,10 +68,10 @@ import org.eclipse.jgit.lib.ObjectDatabase;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectInserter;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.ObjectToPack;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.RepositoryCache;
import org.eclipse.jgit.lib.RepositoryCache.FileKey;
import org.eclipse.jgit.storage.pack.ObjectToPack;
import org.eclipse.jgit.storage.pack.PackWriter;
import org.eclipse.jgit.util.FS;

/**

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java Ver arquivo

@@ -67,11 +67,11 @@ import org.eclipse.jgit.errors.PackInvalidException;
import org.eclipse.jgit.errors.PackMismatchException;
import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.BinaryDelta;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectToPack;
import org.eclipse.jgit.lib.PackOutputStream;
import org.eclipse.jgit.storage.pack.BinaryDelta;
import org.eclipse.jgit.storage.pack.ObjectToPack;
import org.eclipse.jgit.storage.pack.PackOutputStream;
import org.eclipse.jgit.util.LongList;
import org.eclipse.jgit.util.NB;
import org.eclipse.jgit.util.RawParseUtils;

+ 4
- 4
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java Ver arquivo

@@ -55,11 +55,11 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.InflaterCache;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.ObjectReuseAsIs;
import org.eclipse.jgit.lib.ObjectToPack;
import org.eclipse.jgit.lib.PackOutputStream;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.storage.pack.ObjectReuseAsIs;
import org.eclipse.jgit.storage.pack.ObjectToPack;
import org.eclipse.jgit.storage.pack.PackOutputStream;
import org.eclipse.jgit.storage.pack.PackWriter;

/** Active handle to a ByteWindow. */
final class WindowCursor extends ObjectReader implements ObjectReuseAsIs {

org.eclipse.jgit/src/org/eclipse/jgit/lib/BinaryDelta.java → org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/BinaryDelta.java Ver arquivo

@@ -42,7 +42,7 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.eclipse.jgit.lib;
package org.eclipse.jgit.storage.pack;

import org.eclipse.jgit.JGitText;


org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReuseAsIs.java → org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectReuseAsIs.java Ver arquivo

@@ -41,12 +41,13 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.eclipse.jgit.lib;
package org.eclipse.jgit.storage.pack;

import java.io.IOException;

import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.revwalk.RevObject;

/**

org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectToPack.java → org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java Ver arquivo

@@ -42,8 +42,10 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.eclipse.jgit.lib;
package org.eclipse.jgit.storage.pack;

import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.transport.PackedObjectInfo;


org.eclipse.jgit/src/org/eclipse/jgit/lib/PackOutputStream.java → org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackOutputStream.java Ver arquivo

@@ -42,13 +42,14 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.eclipse.jgit.lib;
package org.eclipse.jgit.storage.pack;

import java.io.IOException;
import java.io.OutputStream;
import java.security.MessageDigest;
import java.util.zip.CRC32;

import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.util.NB;

/** Custom output stream to support {@link PackWriter}. */

org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java → org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java Ver arquivo

@@ -42,10 +42,10 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.eclipse.jgit.lib;
package org.eclipse.jgit.storage.pack;

import static org.eclipse.jgit.lib.StoredObjectRepresentation.PACK_DELTA;
import static org.eclipse.jgit.lib.StoredObjectRepresentation.PACK_WHOLE;
import static org.eclipse.jgit.storage.pack.StoredObjectRepresentation.PACK_DELTA;
import static org.eclipse.jgit.storage.pack.StoredObjectRepresentation.PACK_WHOLE;

import java.io.IOException;
import java.io.OutputStream;
@@ -62,6 +62,16 @@ import org.eclipse.jgit.errors.CorruptObjectException;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.CoreConfig;
import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdSubclassMap;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.ObjectWalk;
import org.eclipse.jgit.revwalk.RevFlag;
import org.eclipse.jgit.revwalk.RevObject;

org.eclipse.jgit/src/org/eclipse/jgit/lib/StoredObjectRepresentation.java → org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/StoredObjectRepresentation.java Ver arquivo

@@ -41,7 +41,9 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.eclipse.jgit.lib;
package org.eclipse.jgit.storage.pack;

import org.eclipse.jgit.lib.ObjectId;

/**
* An object representation {@link PackWriter} can consider for packing.

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java Ver arquivo

@@ -56,9 +56,9 @@ import org.eclipse.jgit.errors.NotSupportedException;
import org.eclipse.jgit.errors.PackProtocolException;
import org.eclipse.jgit.errors.TransportException;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.storage.pack.PackWriter;
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;

/**

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/transport/BundleWriter.java Ver arquivo

@@ -57,11 +57,11 @@ import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.storage.pack.PackWriter;

/**
* Creates a Git bundle file, for sneaker-net transport to another system.

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java Ver arquivo

@@ -65,7 +65,6 @@ import org.eclipse.jgit.JGitText;
import org.eclipse.jgit.errors.CorruptObjectException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.BinaryDelta;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.CoreConfig;
import org.eclipse.jgit.lib.InflaterCache;
@@ -80,6 +79,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.storage.file.PackIndexWriter;
import org.eclipse.jgit.storage.file.PackLock;
import org.eclipse.jgit.storage.pack.BinaryDelta;
import org.eclipse.jgit.util.NB;

/** Indexes Git pack files for local use. */

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java Ver arquivo

@@ -60,7 +60,6 @@ import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.PackProtocolException;
import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
@@ -70,6 +69,7 @@ import org.eclipse.jgit.revwalk.RevFlagSet;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevTag;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.storage.pack.PackWriter;
import org.eclipse.jgit.transport.BasePackFetchConnection.MultiAck;
import org.eclipse.jgit.transport.RefAdvertiser.PacketLineOutRefAdvertiser;
import org.eclipse.jgit.util.io.InterruptTimer;

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java Ver arquivo

@@ -61,12 +61,12 @@ import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdRef;
import org.eclipse.jgit.lib.PackWriter;
import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefWriter;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.Ref.Storage;
import org.eclipse.jgit.storage.pack.PackWriter;
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;

/**

Carregando…
Cancelar
Salvar