Author Topic: ProjectFile::Rename behaviour  (Read 4263 times)

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
ProjectFile::Rename behaviour
« on: March 11, 2011, 11:24:50 am »
Hi I've got a question about how ProjectFile::Rename behaves.

Code: [Select]
/*virtual*/ void VcsFileItem::Rename(const wxString& newName)
{
    cbProject* prj = m_PrjFile->GetParentProject();
    wxString topLevel = prj->GetCommonTopLevelPath();

    Manager::Get()->GetLogManager()->Log( m_PrjFile->file.GetFullPath() );
    Manager::Get()->GetLogManager()->Log( newName );
    Manager::Get()->GetLogManager()->Log( topLevel );

    wxString newRelativeName = StripRootPath(topLevel, newName).AfterFirst('/');
    m_PrjFile->Rename(newRelativeName);
    Manager::Get()->GetLogManager()->Log( newRelativeName );
}

The log output:

Code: [Select]
/home/dushara/src/vcs-test/renamad
/home/dushara/src/vcs-test/renamed
/home/dushara/src/
renamed
/home/dushara/src/vcs-test/renamedsd/renamad
/home/dushara/src/vcs-test/renamed-sd/renamed
/home/dushara/src/
renamed-sd/renamed

The problem is, it appears in the project hierarchy as:
.../vcs-test/renamed
.../vcs-test/renamedsd/renamed-sd/renamed

As you can see the result of a file rename Vs directory + file rename are different.

How should directory renames be handled?

I'm using the svn build rev 7015 for Linux.

D