如何获取 CVS 存储库中创建的标签列表?

发布于 2024-11-10 14:08:57 字数 161 浏览 4 评论 0原文

是否有任何 CLI 命令可用于获取在指定时间范围内在模块的分支或头部创建的标签列表?

我简单需要的是标签列表及其创建日期。给定以下参数

  1. 模块名称
  2. 分支名称(或 :: HEAD)
  3. 开始日期
  4. 结束日期

Are there any CLI commands that can be used to get a list of Tags that have been created on a branch or head of a module within a specified time frame?

What I briefly need is a list of Tags and the date when they were created. Given following parameters

  1. Module Name
  2. Branch Name (or :: HEAD)
  3. Start Date
  4. End Date

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

北方的巷 2024-11-17 14:08:57

我刚刚了解到:

cvs status -v

列出每个文件的所有标签和分支及其所属的修订版。

你可以从那里工作...

I just learned:

cvs status -v

Lists all tags and braches for each and any file together with the revision it belongs to.

You could work from there ...

烟花肆意 2024-11-17 14:08:57

可以使用以下命令列出模块中存在的标签或分支。这是从 SO 的另一个答案中获取的内容

列出所有标签:

cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -h *Module*| awk -F"[.:]" '/^\t/&&$(NF-1)!=0{print $1}' | sort -u

列出所有分支:

cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -h *Module*| awk -F"[.:]" '/^\t/&&$(NF-1)==0{print $1}' | sort -u

这使用神奇的分支编号来识别符号链接是分支还是标签。

正如 skaffman 在本页的一个答案中提到的,无法确定标签的创建日期。最好的方法是通过考虑该标签的日志中列出的最新日期来确定大致日期。

像这样的:

cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -N -S -r*TagName* *Module* | grep ^date: | sort | tail -1 | cut -d\; -f1 | sed -e 's/date: //'

这是一个 bash 脚本,我编写了一个 bash 脚本,用于给出所有标签及其大约的列表。创建日期

#!/bin/bash

CVSROOT=$1
PROTOCOL=$2
LOGIN=$3
PASSWORD=$4
MODULE=$5
REVISION=$6
OUTPUT=$7

CVS_HOST=""
if test "${PASSWORD:-t}" != "t" ; then
    CVS_HOST=":${PROTOCOL}:${LOGIN}:${PASSWORD}@${CVSROOT}"
else
    CVS_HOST=":${PROTOCOL}:${LOGIN}@${CVSROOT}"
fi

CVS_REVISION=""
if test "${REVISION:-t}" != "t" ; then
    CVS_REVISION="-r${REVISION}"
fi

echo "\"Tag Name\",\"Create Date\"" > ${OUTPUT}

echo "EXEC: cvs -Q -d ${CVS_HOST} rlog -h -S ${CVS_REVISION} ${MODULE} | awk -F"[.:]" '/^\t/&&\$(NF-1)!=0{print \$1}' | sort -u"
cvs -Q -d ${CVS_HOST} rlog -h ${CVS_REVISION} ${MODULE} | awk -F"[.:]" '/^\t/&&\$(NF-1)!=0{print $1}' | sort -u | while read tagName
do
    #get approx create date
    echo "EXEC: cvs -Q -d ${CVS_HOST} rlog -N -S -r$tagName ${MODULE} | grep ^date: | sort | tail -1 | cut -d\; -f1 | sed -e 's/date: //'"
    date=`cvs -Q -d ${CVS_HOST} rlog -N -S -r$tagName ${MODULE} | grep ^date: | sort | tail -1 | cut -d\; -f1 | sed -e 's/date: //'`

    #Save to output file
    echo "\"$tagName\",\"$date\"" >> ${OUTPUT}
done

One can list tags or branches present in a module using the following command. This is something picked up from another answer at SO

To list all tags:

cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -h *Module*| awk -F"[.:]" '/^\t/&&$(NF-1)!=0{print $1}' | sort -u

To List all branches:

cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -h *Module*| awk -F"[.:]" '/^\t/&&$(NF-1)==0{print $1}' | sort -u

This uses the magic branch numbers to identify is a symbolic link is a branch or a tag.

As skaffman mentioned in one of the answers on this page, it is not possible to determine date when tag is created. The best one can do is to identify an approximate date by considering the most recent date listed in the logs for that tag.

Something like this:

cvs -Q -d :pserver:*User*:*Pass*@*HostName*:/cvsroot rlog -N -S -r*TagName* *Module* | grep ^date: | sort | tail -1 | cut -d\; -f1 | sed -e 's/date: //'

This is a bash script I worked out to give list of all tags with their approx. creation date

#!/bin/bash

CVSROOT=$1
PROTOCOL=$2
LOGIN=$3
PASSWORD=$4
MODULE=$5
REVISION=$6
OUTPUT=$7

CVS_HOST=""
if test "${PASSWORD:-t}" != "t" ; then
    CVS_HOST=":${PROTOCOL}:${LOGIN}:${PASSWORD}@${CVSROOT}"
else
    CVS_HOST=":${PROTOCOL}:${LOGIN}@${CVSROOT}"
fi

CVS_REVISION=""
if test "${REVISION:-t}" != "t" ; then
    CVS_REVISION="-r${REVISION}"
fi

echo "\"Tag Name\",\"Create Date\"" > ${OUTPUT}

echo "EXEC: cvs -Q -d ${CVS_HOST} rlog -h -S ${CVS_REVISION} ${MODULE} | awk -F"[.:]" '/^\t/&&\$(NF-1)!=0{print \$1}' | sort -u"
cvs -Q -d ${CVS_HOST} rlog -h ${CVS_REVISION} ${MODULE} | awk -F"[.:]" '/^\t/&&\$(NF-1)!=0{print $1}' | sort -u | while read tagName
do
    #get approx create date
    echo "EXEC: cvs -Q -d ${CVS_HOST} rlog -N -S -r$tagName ${MODULE} | grep ^date: | sort | tail -1 | cut -d\; -f1 | sed -e 's/date: //'"
    date=`cvs -Q -d ${CVS_HOST} rlog -N -S -r$tagName ${MODULE} | grep ^date: | sort | tail -1 | cut -d\; -f1 | sed -e 's/date: //'`

    #Save to output file
    echo "\"$tagName\",\"$date\"" >> ${OUTPUT}
done
执妄 2024-11-17 14:08:57

如果您启用了历史功能,则可以执行
以下命令:

cvs history -a -T

它将给您一些像这样的行,为您提供每个标记操作的日期+时间、用户、模块和标记名:

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

有关详细信息,请检查 cvsbook 历史记录

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]

For more information check the cvsbook on history

氛圍 2024-11-17 14:08:57

CVS做不到这一点,太原始了。标签附加到各个文件修订版,而不是附加到模块或存储库。此外,标签没有日期元数据,因此您也无法判断它们的创建时间。

因此您指定的选择标准都不能使用。您可以使用的唯一标准是特定版本文件,它会告诉您哪些修订版本具有哪些标签,但仅此而已。

CVS can't do that, it's too primitive. Tags are attached to individual file revisions, not to the module or repository. Furthermore, the tags have no date metadata, so you can't tell when they were created, either.

So none of the selection criteria you specified can be used. The only criteria you can use is a specific versioned file, which will tell you which revisions have which tags, but that's it.

暖阳 2024-11-17 14:08:57

我正在使用 cvsnt(install) 使用 Cvs 存储库 ..

查询:

1) 我只想要 cvs 中的标签名称列表。

2)如何使用cvsnt创建存储库。

3) 如何将整个模块签入新存储库。

我尝试示例:

1)当我尝试创建新存储库时

cvs -d :pserver:<user>@<host>:<new_repository> init

2)将模块导入存储库

cvs -d repository_path import name_of_project vendor_tag release_tag

I am Using Cvs Repository using cvsnt(install) ..

Queries:

1) I want only List of tag name from cvs.

2) How to create Repository using cvsnt.

3) How to Check-in Entire module into New Repository.

I try Sample:

1) when I try to create a new repository

cvs -d :pserver:<user>@<host>:<new_repository> init

2) Import Module into repository

cvs -d repository_path import name_of_project vendor_tag release_tag
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文