如何使用mercurial样式获取在给定修订版中受影响的修改过的文件和行?

时间:2015-04-29 17:30:51

标签: mercurial diff

我正在尝试使用mercurial提取受修订影响的文件以及这些文件中已更改的行。

到目前为止,我已经列出了以下文件:

hg log --stat -p -r R --style my_style

my_style

changeset = "{date|hgdate}\n{files}\n"
file = "{file}\n"

这是一个输出示例:

1200467360 0

groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/GroovyLexer.java

1 files changed, 3 insertions(+), 2 deletions(-)

diff -r a72d4e87d6cf -r 260a269563c6 groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/GroovyLexer.java
--- a/groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/GroovyLexer.java   Wed Jan 16 06:16:32 2008 +0000
+++ b/groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/GroovyLexer.java   Wed Jan 16 07:09:20 2008 +0000
@@ -112,7 +112,7 @@
             if (antlrToken != null) {
                 int intId = antlrToken.getType();

-                int len = lexerInput.readLength() - myCharBuffer.getExtraCharCount();
+                int len = lexerInput.readLengthEOF() - myCharBuffer.getExtraCharCount();
                 if ( antlrToken.getText() != null ) {
                     len = Math.max( len, antlrToken.getText().length() );
                 }
@@ -129,7 +129,8 @@
                     }
                 }

-                if ( scanner.getStringCtorState() != 0) {
+                // state 8 occured with '}' character closing expression in gstring
+                if ( scanner.getStringCtorState() != 0 && scanner.getStringCtorState() != 8) {
                     intId = GroovyTokenTypes.STRING_LITERAL;
                 }

我想要的是类似的东西:

1200467360 0
  groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/GroovyLexer.java @@ -112,7 +112,7 @@ @@ -129,7 +129,8 @@

有没有办法在样式文件中实现?如果没有,实现它的最佳方法是什么?

0 个答案:

没有答案