CVS:如何获取标签的创建日期? [英] CVS: How to get the date when a tag is created?

查看:20
本文介绍了CVS:如何获取标签的创建日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 CVS 存储库,每当构建成功时,我们都会在活动分支上创建一个标签.有什么方法可以确定标签的创建日期吗?查看历史记录并没有帮助,因为它只告诉文件被修改时的日期时间戳.

We have a CVS repository and we create a tag on the active branch whenever a successful build is done. Is there any way by which I can determine the date when the tag was created? Looking into the history doesn't helps since it only tells the date-time stamps of the file when it was modified.

谢谢!

推荐答案

您可以轻松配置 CVS 以记录所有与标签相关的操作.在文件 '$CVSROOT/CVSROOT/taginfo' 中,您可以连接一个像这样的预标记脚本:

You can easily configure CVS to log all tag-related actions. In the file '$CVSROOT/CVSROOT/taginfo' you can hook up a pre-tag script like this:

ALL $CVSROOT/CVSROOT/do_tag

如果此脚本返回非零退出值,则标记操作将被流产.这允许对标签名称进行语法检查.你可以每当有新版本发布时,也可以使用此钩子发送电子邮件标记.要编写所有标签操作的历史记录,您需要执行在你的 do_tag 文件中是这样的:

If this script returns a non-zero exit value, the tag operation will be aborted. This allows for syntax checks on the tag names. You can also use this hook to send emails, whenever a new release has been tagged. To write a history of all tag operations, you need to do something like this in your do_tag file:

#!/bin/sh
TAGHISTORY=~cvs/taghistory.log
echo -n "$(date): user $USER, tag " >> $TAGHISTORY
echo "$*" >> $TAGHISTORY
exit 0

<小时>

如果你开启了历史功能,你可以执行以下命令:


If you have the history function enabled, you can execute the following command:

cvs history -a -T

它会给你一些这样的行,给你每个标记操作的日期+时间、用户、模块和标记名:

It will give you some lines like this, giving you date+time, user, module and tagname of each tagging operation:

T 2011-04-02 07:55 +0000 ralph  mylib [testtag:A]

更多信息请查看关于历史的cvsbook

这篇关于CVS:如何获取标签的创建日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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