What does a TortoiseSVN cleanup actually do?

天大地大妈咪最大 提交于 2019-12-03 04:04:17

问题


What does a TortoiseSVN cleanup actually do?

I have not found a pattern, but I frequently get asked to do a "cleanup" while trying to commit code.

If TortoiseSVN knows when it's dirty, why doesn't it run a cleanup itself?


回答1:


Edit: I think it's not automatic as it needs to abort operations and unlock the working copy in /path.

Subversion book:

Recursively clean up the working copy, removing locks and resuming unfinished operations. If you ever get a working copy locked error, run this command to remove stale locks and get your working copy into a usable state again. ” Note that in this context lock refers to local filesystem locking, not repository locking.

It's basically a way of trying to recover any errors that occur with SVN.

Documentation on cleanup:

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-cleanup.html

"If a Subversion command cannot complete successfully, perhaps due to server problems, your working copy can be left in an inconsistent state. In that case you need to use TortoiseSVN → Cleanup on the folder. It is a good idea to do this at the top level of the working copy.

Cleanup has another useful side effect. If a file date changes but its content doesn't, Subversion cannot tell whether it has really changed except by doing a byte-by-byte comparison with the pristine copy. If you have a lot of files in this state it makes acquiring status very slow, which will make many dialogs slow to respond. Executing a Cleanup on your working copy will repair these “broken” timestamps and restore status checks to full speed."




回答2:


It puts duct tape over bugs and a dumb architecture in SVN which allow the working copy to be corrupt.

It's not automatic for dumb architecture reasons and because it takes FOREVER. Of course, when SVN got popular its architecture was miles ahead of CVS.




回答3:


It looks for inconsistencies. From the docs:

If a Subversion command cannot complete successfully, perhaps due to server problems, your working copy can be left in an inconsistent state. In that case you need to use TortoiseSVN → Cleanup on the folder. It is a good idea to do this at the top level of the working copy.

Cleanup has another useful side effect. If a file date changes but its content doesn't, Subversion cannot tell whether it has really changed except by doing a byte-by-byte comparison with the pristine copy. If you have a lot of files in this state it makes acquiring status very slow, which will make many dialogs slow to respond. Executing a Cleanup on your working copy will repair these “broken” timestamps and restore status checks to full speed.



来源:https://stackoverflow.com/questions/1539772/what-does-a-tortoisesvn-cleanup-actually-do

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!