[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

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

From: Arild Fines <arild.fines_at_broadpark.no>
Date: 2006-11-15 20:51:45 CET

> -----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
Received on Wed Nov 15 20:55:33 2006

This is an archived mail posted to the Subversion Dev mailing list.