/// <summary> /// Process a clear static directory response. /// </summary> public override void Process() { string localPath = this.ReadLine(); string reposPath = this.ReadLine(); Manager manager = new Manager (Services.Repository.WorkingPath); manager.AddRepository (Services.Repository, localPath, reposPath); manager.AddRoot (Services.Repository, localPath, reposPath); PathTranslator pathTranslator = new PathTranslator (Services.Repository, reposPath); Factory factory = new Factory(); Entry entry = (Entry)factory.CreateCvsObject(pathTranslator.CurrentDir, Entry.FILE_NAME, Entry.CreateEntry(pathTranslator.CurrentDir).FileContents); // the root module directory does not get a cvs Entries line. // TODO: There has to be a cleaner way to do this... if (Services.Repository.WorkingPath.Length <= entry.Path.Length) { manager.AddEntry(entry); } Services.ResponseMessageEvents.SendResponseMessage( String.Format("Updating {0}", RemoveTrailingSlash(localPath)), this.GetType()); }
/// <summary> /// Process the response from the cvs server. /// </summary> public override void Process() { Manager manager = new Manager (Services.Repository.WorkingPath); string localPath = this.ReadLine(); string reposPath = this.ReadLine(); string entry = this.ReadLine(); string flags = this.ReadLine(); string sizeStr = this.ReadLine(); PathTranslator orgPath = new PathTranslator (Services.Repository, reposPath); string localPathAndFilename = orgPath.LocalPathAndFilename; string directory = orgPath.LocalPath; bool compress = sizeStr[0] == 'z'; if (compress) { sizeStr = sizeStr.Substring(1); } int size = Int32.Parse(sizeStr); if (!Directory.Exists(orgPath.LocalPath)) { Directory.CreateDirectory(orgPath.LocalPath); } if (Services.NextFile != null && Services.NextFile.Length > 0) { localPathAndFilename = Services.NextFile; Services.NextFile = null; } Factory factory = new Factory(); Entry e = (Entry) factory.CreateCvsObject(new DirectoryInfo(Path.GetDirectoryName(orgPath.CurrentDir.FullName)), Entry.FILE_NAME, entry); if (e.IsBinaryFile) { Services.UncompressedFileHandler.ReceiveBinaryFile(Stream, localPathAndFilename, size); } else { Services.UncompressedFileHandler.ReceiveTextFile(Stream, localPathAndFilename, size); } e.Date = Services.NextFileDate; Services.NextFileDate = null; manager.AddEntry(e); manager.SetFileTimeStamp (e.FullPath, e.TimeStamp, e.IsUtcTimeStamp); UpdateMessage message = new UpdateMessage (); message.Module = Services.Repository.WorkingDirectoryName; message.Repository = orgPath.RelativePath; message.Filename = e.Name; Services.SendMessage (message.Message); Services.ResponseMessageEvents.SendResponseMessage(message.Message, this.GetType()); }