public BundleFetchConnection(Transport transportBundle, Stream src)
 {
     transport = transportBundle;
     bin = new BufferedStream(src, IndexPack.BUFFER_SIZE);
     try
     {
         switch (readSignature())
         {
             case 2:
                 readBundleV2();
                 break;
             default:
                 throw new TransportException(transport.URI, "not a bundle");
         }
     }
     catch (TransportException err)
     {
         Close();
         throw err;
     }
     catch (IOException err)
     {
         Close();
         throw new TransportException(transport.URI, err.Message, err);
     }
 }
Beispiel #2
0
        ///	 <summary> * Create process for specified transport and refs updates specification.
        ///	 * </summary>
        ///	 * <param name="transport">
        ///	 *            transport between remote and local repository, used to Create
        ///	 *            connection. </param>
        ///	 * <param name="toPush">
        ///	 *            specification of refs updates (and local tracking branches). </param>
        ///	 * <exception cref="TransportException"> </exception>
        public PushProcess(Transport transport, IEnumerable<RemoteRefUpdate> toPush)
        {
            _walker = new RevWalk.RevWalk(transport.Local);
            _transport = transport;
            _toPush = new Dictionary<string, RemoteRefUpdate>();
            foreach (RemoteRefUpdate rru in toPush)
            {
                if (_toPush.ContainsKey(rru.RemoteName))
                {
                    throw new TransportException("Duplicate remote ref update is illegal. Affected remote name: " + rru.RemoteName);
                }

                _toPush.Add(rru.RemoteName, rru);
            }
        }
Beispiel #3
0
 public PushProcess(Transport transport, List<RemoteRefUpdate> toPush)
 {
     walker = new RevWalk.RevWalk(transport.Local);
     this.transport = transport;
     foreach (RemoteRefUpdate rru in toPush)
     {
         if (this.toPush.ContainsKey(rru.RemoteName))
         {
             throw new TransportException("Duplicate remote ref update is illegal. Affected remote name: " + rru.RemoteName);
         }
         else
         {
             this.toPush.Add(rru.RemoteName, rru);
         }
     }
 }
        protected void showFetchResult(Transport.Transport tn, FetchResult r)
        {
            bool shownURI = false;
            foreach (TrackingRefUpdate u in r.TrackingRefUpdates)
            {
                if (!verbose && u.Result == RefUpdate.RefUpdateResult.NoChange)
                    continue;

                char type = shortTypeOf(u.Result);
                string longType = longTypeOf(u);
                string src = AbbreviateRef(u.RemoteName, false);
                string dst = AbbreviateRef(u.LocalName, true);

                if (!shownURI)
                {
                    streamOut.Write("From ");
                    streamOut.WriteLine(tn.Uri);
                    shownURI = true;
                }

                streamOut.WriteLine(" " + type + " " + longType + " " + src + " -> " + dst);
            }
        }
Beispiel #5
0
 internal FetchProcess(Transport t, ICollection<RefSpec> f)
 {
     _transport = t;
     _toFetch = f;
 }
 protected BasePackConnection(IPackTransport packTransport)
 {
     transport = (Transport) packTransport;
     local = transport.Local;
     uri = transport.Uri;
 }