0

Is it possible to block or deny "Revert" command in Subversion? Or something similar to this via command line or settings?

Shawn
  • 3,583
  • 8
  • 46
  • 63
  • 3
    Why would you want to do this? One of the greatest benefits of using a VCS like SVN is the ability to make changes and then later revert them if something doesn't work or goes wrong; why would you want to remove that benefit? – Ken White Sep 17 '14 at 19:16
  • There is no way to do this that I know of. As @KenWhite said, it would defeat a core function of SVN - editing your local sandbox and being able to undo those changes. – AlG Sep 17 '14 at 19:22

2 Answers2

1

You can not block the command, but you can remove the explorer context menu for it. Have a look at the docs.

Stefan
  • 43,293
  • 10
  • 75
  • 117
  • Removing it from the client will just have people determined to revert looking for non-crippled clients (if they are smart). Any long term solution will require a server-side fix, so the users cannot work around (from their point of view) the "problem". – Edwin Buck Sep 18 '14 at 14:50
  • You can not block a revert server-side, because 'revert' is a client-side operation only. – Stefan Sep 19 '14 at 12:06
0

In theory you might be able to do so, but remember that subversion (as last I checked) really doesn't have a revert command. It's a compound command comprised of committing an old revision as your current working copy.

So, you would have to approach it at the server, with a pre-commit hook that would inspect the details of the commit to determine if the commit seemed to be a resubmission of the previous revision.

Sounds like a lot of work to me, but if the justification is high enough, it might be worthwhile. The primary issues include whether it is ever valid to go back to a previous version (if not, you need to do the comparison to all previous revisions), and how many ways you define "previous version". For explanation of the latter issue, if I delete a file and then two months later move (rename) a file to the previously deleted file's name and location, should it be compared with the file's lineage or the previous versions at the file's location?

Such questions don't have perfect answers, but they only need one answer, the answer that matters to you.

Edwin Buck
  • 69,361
  • 7
  • 100
  • 138