c++ - Mercurial changeset c++分析

标签 c++ mercurial analysis changeset

是否有某种方法可以分析 C++ mercurial 变更集以找出例如修改的函数或类?

我想统计某部分代码的修改量:方法、类、文件、文件夹等。

最佳答案

不确定这在使用 C++ 时有多好,但 Mercurial 可以选择使用 git 格式差异。 git diffhg diff 都有一个选项来查看发生更改的函数...在 Mercurial 中,您可以使用 hg diff -p:

> hg diff
diff --git a/sandbox/sandbox.cpp b/sandbox/sandbox.cpp
--- a/sandbox/sandbox.cpp
+++ b/sandbox/sandbox.cpp
@@ -86,6 +103,8 @@
... diff output removed for conciseness

> hg diff -p
diff --git a/sandbox/sandbox.cpp b/sandbox/sandbox.cpp
--- a/sandbox/sandbox.cpp
+++ b/sandbox/sandbox.cpp
@@ -86,6 +103,8 @@ int _tmain(int argc, _TCHAR* argv[])
... diff output removed for conciseness

请注意,使用 -p 选项,diff 输出的每个 block 都包含包含函数(在本例中为 _tmain)。请注意,新函数似乎不包含该信息。

请注意,我不确定您将如何使用它。也许 grep 包含 @@.*\(.*\) 的行的输出以获得函数列表?

关于c++ - Mercurial changeset c++分析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22387873/

相关文章:

r - R中多个变量的频率计数

monitoring - SSL/TLS 连接监控/分析

c++ - 我们为什么以及在哪里使用向下类型转换?

c++ - 如何检查给定进程在运行时加载了哪些共享库?

c++ - const在不同地方的c++中是什么意思

c++ - 当前实例成员函数的函数指针

Mercurial:特定变更集中的差异?

linux - 使用 mercurial 设置文件所有权

algorithm - 你如何在代码中获取各种算法分析因素?

svn - 为 SVN 用户推荐的 Mercurial 存储库/文件夹结构