mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Fixed usvn in Win32 to delete even read-only .svn dirs when required
git-svn-id: svn://ultimatepp.org/upp/trunk@347 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
0c6e098d63
commit
01547d41e4
1 changed files with 28 additions and 1 deletions
|
|
@ -89,6 +89,33 @@ void SvnSync::SyncList()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
void sDeleteFolderDeep(const char *dir)
|
||||
{
|
||||
{
|
||||
FindFile ff(AppendFileName(dir, "*.*"));
|
||||
while(ff) {
|
||||
String name = ff.GetName();
|
||||
String p = AppendFileName(dir, name);
|
||||
if(ff.IsFile()) {
|
||||
SetFileAttributes(p, GetFileAttributes(p) & ~FILE_ATTRIBUTE_READONLY);
|
||||
FileDelete(p);
|
||||
}
|
||||
else
|
||||
if(ff.IsFolder())
|
||||
sDeleteFolderDeep(p);
|
||||
ff.Next();
|
||||
}
|
||||
}
|
||||
DirectoryDelete(dir);
|
||||
}
|
||||
#else
|
||||
void sDeleteFolderDeep(const char *path)
|
||||
{
|
||||
DeleteFolderDeep(path);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SvnDel(const char *path)
|
||||
{
|
||||
FindFile ff(AppendFileName(path, "*.*"));
|
||||
|
|
@ -96,7 +123,7 @@ void SvnDel(const char *path)
|
|||
if(ff.IsFolder()) {
|
||||
String dir = AppendFileName(path, ff.GetName());
|
||||
if(ff.GetName() == ".svn")
|
||||
DeleteFolderDeep(dir);
|
||||
sDeleteFolderDeep(dir);
|
||||
else
|
||||
SvnDel(dir);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue