HomePhabricator

grep: fix hash(linestate) to not include linenum

Authored by yuja.

Description

grep: fix hash(linestate) to not include linenum

linestate.eq() just compares the line values whereas hash() does
hash both self.line and self.linenum, which violates the rule. hash()
was added at fb502719c75c, "python 2.6 compatibility: add hash to
classes that have eq" with no additional remarks, so this would probably
be a simple mistake.

The test output changed because difflib.SequenceMatcher() internally uses
a dict. As you can see, the line "export" is unchanged at the revision 2,
so the new output is correct.

Details

Committed
yujaTue, Sep 8, 10:41 PM
Parents
rHG038aaad433a7: test-grep: document that trivially moved lines might not be detected
Branches
Unknown
Tags
Unknown