获取最后一条消息或最后一次 CVS 提交的差异
我想知道如何轻松获取 CVS 模块中的最后更改。
I am wondering how to get the last changes in a CVS module easily.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我想知道如何轻松获取 CVS 模块中的最后更改。
I am wondering how to get the last changes in a CVS module easily.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
我想也许你可以使用历史命令。尝试类似的操作:
上面的示例显示了自指定日期以来的所有提交(指定后列表的长度有限......)。
-c
表示提交,-a
表示所有用户。具有相同时间戳和用户的提交显然来自同一提交。然后,您可以继续读取该提交的日志消息,
只需从特定提交中选择一个文件。您还可以在历史输出中找到该文件的版本。最后,要查看差异,我将使用
此处,“日期 1”和“日期 2”应该是提交之前和之后的时间戳。请注意(据我所知),如果您在分支上工作(??),这似乎不起作用。我想这将是另一个问题的主题。
I think perhaps you could use the history command. Try something like:
The above example shows all commits since the date specified (specified so the list is limited in length...).
-c
means commits,-a
means all users.Commits with the same timestamp and user are then obviously from the same commit. You can then proceed to read the log message of that commit with
Just select one of the files from the specific commit. You find the version of that file in the history output as well. Finally, to see the diff I would use
Here, "date 1" and "date 2" should be a timestamp just before and just after the commit. Note that (as far as I am aware), this does not seem to work if you are working on a branch (??). That would be the topic for another question I suppose.
cvs log
将返回所有这些。由于您不能说“最后 N 个修订”(在这里,我什至不能说cvs log HEAD
),因此有两个选项:使用
head -N
code> 获取最上面的 N 行(仅限 Unix 或 Cygwin)使用日期和
cvs log -d DATE
cvs log
will return all of them. Since you can't say "the last N revisions" (here, I can't even saycvs log HEAD
), there are two options:Use
head -N
the get the N topmost lines (Unix or Cygwin only)Use a date and
cvs log -d DATE
由于 CVS 实现单独对每个文件进行版本控制,我想您必须遍历每个文件并比较提交时间戳以确定哪个文件是最新的。结合这一点,CVS 不支持提交集的概念,因此您可以获得一堆具有相同提交时间戳的文件。那么哪一个是最新的呢?或者,也许您可以创建一个写入日志文件的提交挂钩,并使用它来确定最新的提交。
正如您可能已经想到的,这两条路都不是特别适合选择的道路。我强烈建议您在模块级别始终与标签进行比较。建立一个软件流程,包括在进行足够重要的改进时对模块进行标记(例如每日构建、部署到测试环境等),然后使用创建的标记作为比较基线。
完成对标记的最新更改的比较。
cvs rdiff
命令或cvs diff
命令来请参阅 CVS完整参考文档。
Since the CVS implementation versions each file individually, I suppose you'd have to through each file and compare the commit timestamps to determine which one is the latest. Combine this with the fact that CVS does not support the concept of a commit set, so you can get a bunch of files with equal commit timestamp. So which one is the latest? Or maybe you could create a commit hook that writes to a log file and use that to determine the latest commit.
As you probably figured out, neither of these is a particularly giving path to choose. I strongly suggest that at the module-level you always compare against tags. Establish a software process that includes tagging the module when an important enough improvement is made (e.g. daily build, deployment to test environment, etc..) and then use the created tag as the comparison baseline.
You can accomplish diffing the latest changes against a tag by using
cvs rdiff
command without a working copy, orcvs diff
command at the top-level of a working copySee the CVS documentation for complete reference.