You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Arild Fines <ar...@broadpark.no> on 2006/11/04 19:08:26 UTC

Changed behavior in 1.4 with regards to deleting non-existent files

SVN 1.4:
PS D:\halftemp\wc\Test\WindowsApplication> touch bleh.cs
PS D:\halftemp\wc\Test\WindowsApplication> svn add bleh.cs
A         bleh.cs
PS D:\halftemp\wc\Test\WindowsApplication> del bleh.cs
PS D:\halftemp\wc\Test\WindowsApplication> svn del bleh.cs
D         bleh.cs
svn: 'bleh.cs' does not exist


SVN 1.3:
PS D:\halftemp\wc\ConsoleApplication4> touch bleh.cs
PS D:\halftemp\wc\ConsoleApplication4> svn add bleh.cs
A         bleh.cs
PS D:\halftemp\wc\ConsoleApplication4> del bleh.cs
PS D:\halftemp\wc\ConsoleApplication4> svn del bleh.cs
D         bleh.cs
PS D:\halftemp\wc\ConsoleApplication4>

Is there a good reason why this change was made? The error in 1.4 seems
unnecessary, since SVN actually does remove the file entry from the working
copy. It's also not consistent with the fact that you don't get an error if
the file's status was unmodified:

PS D:\halftemp\wc\Test\WindowsApplication> svn st Blah.cs
PS D:\halftemp\wc\Test\WindowsApplication> del Blah.cs
PS D:\halftemp\wc\Test\WindowsApplication> svn del Blah.cs
D         Blah.cs
PS D:\halftemp\wc\Test\WindowsApplication>

--
Arild

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: Changed behavior in 1.4 with regards to deleting non-existent files

Posted by Arild Fines <ar...@broadpark.no>.

> -----Original Message-----
> From: Arild Fines [mailto:arild.fines@broadpark.no]
> Sent: Saturday, November 04, 2006 8:08 PM
> To: users@subversion.tigris.org
> Subject: Changed behavior in 1.4 with regards to deleting non-existent
> files
> 
> SVN 1.4:
> PS D:\halftemp\wc\Test\WindowsApplication> touch bleh.cs PS
> D:\halftemp\wc\Test\WindowsApplication> svn add bleh.cs
> A         bleh.cs
> PS D:\halftemp\wc\Test\WindowsApplication> del bleh.cs PS
> D:\halftemp\wc\Test\WindowsApplication> svn del bleh.cs
> D         bleh.cs
> svn: 'bleh.cs' does not exist
> 
> 
> SVN 1.3:
> PS D:\halftemp\wc\ConsoleApplication4> touch bleh.cs PS
> D:\halftemp\wc\ConsoleApplication4> svn add bleh.cs
> A         bleh.cs
> PS D:\halftemp\wc\ConsoleApplication4> del bleh.cs PS
> D:\halftemp\wc\ConsoleApplication4> svn del bleh.cs
> D         bleh.cs
> PS D:\halftemp\wc\ConsoleApplication4>
> 
> Is there a good reason why this change was made? The error in 1.4 seems
> unnecessary, since SVN actually does remove the file entry from the
> working copy. It's also not consistent with the fact that you don't get
> an error if the file's status was unmodified:
> 
> PS D:\halftemp\wc\Test\WindowsApplication> svn st Blah.cs PS
> D:\halftemp\wc\Test\WindowsApplication> del Blah.cs PS
> D:\halftemp\wc\Test\WindowsApplication> svn del Blah.cs
> D         Blah.cs
> PS D:\halftemp\wc\Test\WindowsApplication>

I blame you all! :-P

@@ -386,6 +386,7 @@
                     // VC++ projects don't delete the files until *after*
OnAfterRemoveFiles has fired
                     bool wasUnmodified = item.Status.TextStatus ==
StatusKind.Normal &&
                         ( item.Status.PropertyStatus == StatusKind.None ||
item.Status.PropertyStatus == StatusKind.Normal );
+                    bool wasAddedOrMissing = item.Status.TextStatus ==
StatusKind.Added || item.Status.TextStatus == StatusKind.Missing;
 
                     if ( (item.Status.TextStatus == StatusKind.Missing ||
item.IsDeleted ||
                         item.Status.TextStatus == StatusKind.Normal) && 
@@ -395,8 +396,19 @@
                         {
                             this.RestoreBackupDirectory( item.Path );
                         }
-                        context.Client.Delete( new string[] { item.Path },
true );
 
+                        try
+                        {
+                            context.Client.Delete( new string[] { item.Path
}, true );
+                        }
+                        catch ( BadPathException )
+                        {
+                            if ( !wasAddedOrMissing )
+                            {
+                                throw;
+                            }
+                        }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org