简体   繁体   中英

How to get C++ function names in hg diffs?

I would like to get the C++ function names in a file. I tried do this with the command diff because I only need get the name of the function which is modified but I could not get it. I know that with python files it is possible using git with the option 'git diff file.py'. Is it possible do it with c++ files in Mercurial?

I think you are looking for the config option diff.showfunc . The doc ( hg help config ) says:

"showfunc"
    Show which function each change is in.

It's working fine for Python functions and I think the heuristic should work similarly for C++ files. Maybe it will need functions body to be indented to correctly detect C++ functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM