Fixed bug in page renaming process (revisions were not renamed).

This commit is contained in:
Dario Solera 2009-10-13 09:03:02 +00:00
parent bdd2b06411
commit d45f07f892
2 changed files with 7 additions and 5 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.0.349")] [assembly: AssemblyVersion("3.0.0.350")]
[assembly: AssemblyFileVersion("3.0.0.349")] [assembly: AssemblyFileVersion("3.0.0.350")]

View file

@ -1690,6 +1690,7 @@ namespace ScrewTurn.Wiki {
UnindexMessageTree(local, msg); UnindexMessageTree(local, msg);
} }
string oldFullName = local.FullName;
local.FullName = NameTools.GetFullName(NameTools.GetNamespace(local.FullName), newName); local.FullName = NameTools.GetFullName(NameTools.GetNamespace(local.FullName), newName);
string newFile = GetNamespacePartialPathForPageContent(NameTools.GetNamespace(local.FullName)) + newName + string newFile = GetNamespacePartialPathForPageContent(NameTools.GetNamespace(local.FullName)) + newName +
@ -1714,12 +1715,13 @@ namespace ScrewTurn.Wiki {
File.Move(oldDraftFullPath, newDraftFullPath); File.Move(oldDraftFullPath, newDraftFullPath);
} }
// Rename all backups, store new page list on disk
// and rebind new page with old categories
RenameBackups(new LocalPageInfo(oldFullName, this, local.CreationDateTime, oldLocalName), newName);
// Set new filename (local references an element in the pgs array) // Set new filename (local references an element in the pgs array)
local.File = newFile; local.File = newFile;
// Rename all backups, store new page list on disk
// and rebind new page with old categories
RenameBackups(page, newName);
DumpPages(pgs); DumpPages(pgs);
// Clear internal cache // Clear internal cache
categoriesCache = null; categoriesCache = null;