Subversion中原子提交的价值是什么? [英] What is the value of atomic commits in Subversion?

查看:144
本文介绍了Subversion中原子提交的价值是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建和遵循用于版本控制的最佳实践,并且遇到了Subversion中对原子提交的引用.由于我从未听说过此操作,因此对此有一些疑问.

  • 目的是什么?
  • 何时使用?
  • 它与普通提交有何不同?
  • TortoiseSVN 用户可以使用吗?如果可以,怎么办?

解决方案

原子提交没有特殊的命令. Subversion中的每个提交都是原子的.

这意味着每次提交(任何数量的文件)都将整体上成功或失败.

>

不可能只有一些提交的文件才能进入存储库,而另一些则不能(例如,由于在提交操作过程中发生错误或其中一个文件发生冲突).

与TortoiseSVN相同,因为它基于常规" Subversion功能.


以下摘录自 Subversion书:

一个svn commit操作发布 更改为任意数量的文件,并且 目录作为单个原子 交易.在您的工作副本中,您 可以更改文件的内容;创建, 删除,重命名和复制文件以及 目录;然后提交 作为原子的完整更改集 交易.

通过原子交易,我们的意思是简单 这:所有的变化都发生了 在存储库中,或者没有一个 发生.颠覆试图保留 面对程序的这种原子性 崩溃,系统崩溃,网络 问题和其他用户的操作.

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?

解决方案

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.

这篇关于Subversion中原子提交的价值是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆