- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 CVS 中有一个文件,一个 *.h
文件。
我有一个定义:
#define MY_BUILD_TAG "$Name: $"
我 checkin 文件,用自定义 TAG ( cvs tag
) 标记它。
我cvs checkout
文件所属的模块从头开始(当然是 -r <my tag>
)
cvs status
确实在文件上正确显示了新的粘性标签。但是,"$Name: $"
的值不会因为我的文件被 check out 而改变。我希望它能反射(reflect)我的粘性标签。
我做错了什么?我试着玩弄 :
之间的空间和 $
, 使它成为 2, 3, 4, 1 地方无济于事。
最佳答案
看起来 CVS 不会仅仅因为 $Name
扩展名发生变化而更新文件。如果它必须创建文件,它会更新它。
我在 /home/kst/CVS_smov
有一个 CVS 存储库,其中有一个名为 name-test
的模块。此脚本演示了该行为。更改前两个命令以使用不同的配置进行演示。
#!/bin/bash
export CVSROOT=/home/kst/CVS_smov
cd ~/cvs-smov/name-test
echo '$Id:$' > name.txt
echo '$Name:$' >> name.txt
cvs add name.txt
cvs commit -m 'First checkin' name.txt
echo "name.txt:"
cat name.txt
echo ''
cvs tag tag-name name.txt
cd ..
cvs checkout -r tag-name name-test
cd name-test
echo "After cvs checkout -r:"
cat name.txt
echo ''
cd ..
rm -r name-test
cvs checkout -r tag-name name-test
cd name-test
echo "After rm -r and cvs checkout -r:"
cat name.txt
这是我使用 CVS 1.12.13 获得的输出:
cvs add: scheduling file `name.txt' for addition
cvs add: use `cvs commit' to add this file permanently
/home/kst/CVS_smov/name-test/name.txt,v <-- name.txt
initial revision: 1.1
name.txt:
$Id: name.txt,v 1.1 2013/06/17 15:56:50 kst Exp $
$Name: $
T name.txt
cvs checkout: Updating name-test
After cvs checkout -r:
$Id: name.txt,v 1.1 2013/06/17 15:56:50 kst Exp $
$Name: $
cvs checkout: Updating name-test
U name-test/name.txt
After rm -r and cvs checkout -r:
$Id: name.txt,v 1.1 2013/06/17 15:56:50 kst Exp $
$Name: tag-name $
总结:
我在创建文件并 checkin 后显示文件的内容(没有 $Name
因为没有标签),在创建标签并 checkout 模块后($Name
仍然没有更新),然后在修改目录并再次检查它之后(现在 $Name
已填写)。
这可能是 CVS 中的一个错误,但坦率地说,我没有充分使用 CVS 标签来确定它应该的行为方式。
更新:
查看 CVS 源代码,我看到一些评论表达了对 Name
关键字的一些不确定性。
在src/rcs.c
中,函数RCS_gettag
:
/* We have found a numeric revision for the revision tag.
To support expanding the RCS keyword Name, if
SIMPLE_TAG is not NULL, tell the the caller that this
is a simple tag which co will recognize. FIXME: Are
there other cases in which we should set this? In
particular, what if we expand RCS keywords internally
without calling co? */
在src/rcscmds.c
中,函数RCS_exec_rcsdiff
:
/* Historically, `cvs diff' has expanded the $Name keyword to the
empty string when checking out revisions. This is an accident,
but no one has considered the issue thoroughly enough to determine
what the best behavior is. Passing NULL for the `nametag' argument
preserves the existing behavior. */
并且在src/update.c
中,函数patch_file
:
/* FIXME - Passing vers_ts->tag here is wrong in the least number
* of cases. Since we don't know whether vn_user was checked out
* using a tag, we pass vers_ts->tag, which, assuming the user did
* not specify a new TAG to -r, will be the branch we are on.
*
* The only thing it is used for is to substitute in for the Name
* RCS keyword, so in the error case, the patch fails to apply on
* the client end and we end up resending the whole file.
*
* At least, if we are keeping track of the tag vn_user came from,
* I don't know where yet. -DRP
*/
最后一个让我印象深刻的是观察到的行为最可能的原因。
关于CVS 关键字对我不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16996508/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!