Ich habe eine funktionierende Kopie eines Subversion-Repository, gibt es eine Möglichkeit, alle nicht versionierte oder ignorierte Dateien in dieser Arbeitskopie mit einem einzigen Befehl oder Werkzeug zu löschen? eine optimale Lösung benötigen, der Code nach allen unversionierte Ordnern und Dateien in beide Listenansicht sowie Strukturansicht löschen sollteWie kann ich alle unversionierten Dateien Ordner in Windows
ich verwendet habe
ProcessStartInfo psi = new ProcessStartInfo("svn.exe", "status --non-interactive");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.WorkingDirectory = directory;
using (Process process = Process.Start(psi))
{
string line = process.StandardOutput.ReadLine();
while (line != null)
{
if (line.Length > 7)
{
if (line[0] == '?')
{
string relativePath = line.Substring(8);
Console.WriteLine(relativePath);
string path = Path.Combine(directory, relativePath);
if (Directory.Exists(path))
{
DeleteDir(path);
}
else if (File.Exists(path))
{
FileInfo file = new FileInfo(path);
file.IsReadOnly = false;
File.Delete(path);
}
}
}
line = process.StandardOutput.ReadLine();
}
}
}
static void DeleteDir(string root)
{
DirectoryInfo di = new DirectoryInfo(root);
FileInfo[] fis = di.GetFiles();
foreach (FileInfo fi in fis)
{
fi.IsReadOnly = false;
File.Delete(fi.FullName);
}
foreach (DirectoryInfo dinfo in di.GetDirectories())
{
DeleteDir(dinfo.FullName);
}
if (di.GetDirectories().Length == 0) { Directory.Delete(di.FullName); return; }
}
http://stackoverflow.com/questions/7090507/executing-svn-cleanup-from-command-prompt – Vladmir