diff options
author | André Dietisheim | 2013-02-01 14:58:44 +0000 |
---|---|---|
committer | Matthias Sohn | 2013-03-20 23:30:30 +0000 |
commit | a31920555f075c028f087b2e174293e1f11d714d (patch) | |
tree | 6a62dbfe6c53d172e2ffda2196cc0f901e17f5a1 /org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java | |
parent | 8fcde4b31b36205ea6ef673808489943e4aca3ef (diff) | |
download | jgit-a31920555f075c028f087b2e174293e1f11d714d.tar.gz jgit-a31920555f075c028f087b2e174293e1f11d714d.tar.xz jgit-a31920555f075c028f087b2e174293e1f11d714d.zip |
Allow users to show server messages while pushing
Allow users to provide their OutputStream (via Transport#
push(monitor, refUpdates, out)) so that server messages can be written
to it (in SideBandInputStream) while they're coming in.
CQ: 7065
Bug: 398404
Change-Id: I670782784b38702d52bca98203909aca0496d1c0
Signed-off-by: Andre Dietisheim <andre.dietisheim@gmail.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java index ef8e7d74d5..2d042400f6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java @@ -46,6 +46,7 @@ package org.eclipse.jgit.transport; +import java.io.OutputStream; import java.util.Collection; import java.util.Set; @@ -112,6 +113,47 @@ public interface FetchConnection extends Connection { throws TransportException; /** + * Fetch objects we don't have but that are reachable from advertised refs. + * <p> + * Only one call per connection is allowed. Subsequent calls will result in + * {@link TransportException}. + * </p> + * <p> + * Implementations are free to use network connections as necessary to + * efficiently (for both client and server) transfer objects from the remote + * repository into this repository. When possible implementations should + * avoid replacing/overwriting/duplicating an object already available in + * the local destination repository. Locally available objects and packs + * should always be preferred over remotely available objects and packs. + * {@link Transport#isFetchThin()} should be honored if applicable. + * </p> + * + * @param monitor + * progress monitor to inform the end-user about the amount of + * work completed, or to indicate cancellation. Implementations + * should poll the monitor at regular intervals to look for + * cancellation requests from the user. + * @param want + * one or more refs advertised by this connection that the caller + * wants to store locally. + * @param have + * additional objects known to exist in the destination + * repository, especially if they aren't yet reachable by the ref + * database. Connections should take this set as an addition to + * what is reachable through all Refs, not in replace of it. + * @param out + * OutputStream to write sideband messages to + * @throws TransportException + * objects could not be copied due to a network failure, + * protocol error, or error on remote side, or connection was + * already used for fetch. + * @since 3.0 + */ + public void fetch(final ProgressMonitor monitor, + final Collection<Ref> want, final Set<ObjectId> have, + OutputStream out) throws TransportException; + + /** * Did the last {@link #fetch(ProgressMonitor, Collection, Set)} get tags? * <p> * Some Git aware transports are able to implicitly grab an annotated tag if |