Patchwork [Bug,5199] New: hg grep not showing correct revision number

login
register
mail settings
Submitter mercurial-bugs@selenic.com
Date April 13, 2016, 9:06 a.m.
Message ID <bug-5199-285@https.bz.mercurial-scm.org/>
Download mbox | patch
Permalink /patch/14575/
State Not Applicable
Headers show

Comments

mercurial-bugs@selenic.com - April 13, 2016, 9:06 a.m.
https://bz.mercurial-scm.org/show_bug.cgi?id=5199

            Bug ID: 5199
           Summary: hg grep not showing correct revision number
           Product: Mercurial
           Version: 3.7.3
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla@selenic.com
          Reporter: dejan.crnila@dewesoft.si
                CC: mercurial-devel@selenic.com

here's an example of incorrect hg grep revision numbers. hg grep outputs that
"LastLevel := I" should be in revision 481. Checking diff of 481 agains it's
parent does not show this change. None of the printed revisions are correct.

dejan@dejans /c/DXEProjects/DX
$ hg grep --all -f -n -r 0:tip "LastLevel := I" Core/Objects/LoadUnit.pas
Core/Objects/LoadUnit.pas:0:1145:+:      LastLevel := I;
Core/Objects/LoadUnit.pas:480:1151:+:      LastLevel := I;
Core/Objects/LoadUnit.pas:481:1151:+:      LastLevel := I;
Core/Objects/LoadUnit.pas:540:1151:+:      LastLevel := I;
Core/Objects/LoadUnit.pas:980:1151:+:      LastLevel := I;
Core/Objects/LoadUnit.pas:1473:1159:+:      LastLevel := I;
Core/Objects/LoadUnit.pas:2279:1139:+:      LastLevel := I;
Core/Objects/LoadUnit.pas:3341:1182:+:      LastLevel := I;

dejan@dejans /c/DXEProjects/DX
$ hg diff -c 481 Core/Objects/LoadUnit.pas

dejan@dejans /c/DXEProjects/DX
$

Patch

diff -r 10290e819abb -r 5c4a953e9698 Core/Objects/LoadUnit.pas
--- a/Core/Objects/LoadUnit.pas Mon Nov 24 10:58:45 2014 +0100
+++ b/Core/Objects/LoadUnit.pas Mon Nov 24 16:05:30 2014 +0100
@@ -2110,7 +2110,7 @@ 
   InpStream: TStream;
 begin
   InpStream := GetStream('SETUP__');
-  if (InpStream = nil) or IsStreamDeleted(Stream) then
+  if (InpStream = nil) or IsStreamDeleted(InpStream) then
     InpStream := GetStream('SETUP_');
   if InpStream = nil then
     InpStream := GetStream('SETUP');