> -----Original Message----- > From: Markus Schaber [mailto:m.scha...@codesys.com] > Sent: 21 July 2015 14:01 > To: Grierson, David; d...@subversion.apache.org > Cc: 牛暁冬; users@subversion.apache.org > Subject: AW: Feature request: Save the old file when svn revert > ... > I'm not really sure what to think about this one... > > In the end, the whole purpose of "svn revert" is to drop the local > changes and *revert* everything back to the state the repository has. > > All other commands need a --force or other explicit user decision to > override user changed data, but the whole purpose of the "svn revert" > command is to undo local changes - putting a --force option or > something similar seems like a bit of contradiction. > > On the other hand, I'm not an SVN core developer, so it's just my > personal opinion. > > How do the other RCSes handle this situation? Maybe we can learn > some ideas for a nice(r) UI there...
Good question ... The equivalent in ClearCase was a "cleartool uncheckout": http://www-01.ibm.com/support/knowledgecenter/SSSH27_7.1.1/com.ibm.rational.clearcase.cc_ref.doc/topics/ct_uncheckout.htm?cp=SSSH27_7.1.1%2F9-0-0-1-69 This has the -kee/p and -rm options on the command: > –kee/p > Preserves the contents of the checked-out version under a file-name of the > form element-name.keep > (or, to prevent name collisions, element-name.keep.1, element-name.keep.2, > and so on). > > –rm > Does not preserve the contents of the checked-out version. Thus, any edits > that had been made to > the checked-out version are lost. The default action is to prompt the user for what to do with the lost changes: > Cancel the checkout of file element util.c. $ cleartool uncheckout util.c Save private copy of "util.c"? [yes] no Checkout cancelled for "util.c". I guess the equivalent in git is the reset command: http://git-scm.com/docs/git-reset This seems to have three key options: > --hard > Resets the index and working tree. Any changes to tracked files in the > working tree since <commit> > are discarded. > > -merge > Resets the index and updates the files in the working tree that are different > between <commit> and > HEAD, but keeps those which are different between the index and working tree > (i.e. which have changes > which have not been added). If a file that is different between <commit> and > the index has unstaged > changes, reset is aborted. > > --keep > Resets index entries and updates files in the working tree that are different > between <commit> and > HEAD. If a file that is different between <commit> and HEAD has local > changes, reset is aborted. So _similar_ (but more quirky IMHO) operation to ClearCase. Dg. Information in this email including any attachments may be privileged, confidential and is intended exclusively for the addressee. The views expressed may not be official policy, but the personal views of the originator. If you have received it in error, please notify the sender by return e-mail and delete it from your system. You should not reproduce, distribute, store, retransmit, use or disclose its contents to anyone. Please note we reserve the right to monitor all e-mail communication through our internal and external networks. SKY and the SKY marks are trademarks of Sky plc and Sky International AG and are used under licence. Sky UK Limited (Registration No. 2906991), Sky-In-Home Service Limited (Registration No. 2067075) and Sky Subscribers Services Limited (Registration No. 2340150) are direct or indirect subsidiaries of Sky plc (Registration No. 2247735). All of the companies mentioned in this paragraph are incorporated in England and Wales and share the same registered office at Grant Way, Isleworth, Middlesex TW7 5QD.