`
darrenzhu
  • 浏览: 804108 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

SVN Base and head revision

阅读更多
revision是修订版本的意思,别误当成reversion
简单的说,当你checkout一个版本下来,然后在本地做了修改,并且还没有提交代码,此时base代表没有本地修改的你刚才checkout的那个版本,head代表repository里面的最新版本(其它人可能有提交),当你提交后,并且没有他人提交,此时base应该与head相等。


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.


Revision reference:
http://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html

Revision Keywords
The Subversion client understands a number of revision keywords. These keywords can be used instead of integer arguments to the --revision (-r) option, and are resolved into specific revision numbers by Subversion:

HEAD
The latest (or “youngest”) revision in the repository.

BASE
The revision number of an item in a working copy. If the item has been locally modified, this refers to the way the item appears without those local modifications.

COMMITTED
The most recent revision prior to, or equal to, BASE, in which an item changed.

PREV
The revision immediately before the last revision in which an item changed. Technically, this boils down to COMMITTED-1.

As can be derived from their descriptions, the PREV, BASE, and COMMITTED revision keywords are used only when referring to a working copy path—they don't apply to repository URLs. HEAD, on the other hand, can be used in conjunction with both of these path types.

Here are some examples of revision keywords in action:

$ svn diff -r PREV:COMMITTED foo.c
# shows the last change committed to foo.c

$ svn log -r HEAD
# shows log message for the latest repository commit

$ svn diff -r HEAD
# compares your working copy (with all of its local changes) to the
# latest version of that tree in the repository

$ svn diff -r BASE:HEAD foo.c
# compares the unmodified version of foo.c with the latest version of
# foo.c in the repository

$ svn log -r BASE:HEAD
# shows all commit logs for the current versioned directory since you
# last updated

$ svn update -r PREV foo.c
# rewinds the last change on foo.c, decreasing foo.c's working revision

$ svn diff -r BASE:14 foo.c
# compares the unmodified version of foo.c with the way foo.c looked
# in revision 14
Revision Dates
Revision numbers reveal nothing about the world outside the version control system, but sometimes you need to correlate a moment in real time with a moment in version history. To facilitate this, the --revision (-r) option can also accept as input date specifiers wrapped in curly braces ({ and }). Subversion accepts the standard ISO-8601 date and time formats, plus a few others. Here are some examples.

$ svn update -r {2006-02-17}
$ svn update -r {15:30}
$ svn update -r {15:30:00.200000}
$ svn update -r {"2006-02-17 15:30"}
$ svn update -r {"2006-02-17 15:30 +0230"}
$ svn update -r {2006-02-17T15:30}
$ svn update -r {2006-02-17T15:30Z}
$ svn update -r {2006-02-17T15:30-04:00}
$ svn update -r {20060217T1530}
$ svn update -r {20060217T1530Z}
$ svn update -r {20060217T1530-0500}
分享到:
评论

相关推荐

    svn关键词BASE, HEAD, COMMITTED, PREV的深入理解.rar

    在版本控制系统Subversion(简称svn)中,有四个关键词经常被使用:BASE、HEAD、COMMITTED和PREV,它们是用来追踪文件和目录在不同版本状态的关键。这些关键词对于理解和操作svn仓库至关重要,尤其是在进行协同开发...

    Maven SVN Revision Number Plugin官方英文文档

    Maven SVN Revision Number Plugin是一款用于在Maven构建过程中获取Subversion(SVN)版本库中的修订版号(Revision Number)的插件。这个插件的主要目标是帮助开发者在构建过程或生成的工件中包含当前源代码在SVN...

    maven-svn-revision-number-plugin-1.4.jar

    maven-svn-revision-number-plugin-1.4.jar

    maven-svn-revision-number-plugin-1.2.jar

    maven-svn-revision-number-plugin-1.2.jar

    maven-svn-revision-number-plugin-1.7-sources.jar

    maven-svn-revision-number-plugin-1.7-sources.jar

    svn命令大全[PDF格式]

    $ svn diff --revision BASE:HEAD foo.c ``` - **显示自从上次更新以来的所有提交日志**: ``` $ svn log --revision BASE:HEAD ``` **用途**:这些命令主要用于比较不同版本之间的差异,以及查看提交历史记录...

    statsvn0.7.1

    统计svn代码量专用软件,解决svn log: svn info: Invalid svn info xml; unable to find revision or url for问题。官网发布的0.7.0版本有缺陷,一直报版本不匹配问题。

    svn64and关联eclipse.rar

    标题 "svn64and关联eclipse.rar" 暗示了这个压缩包文件包含了与64位版本的Subversion(SVN)集成Eclipse IDE相关的组件。Subversion是一种广泛使用的版本控制系统,而Eclipse是一款流行的开源集成开发环境(IDE)。...

    svn 64 用于eclipse

    - **Diff**:查看文件差异,选择"Team" > "Compare With" > "Head Revision"。 - **Merge**:解决冲突,Eclipse会自动标记冲突文件,手动编辑解决后提交。 5. **版本控制策略**: - 使用分支和标签管理代码的...

    关于SVN添加无用的受控文件后,取消文件受控的方法

    TortoiseSVN是一款非常优秀的SVN客户端工具,它提供了很多方便的功能,如上文提到的`Unversion and add to ignore list`就是一个非常实用的功能。通过这个快捷操作,可以快速地将不再需要版本控制的文件进行处理,...

    svn命令linux

    - `--revision BASE:HEAD`比较本地无改动的文件与远程最新版本的差异。 4. **日常操作**: - **更新**:`svn update`将远程仓库的最新变更同步到本地工作副本。 - **添加**:`svn add <文件或目录>`将新文件或...

    smartsvn for mac and Keygen

    标题中的"smartsvn for mac and Keygen"指的是SmartSVN的Mac版本以及Keygen。Keygen通常是指一种程序,用于生成软件的激活码或序列号,帮助用户绕过正式的授权流程进行安装和使用。然而,需要注意的是,使用Keygen...

    maven-svn-revision-number-plugin-1.7.jar

    maven-svn-revision-number-plugin-1.7.jar 资源共享,有需要其他jar包的可以在评论留言,看到后我会陆续上传。

    SVNKit获取SVN信息

    SVNInfo info = clientManager.getWCClient().doInfo(new SVNURL(repositoryUrl, filePath), SVNRevision.HEAD); System.out.println("File URL: " + info.getUrl()); System.out.println("Last Revision: " + ...

    svn 日志导出 增量补丁工具

    svn diff -r revision1:revision2 > patch_file.patch ``` 有了这个补丁文件,其他开发者只需应用这个补丁,就可以获取到最新的改动,而无需下载整个项目仓库。这在处理大型项目时尤其有用,因为增量补丁通常比完整...

    根据svn版本库自动生成版本号

    print(f'Latest SVN revision: {latest_revision}') ``` 然后,你可以结合`VersionConf.py`中的配置,使用`latest_revision`来构建你的版本号。例如,如果版本号格式定义如下: ```python from VersionConf import...

    default_dev.css.svn-base

    default_dev.css.svn-base

    svn-client-and-server

    以下是对"svn-client-and-server"的详细解释: 1. **SVN客户端**: SVN客户端是开发人员用来与SVN服务器交互的工具,它允许用户查看、检查、更新、提交文件和目录。常见的客户端有TortoiseSVN,它是一个图形化界面...

    svn1.14.1、svn1.14.2

    svn1.14.1、svn1.14.2

Global site tag (gtag.js) - Google Analytics