Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to ignore a commit in hg blame?

Tags:

c++

c

mercurial

I have files with a lot of macros which I want to replace with C++ code with templates.

In doing so, I'll have to change code like this

#define stuff_to_do (x) \
   do_some_stuff_##x( );  \
   do_some_more_stuff( x ); 

into

template <class T>
void stuff_to_do( T x ) {
       do_some_stuff<T>();
       do_some_more_stuff(); 
}

i.e. change tabs/spaces, and escape characters, and small insertions (like <T>) here and there.

It is important, however, that the annotations can point to the programmer who did the changes before this.

  • Can I make mercurial annotations ignore a particular commit ?
  • If not, is there another trick that I could do?
like image 214
Grim Fandango Avatar asked Mar 22 '23 11:03

Grim Fandango


1 Answers

hg annotate has some options for this:

--skip <REV[+]>
    revision to not display (EXPERIMENTAL)
-w, --ignore-all-space
    ignore white space when comparing lines
-b, --ignore-space-change
    ignore changes in the amount of white space
-B, --ignore-blank-lines
    ignore changes whose lines are all blank
-Z, --ignore-space-at-eol
    ignore changes in whitespace at EOL
-I, --include <PATTERN[+]>
    include names matching the given patterns
-X, --exclude <PATTERN[+]>
    exclude names matching the given patterns

The experimental --skip option was added in Mercurial 4.3.

like image 87
Peter Avatar answered Apr 01 '23 04:04

Peter