如何查找修改函数引用的所有变更集?
我需要找到与 Save() 方法相关的代码的所有最新更改。我需要一个 Mercurial 命令来查找每个变更集/文件,其中引用字符串“Save();”的行被添加或修改。
我需要的不仅仅是更改集,我还需要查看进行更改的文件。
I need to find all recent changes to our code that are related to the Save() method. I need a mercurial command to find every changeset/files in which a line that refers to the string "Save();" was added or modified.
I need more that just the changesets, I need to review the files where the changes where made.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来你正在寻找类似的东西
这应该给你格式中的每个文件更改
--all 标志对于确保你获得所有引用很有用,因为默认情况下 hg 在找到文件后停止查看文件第一个参考(通过修订列表向后搜索)。另请注意,您几乎肯定会想要限制搜索的修订范围,因为这在较大的存储库上需要相当多的时间。
如果您使用的是 unix 系统,您应该能够将 grep 命令的输出通过管道传输到文件中(运行需要一段时间,您可能需要缓存它,以防您一开始没有得到后面的内容)时间)
这应该会为您提供您想要查看的文件和修订版本的列表。
It seems like you're looking for something like
That should give you every file change in the format
The --all flag is useful to make sure that you get all of the references, as by default hg stops looking at a file after it finds the first reference (searching backwards through the revision list). Also note that you'll almost certainly want to limit the revision range you search on, as this takes quite a bit of time on a largish repo.
If you're on a unix system, you should be able to pipe the output of the grep command into a file (it takes awhile to run, you probably want to cache it in case you don't get the later stuff right the first time)
That should give you the list of files and revisions that you want to look at.
您正在寻找
hg grep
。它采用 Perl/Python 正则表达式,并返回在其中找到匹配项的文件的第一个修订版的结果。因此,就您而言,类似的事情
至少应该是一个很好的起点。
You are looking for
hg grep
. It takes a Perl/Python regex and returns a result for the first revision of a file in which it finds a match.So in your case, something like
should at least be a good starting place.