有没有办法忽略hg责任中的提交?

问题描述 投票:3回答:2

我有很多宏的文件,我想用C ++代码替换模板。

这样做,我将不得不改变这样的代码

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

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

即改变标签/空格,转义字符和小插入(如<T>)。

然而,重要的是,注释可以指向在此之前进行更改的程序员。

  • 我可以使mercurial注释忽略特定的提交吗?
  • 如果没有,是否还有其他技巧可以做?
c++ c mercurial
2个回答
3
投票

没有办法告诉hg annotate不显示某些提交。从此以后,检查“谁最初写这个”的人将不得不在“之前”看到这种大规模改变自己。

可能使未来侦探工作更轻松的一些事情是:

  1. 作为非人类用户进行提交。像hg commit --user "codeformat bot"之类的东西所以人们都知道不要“责怪”你
  2. 留下旧版本但注释掉 - 复制它并更改副本而不是更改原始版本将使得在注释掉的行上看到原始的责备信息变得容易(假设使用块注释并且在宏中是合法的。 ..)

1
投票

hg annotate有一些选择:

--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

--skip中添加了实验性Mercurial 4.3选项。

© www.soinside.com 2019 - 2024. All rights reserved.