You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Justin Erenkrantz <je...@apache.org> on 2002/06/02 17:10:55 UTC

Removing non-committed files?

% svn add my-file
<this is okay>
% svn rm my-file

svn_error: #21114 : <Attempting restricted operation for modified resource>
  Use --force to override this restriction

svn_error: #21114 : <Attempting restricted operation for modified resource>
  'my-file' has local modifications

I don't know if this has been discussed before, but it'd be awful
nice if the entry is newly added that I can remove it without adding
--force.

A quick glance shows that the entry in the .entries file has
schedule="add" as a property.  My SVN karma probably isn't high enough
for me to do this on my own.  So, consider this a feature enhancement
request.  =)  -- justin

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

Re: Removing non-committed files?

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Sun, Jun 02, 2002 at 10:10:55AM -0700, Justin Erenkrantz wrote:
> % svn add my-file
> <this is okay>
> % svn rm my-file
> 
> svn_error: #21114 : <Attempting restricted operation for modified resource>
>   Use --force to override this restriction
> 
> svn_error: #21114 : <Attempting restricted operation for modified resource>
>   'my-file' has local modifications
> 
> I don't know if this has been discussed before, but it'd be awful
> nice if the entry is newly added that I can remove it without adding
> --force.
> 
> A quick glance shows that the entry in the .entries file has
> schedule="add" as a property.  My SVN karma probably isn't high enough
> for me to do this on my own.  So, consider this a feature enhancement
> request.  =)  -- justin
> 
The "correct" way to do this is to svn revert my-file.  This will undo the
schedule for addition.  I beleive the issue has come up before and people
decided that they prefered the idea of just using svn revert.
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Removing non-committed files?

Posted by Justin Erenkrantz <je...@apache.org>.
On Mon, Jun 03, 2002 at 02:09:16PM -0500, Karl Fogel wrote:
> But when removing an added file, you'd get a different error
> 
>    % svn rm my-file
>    svn_error: #21XXX : <blah blah blah>
>      `my-file' is scheduled for addition; to remove it, use
>      `svn revert' to unschedule 
> 
>    svn_error: #21XXX : <blah blah blah>
>      'my-file' is scheduled for addition
> 
> That way Subversion say what it really means.
> 
> Thoughts?

++1.  -- justin

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

Re: Removing non-committed files?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> It's not clear that that 'svn revert' is the "correct" thing to
> suggest.  Running 'svn revert' will cancel the scheduling for addition
> but will not remove the unversioned item.  As far as I can see
> deleting the item by using '--force' is just as likely to be what the
> user wanted.

Ah, good point.  Then it should recommend that, but still give a more
accurate *reason* for why the --force is necessary (that is, the
message still needs to change, just not exactly in the way I hastily
suggested).


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

Re: Removing non-committed files?

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

> But when removing an added file, you'd get a different error
> 
>    % svn rm my-file
>    svn_error: #21XXX : <blah blah blah>
>      `my-file' is scheduled for addition; to remove it, use
>      `svn revert' to unschedule 
> 
>    svn_error: #21XXX : <blah blah blah>
>      'my-file' is scheduled for addition
> 
> That way Subversion say what it really means.
> 
> Thoughts?

It's not clear that that 'svn revert' is the "correct" thing to
suggest.  Running 'svn revert' will cancel the scheduling for addition
but will not remove the unversioned item.  As far as I can see
deleting the item by using '--force' is just as likely to be what the
user wanted.

-- 
Philip

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

Re: Removing non-committed files?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> I can tell you why it works the way it does.  At the moment any change
> you make with 'svn rm' can be undone with 'svn revert'.  Changes that
> cannot be reverted require 'svn rm --force'.  Thus requiring --force
> in the situation above is intentional.
> 
> I guess there is an argument for different behaviour, but I like the
> current behaviour.

However, if the error message were at least more specific to this
situation, that would be helpful.  For example, when rm'ing a normal
versioned file with local mods, you would get the error Justin got:

   % svn rm my-file
   svn_error: #21114 : <Attempting restricted operation for modified resource>
     Use --force to override this restriction
   
   svn_error: #21114 : <Attempting restricted operation for modified resource>
     'my-file' has local modifications

But when removing an added file, you'd get a different error

   % svn rm my-file
   svn_error: #21XXX : <blah blah blah>
     `my-file' is scheduled for addition; to remove it, use
     `svn revert' to unschedule 

   svn_error: #21XXX : <blah blah blah>
     'my-file' is scheduled for addition

That way Subversion say what it really means.

Thoughts?

-Karl

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

Re: Removing non-committed files?

Posted by Philip Martin <ph...@codematters.co.uk>.
Justin Erenkrantz <je...@apache.org> writes:

> % svn add my-file
> <this is okay>
> % svn rm my-file
> 
> svn_error: #21114 : <Attempting restricted operation for modified resource>
>   Use --force to override this restriction
> 
> svn_error: #21114 : <Attempting restricted operation for modified resource>
>   'my-file' has local modifications
> 
> I don't know if this has been discussed before, but it'd be awful
> nice if the entry is newly added that I can remove it without adding
> --force.

I can tell you why it works the way it does.  At the moment any change
you make with 'svn rm' can be undone with 'svn revert'.  Changes that
cannot be reverted require 'svn rm --force'.  Thus requiring --force
in the situation above is intentional.

I guess there is an argument for different behaviour, but I like the
current behaviour.

-- 
Philip

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