Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the value of atomic commits in Subversion?

I'm trying to create and follow best practices for versioning control and came across a reference to atomic commits in Subversion. Since I've never heard of this action, I have a few questions about it.

  • What's its purpose?
  • When should it be used?
  • How is it different than a normal commit?
  • Is it available to TortoiseSVN users? If so, how?
like image 554
phreeskier Avatar asked Nov 29 '22 06:11

phreeskier


1 Answers

There is no special command for atomic commits. Every commit in Subversion is atomic.

It means every commit (of any number of files) will either succeed or fail as a whole.
It's not possible that only some of the commited files make it to the repository and others not (for example, because of an error that occurred in the middle of the commit operation or a conflict in one of the files).

This is the same for TortoiseSVN, since it builds on the "normal" Subversion functionality.


The following is an excerpt from the Subversion book:

An svn commit operation publishes changes to any number of files and directories as a single atomic transaction. In your working copy, you can change files' contents; create, delete, rename, and copy files and directories; and then commit a complete set of changes as an atomic transaction.

By atomic transaction, we mean simply this: either all of the changes happen in the repository, or none of them happens. Subversion tries to retain this atomicity in the face of program crashes, system crashes, network problems, and other users' actions.

like image 56
M4N Avatar answered Dec 05 '22 08:12

M4N