【发布时间】:2014-04-18 17:36:00
【问题描述】:
有什么方法可以分析 C++ mercurial 变更集以找出例如修改的函数或类吗?
我想统计一下代码某些部分的修订量:方法、类、文件、文件夹等。
【问题讨论】:
标签: c++ mercurial analysis changeset
有什么方法可以分析 C++ mercurial 变更集以找出例如修改的函数或类吗?
我想统计一下代码某些部分的修订量:方法、类、文件、文件夹等。
【问题讨论】:
标签: c++ mercurial analysis changeset
不确定在使用 C++ 时这有多好,但 Mercurial 可以选择使用 git 格式差异。 git diff 和 hg 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 选项,差异输出的每个块都包含包含函数(在本例中为_tmain)。请注意,新功能似乎不包含该信息。
请注意,我不确定您将如何使用它。也许 grep 包含 @@.*\(.*\) 的行的输出以获取函数列表?
【讨论】:
VCS 通常与内容无关,它们只知道文本行,而对其他内容一无所知。为了增加了解 C 函数、C++ 类、FORTRAN 子例程/函数的负担,......最终出现在 emacs-land 中。不要去那里...
【讨论】: