有没有办法通过在编辑中给出模式(更改后的代码)而不是日志消息或文件名来找到更改?
我在“帮助帮助重置”中已经看得很透彻,我认为没有一个好的方法。这是我想出的最好的技巧,但是我希望我错过了一项功能,或者有人可以做得更好。hg log -M -u goldberg -p | grep '(^changeset:\|
<pattern>
)'| grep -C 1'<pattern>
'
(然后手动选择修订号,以供以后使用这些修订)
最佳答案
您应该看看 hg grep
。
Search revisions of files for a regular expression. This command behaves differently than Unix grep. It only accepts Python/Perl regexps. It searches repository history, not the working directory. It always prints the revision number in which a match appears. By default, grep only prints output for the first revision of a file in which it finds a match. To get it to print every revision that contains a change in match status ("-" for a match that becomes a non-match, or "+" for a non-match that becomes a match), use the --all flag. Returns 0 if a match is found, 1 otherwise.
您可以键入
hg grep --help
以获取更多信息。
关于mercurial - 通过修补补丁找到 Mercurial 的变更集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5330782/