如何获取并使用 CVSNT 提交 ID?

发布于 2024-09-05 03:22:09 字数 370 浏览 3 评论 0原文

我看到另一个问题引用了 CVSNT 自动生成的唯一提交 ID,该 ID 标记了每个提交。我认为我部门的大多数人都在使用 CVSNT 或其前端。

我发现CVSNT手册中描述了提交标识符,但是没有有关如何确定文件特定修订版的 CVSNT 提交标识符的说明。有办法做到这一点吗?我想知道为其他人的签入生成了哪些提交标识符,以便我可以将他们提交中涉及的文件分组在一起。

I saw a reference on another question to a unique commit id auto-generated by CVSNT that marks each commit. I think most people in my department are using CVSNT or frontends to it.

I found commit identifiers described in the CVSNT manual, but there is no explanation about how to determine what the CVSNT commit identifier is for a particular revision of a file. Is there a way to do this? I'd like to find out what commit identifiers are being generated for other people's checkins so I can group together the files involved in their commits.

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

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

发布评论

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

评论(1

ペ泪落弦音 2024-09-12 03:22:09

CVS 命令日志和 rlog 都显示文件各个修订的提交标识符。我不知道使用此标识符检索信息的 CVS 命令,但我可以确认单个提交中的所有文件共享相同的标识符。

我有自己的日志文件解析器,它使用 commit-id 将受单个提交影响的文件分组在一起(例如,更改历史记录按日期排序并将文件分组为单个提交)。

阅读您的链接后,您可能可以指定类似“log -r @commit-id”的内容来获取共享提交标识符的受影响文件的列表。命令行可能有更多调整,但以下内容取得了一些成功(有点吵):

c:\> cvs -q log -N "-r @fd049d34574117b"

=============================================================================

RCS file: /folder/file.xml,v
Working file: folder/file.xml
head: 1.3
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 4;     selected revisions: 1
description:
=============================================================================

RCS file: /folder/file2.xml,v
Working file: /folder/file2.xml
head: 1.2
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 2;     selected revisions: 0
description:
=============================================================================

请注意,第一个文件包含“选定的修订版本:1”,这意味着提交对应于文件的版本。

  1. 您可能可以使用正则表达式来过滤掉“selected revisions: 0”条目(由一系列“==============”分隔的多行reg),
  2. 然后仅提取“工作文件”结果条目以给出文件列表。

如果您不想使用自己的工具,请尝试查找“cvs 变更集”:

The CVS command log and rlog both show the commit identifier for individual revisions of a file. I'm not aware of CVS command that get retrieve information using this identifier, but I can confirm that all files in a single commit share the same identifier.

I have my own log-file parser that uses the commit-id to group together the files affected by a single commit (e.g. change history is sorted by date and groups files into single commits).

Having read your link, you could probably specify something like "log -r @commit-id" to get a list of affected files sharing the commit identifier. There are probably more tweaks to the command line, but the following gives some success (slightly noisy):

c:\> cvs -q log -N "-r @fd049d34574117b"

=============================================================================

RCS file: /folder/file.xml,v
Working file: folder/file.xml
head: 1.3
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 4;     selected revisions: 1
description:
=============================================================================

RCS file: /folder/file2.xml,v
Working file: /folder/file2.xml
head: 1.2
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 2;     selected revisions: 0
description:
=============================================================================

Notice that the first file contains "selected revisions: 1" meaning that commit corresponds to a version of the file.

  1. You could probably use a regular expression to filter out the "selected revisions: 0" entries (multi-line reg delimited by a series of "==============")
  2. Then extract only the "working file" entries of the result to give a file list.

If you don't want to roll your own tools, try looking for "cvs changeset":

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