From: Clayton H. <dr...@us...> - 2005-02-07 15:05:46
|
Update of /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/FileSystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3225/src/ICSharpCode/SharpCvsLib/FileSystem Modified Files: Entries.cs Manager.cs Log Message: Implemented file lists on the AddCommandParser and fixed some bugs with the add/ commit commands. Still having an issue with the commit response that I have no tracked down, it is creating a directory with the same name as the file being checked in. I will try to track this down tonight. Index: Entries.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/FileSystem/Entries.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Entries.cs 14 Jan 2005 09:09:40 -0000 1.8 --- Entries.cs 7 Feb 2005 15:05:36 -0000 1.9 *************** *** 133,136 **** --- 133,148 ---- } + public void Save() { + DirectoryInfo dir = null; + foreach (Entry entry in this.Dictionary.Values) { + dir = entry.CvsFile.Directory; + break; + } + if (null != dir) { + Manager manager = new Manager(dir); + manager.SaveEntries(this); + } + } + /// <summary> /// Render the entries collection as a human readable string. Index: Manager.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/FileSystem/Manager.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Manager.cs 30 Jan 2005 19:26:18 -0000 1.38 --- Manager.cs 7 Feb 2005 15:05:36 -0000 1.39 *************** *** 1010,1030 **** /// <returns>The Entry file that has been added.</returns> public Entry AddEntry (Entry entry) { ! if (entry.CvsFile.Exists) { ! Entries entries = this.FetchEntries(entry.CvsFile.FullName); ! if (entries.Contains(entry.Key)) { ! // update entry ! entries[entry.Key] = entry; ! } else { ! // add new entry ! entries.Add(entry.Key, entry); ! } ! this.WriteToFile(entries); ! } else { ! this.WriteToFile(entry); } return entry; } /// <summary> /// Create a <code>CVS\Entries</code> management file with the given /// entry line, or if the file exists then add the line to the --- 1010,1031 ---- /// <returns>The Entry file that has been added.</returns> public Entry AddEntry (Entry entry) { ! Entries entries = Entries.Load(entry.CvsFile.Directory); ! if (!entries.Contains(entry.FullPath)) { ! entries.Add(entry); } + this.SaveEntries(entries); + this.WriteToFile(entries); return entry; } /// <summary> + /// Save the <see cref="Entries"/> in the CVS\Entries file. + /// </summary> + /// <param name="entries">Entries to save.</param> + public void SaveEntries(Entries entries) { + this.WriteToFile(entries); + } + + /// <summary> /// Create a <code>CVS\Entries</code> management file with the given /// entry line, or if the file exists then add the line to the |