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

Feature request (3) -- Partial or separated revert operations.

From: Rob Hubbard <rob.hubbard_at_softel.co.uk>
Date: Fri, 13 Feb 2009 10:35:03 -0000

Hello,
 
Suppose that you have modified and renamed a file:
 
    $ svn mv old_filename new_filename
    $ ### (edit contents of new_filename)
 
(You might now also set or changed a load of properties on that file.)
 
    $ svn st
    A + new_filename
    D old_filename
 
There are now at least two respects in which the file has changed:
 
    * its name
    * its contents
    * (possibly, its properties)
 
It is possible to revert these aspects separately?
(As of SVN 1.5, I suppose the rename is somewhat revertible by renaming
back.)
 
If not, I'd like to suggest extensions to SVN along the following lines:
 
To revert the contents only:
    $ svn revert new_filename --only-contents ### (new option)
 
To revert only the properties:
    $ svn revert new_filename --only-props
 
To revert a particular property:
    $ svn proprevert prop_name new_filename
 
[I admit properties are a problem in terms of what is the BASE for the
properties? Is it the values at the point that they were copied?
Probably they should just be the BASE of the file that the new_filename
is a copy of, i.e. the BASE of old_filename_at_rev]
 
Finally, to revert only the rename:
    $ svn revert new_filename --only-filename
This operation should be equivalent to
    $ svn mv new_filename old_filename
and that should deal with copying the properties too.
 
To succeed, that requires that no replacement old_filename exists.
 
[Ignoring properties, it is roughly equivalent to:
    $ svn revert old_filename ### undo the delete aspect of the rename
    $ rm old_filename
    $ mv new_filename old_filename
    $ svn revert new_filename ### undo the add aspect of the rename
]
 

Another, closely related situation occurs when the contents and
properties
 
    $ svn st
    MM my_file
 
Again, it would be useful to be able to revert just the contents or just
the properties. Can this already be done?
 
If not, I'd like to suggest further extensions to SVN along the
following lines:
 
To revert the contents only (same as before):
    $ svn revert my_file --only-contents ### (new option)
 
To revert all the properties but nothing else:
    $ svn revert my_file --only-props
 
To revert only a particular property:
    $ svn proprevert prop_name my_file ### (new subcommand)
 

This would also be useful for reverting properties "globally":
 
To revert all instances of all properties:
    $ svn revert . --recursive --only-props
 
To revert all instances of a particular property:
    $ svn proprevert prop_name . --recursive
 
Thanks,
Rob.
 

Rob Hubbard.

________________________________________________________________
This message has been independently scanned for the Softel Group and cleared of containing viruses and other malicious data.

Powering Television Beyond the Video (TM)

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1150145

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-02-13 11:35:58 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.