From 3079375f888693796d87e6028bacba9a7107e9c1 Mon Sep 17 00:00:00 2001 From: "Joel W. Reed" Date: Mon, 16 Jul 2007 12:51:15 -0400 Subject: [PATCH] tf delete should actually delete the folder --- ChangeLog | 1 + .../Microsoft.TeamFoundation.VersionControl.Client/GetOperation.cs | 2 +- class/Microsoft.TeamFoundation.VersionControl.Client/Workspace.cs | 7 ++++++- tools/tf/GetCommand.cs | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d81ed8..0207766 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ will work # BUGFIX: uninstall man page and pkg-config file too # BUGFIX: fix /format:detailed output for added files in history cmd + # BUGFIX: tf delete should actually delete the folder 2007-06-18 Joel Reed diff --git a/class/Microsoft.TeamFoundation.VersionControl.Client/GetOperation.cs b/class/Microsoft.TeamFoundation.VersionControl.Client/GetOperation.cs index 5e1c3ef..a4eaa65 100644 --- a/class/Microsoft.TeamFoundation.VersionControl.Client/GetOperation.cs +++ b/class/Microsoft.TeamFoundation.VersionControl.Client/GetOperation.cs @@ -86,7 +86,7 @@ namespace Microsoft.TeamFoundation.VersionControl.Client get { return artifactUri; } } - private ItemType itemType = ItemType.File; + private ItemType itemType = ItemType.Folder; private int itemId = 0; private int did = 0; diff --git a/class/Microsoft.TeamFoundation.VersionControl.Client/Workspace.cs b/class/Microsoft.TeamFoundation.VersionControl.Client/Workspace.cs index 788868e..8c29fe7 100644 --- a/class/Microsoft.TeamFoundation.VersionControl.Client/Workspace.cs +++ b/class/Microsoft.TeamFoundation.VersionControl.Client/Workspace.cs @@ -379,8 +379,13 @@ namespace Microsoft.TeamFoundation.VersionControl.Client { File.SetAttributes(operation.SourceLocalItem, FileAttributes.Normal); File.Delete(operation.SourceLocalItem); - updates.QueueUpdate(operation.ItemId, null, operation.VersionServer); } + else + { + Directory.Delete(operation.SourceLocalItem); + } + + updates.QueueUpdate(operation.ItemId, null, operation.VersionServer); } updates.Flush(); diff --git a/tools/tf/GetCommand.cs b/tools/tf/GetCommand.cs index 8c7b01d..c2e8525 100644 --- a/tools/tf/GetCommand.cs +++ b/tools/tf/GetCommand.cs @@ -63,7 +63,6 @@ class GetCommand : Command public void MyGettingEventHandler(Object sender, GettingEventArgs e) { - if (e.ItemType == ItemType.Folder) return; if (e.DeletionId != 0) { Console.WriteLine("deleting " + e.SourceLocalItem); @@ -77,6 +76,7 @@ class GetCommand : Command else Console.WriteLine("updating " + e.TargetLocalItem); + if (e.ItemType == ItemType.Folder) return; setPermissions.Add(e.TargetLocalItem); } -- 2.11.4.GIT