When does svn BASE become equal to the HEAD--- "svn log -rHEAD:1"

 

I had a question regarding the BASE version in svn. I know it is the pristine version of an item from the last time update was run and svn diff and status basically run against this version. When does the BASE get updated? Does it get updated to the HEAD when update is run? Is this always true even if there was a conflict during update? What does BASE have incase of a conflict? Does it still have the version from my last update(before the most recent update that caused a conflict) or will it be updated to the HEAD even if there is a conflict?
Also when svn commit is run I am assuming the BASE gets updated with my local changes and at this point BASE, HEAD and my local copy all are the same? Provided the commit was successful.

link | improve this question

57% accept rate
 
 
feedback
up vote 12 down vote accepted

HEAD is the latest revision in the repository. BASE is the last revision you have obtained from the repository. They are the same after a successful commit or update.

When you make changes, your files differ from the BASE copies. When you revert, they go back to matching the BASE revision. When you get a conflict, you do not update the repository. Rather, your files are considered to still be "being edited" as if you were making changes. After you resolve conflicts, you have in essence decided what the final files will look like and you then commit them as you would have normally. So, conflicts are like a case of special editing.

link | improve this answer
 
2 
They are the same, however briefly, after an update, though not necessarily after a commit. Consider directories and "mixed revision working copies". –  bendin Apr 14 '09 at 9:13
 
Apparently creating these "mixed revision working copies" -- which means you can create a commit without complete knowledge of what's going on -- is a consequence of one of the "fundamental rules of Subversion". –  Josh Lee Oct 14 '09 at 10:07
feedback

It matters when you are viewing logs, because svn log without url shows your BASE log, but with url your HEAD log, that's why i always use "svn log -rHEAD:1" to see all the changes.

link | improve this answer
 
 
feedback

BASE is the revision of your working copy as it exists in the repository. In other words, your revision without the changes you've made. So if you svn update a file or folder to HEAD, then BASE and HEAD are equal.

When there is a conflict, BASE becomes the revision before the commit that conflicted with your working copy.

Run svn info on an item to see it's BASE revision.

Revision Specifiers

link | improve this answer
 
 
feedback

Theory: After a successfull recursive update or switch the base version of all your files becomes head. After a commit or partial update some files might be at the HEAD revision, but only after an update that didn't skip files you can be sure that all files are at the same version. (Reasons for skipping are unversioned obstructions or conflicts).

But, why would you need to know this. Subversion should know this internally, but this knowledge shouldn't really matter to the user in most cases. (Subversion automatically warns you when files are out of date).

As far as I can tell, the only time you really need to make sure that you are at a stable version is, when you are creating a branch from a working copy.

link | improve this answer
 
1 
I just wanted to figure out how svn works and its implementation details. Thanks for your response. –  HeretoLearn Apr 14 '09 at 2:04
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值