コード例 #1
0
 public void SetUp()
 {
     _processor = new ResponseProcessor();
      DirectoryInfo di = new DirectoryInfo(@"c:\_temp\cvs\abougie");
      _rootFolder = new Folder(di, "connection string", "/usr/local/cvsroot/sandbox", "abougie");
      _sub1 = new Folder("sub1", _rootFolder);
      _sub2 = new Folder("sub2", _sub1);
      _sub21 = new Folder("sub21", _sub2);
      _sub211 = new Folder("sub211", _sub21);
      _sub3 = new Folder("sub3", _sub2);
      _sub11 = new Folder("sub11", _sub1);
      _sub12 = new Folder("sub12", _sub11);
 }
コード例 #2
0
        /// <summary>
        /// Processes the responses of each request. When all the requests 
        /// needed to save a file have been retrieved from the CVS server,
        /// the file is saved and the information contained in the command
        /// is deleted for performance.
        /// </summary>
        /// <param name="request">The request.</param>
        protected internal override void AfterRequest(IRequest request)
        {
            if (request is ExportRequest)
             {
            IResponse response;
            IFileResponseGroup file = null;
            IList<IResponse> messages = null;
            bool gettingFile = false;
            ResponseProcessor processor = new ResponseProcessor();

            response = Connection.GetResponse();
            ProcessResponse(response);
            do
            {
               if (gettingFile)
               {
                  if (response is MTMessageResponse)
                     messages.Add(response);
                  if (response is UpdatedResponse)
                  {
                     messages = ResponseHelper.CollapseMessagesInResponses(messages);
                     file.MT = (IMessageResponse)messages[0];
                     file.FileResponse = (IFileResponse)response;

                     // process each file
                     Entry entry = processor.AddFile(CurrentFolder, file);
                     entry.Save(true);
                     Folder folder = entry.Parent;
                     if (SaveCVSFolder)
                     {
                        if (folder.Module != CurrentFolder.Module)
                           folder.SaveCVSFolder();
                     }

                     CurrentFolder = folder;
                     file = null;
                     RemoveProcessedResponses();
                     gettingFile = false; // all done getting file

                  }
               }
               else
               {
                  if (response is ModTimeResponse)
                  {
                     file = new FileResponseGroup();
                     messages = new List<IResponse>();
                     file.ModTime = (ModTimeResponse)response;
                     gettingFile = true;
                  }
               }

               response = Connection.GetResponse();
               ProcessResponse(response);
            }
            while (response != null);
             }
             else
             {
            base.AfterRequest(request);
             }
        }