title: How to get modified files and lines impacted at a given revision with mercurial style?
body: <p>I am trying to extract the files impacted by a revision and the changed lines in those files with mercurial. </p>
  
  <p>So far, I've the list of files with :</p>
  
  <pre><code>hg log --stat -p -r R --style my_style
  </code></pre>
  
  <p>my_style</p>
  
  <pre><code>changeset = "{date|hgdate}\n{files}\n"
  file = "{file}\n"
  </code></pre>
  
  <p>Here's an output example :</p>
  
  <pre><code>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 &amp;&amp; scanner.getStringCtorState() != 8) {
                       intId = GroovyTokenTypes.STRING_LITERAL;
                   }
  </code></pre>
  
  <p>What I would like is something similar to:</p>
  
  <pre><code>1200467360 0
    groovy.editor/src/org/netbeans/modules/groovy/editor/lexer/GroovyLexer.java @@ -112,7 +112,7 @@ @@ -129,7 +129,8 @@
  </code></pre>
  
  <p>Is there a way to achieve that in the style file ? If not, what will be the best way to achieve it ?</p>