如何配置BeyondCompare以忽略注释中SCM替换的文本? [英] How do I configure BeyondCompare to ignore SCM replaced text in comments?

查看:335
本文介绍了如何配置BeyondCompare以忽略注释中SCM替换的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实有一些文本序列被SCM(在我的情况下为Perforce)代替.

I do have some text sequences that are replaced by the SCM (Perforce in my case).

我确实想配置BeyondCompare来将这些序列视为不重要的差异,以便在比较文件时可以忽略它们.

I do want to configure BeyondCompare to consider these sequences as unimportant differences in order to be able to ignore them when I compare files.

就我而言,这是关于Python源文件的,序列看起来像

In my case it's about Python source files and the sequences are looking like

# $Id: //depot/.../filename#7 $
# $DateTime: 2010/09/01 10:45:29 $
# $Author: username $
# $Change: 1234 $

有时这些序列可以在注释之外,但是即使在这种情况下,我也希望能够忽略这些行,因为它们并没有真正改变.

Sometimes these sequences can be outside comments, but even in this cases I would like to be able ignore these lines because they are not really changed.

推荐答案

Beyond Compare的解析器目前不支持(v3/v4)嵌套元素,因此不能使用文件格式语法将SCM序列标记为不重要如果文本已经被分类为注释,字符串等,则为特定的文件类型.

Beyond Compare's parser doesn't currently (v3/v4) support nested elements, so file formats grammars can't be used to mark an SCM sequence as unimportant for a specific file type if the text is already classified as a comment, string, etc.

Beyond Compare 4.0新增了对将任意文本标记为在整个比较中不重要的独立语法的支持.

Beyond Compare 4.0 added support for marking arbitrary text as unimportant across an entire comparison, separate from the grammar.

  1. 加载您感兴趣的文件
  2. 单击会话设置按钮(又名带有裁判图标的规则),或使用会话->会话设置菜单项.
  3. li>
  4. 切换到重要"标签
  5. 点击不重要的文本列表底部的+按钮.
  6. 将纯文本或正则表达式添加到要查找的文本中进行编辑,并在必要时选中正则表达式复选框.在这种情况下,正则表达式为:
    \$(Id|DateTime|Author|Change):.*\$
  7. 点击确定.
  8. 默认情况下,这些更改仅会影响当前比较.您可以将会话设置"对话框底部的组合框从仅用于此视图更改为还更新会话默认值,以使其影响所有文件类型的所有将来比较.
  1. Load the files you're interested in
  2. Click the Session Settings button (aka Rules w/ umpire icon) or use the Session->Session Settings menu item.
  3. Switch to the Importance tab
  4. Click the + button at the bottom of the Unimportant text list.
  5. Add the plain text or regular expression to Text to find edit and check the Regular Expression checkbox if necessary. In this case the regular expression would be:
    \$(Id|DateTime|Author|Change):.*\$
  6. Click Ok.
  7. By default these changes will only affect the current comparison. You can change the combobox at the bottom of the Session Settings dialog from Use for this view only to Also update session defaults to make it affect all future comparisons for all file types.

这篇关于如何配置BeyondCompare以忽略注释中SCM替换的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆