diff options
Diffstat (limited to 'app/History')
-rw-r--r-- | app/History/CommitInfo.hs | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/app/History/CommitInfo.hs b/app/History/CommitInfo.hs index 94e2f96..3c371d1 100644 --- a/app/History/CommitInfo.hs +++ b/app/History/CommitInfo.hs @@ -46,18 +46,13 @@ fromPartialCommitInfos (partialCommitInfo : partialCommitInfos) = Just new { provenance = - ( \oldProvenance newProvenance -> - ( I.Provenance - { first = oldProvenance.first, - last = - if clear old /= clear new - then newProvenance.last - else oldProvenance.last - } - ) - ) - <$> old.provenance - <*> new.provenance + I.Provenance + { first = old.provenance.first, + last = + if ((/=) `on` (.rawText)) old new + then new.provenance.last + else old.provenance.last + } } ) ( \old -> @@ -85,7 +80,7 @@ diffCommitInfos oldInfo newInfo = [ [IssueCreated newHash issue | issue <- deleteFirstsBy eq newIssues oldIssues], [ IssueChanged newHash (last issues) | issues <- intersectBy' eq newIssues oldIssues, - not (null [(x, y) | x <- issues, y <- issues, clear x /= clear y]) + not (null [(x, y) | x <- issues, y <- issues, ((/=) `on` (.rawText)) x y]) ], [IssueDeleted newHash issue | issue <- deleteFirstsBy eq oldIssues newIssues] ] @@ -96,19 +91,6 @@ diffCommitInfos oldInfo newInfo = eq = (==) `on` id --- TODO Fix issue comparison --- --- Because issues carry `provenance` issues compare unequally when we want --- them to be equal. -clear :: Issue -> Issue -clear i = - i - { provenance = Nothing, - start = Position 0 0, - end = Position 0 0, - file = "" - } - mergeListsBy :: (a -> a -> Bool) -> (a -> a -> b) -> (a -> b) -> (a -> b) -> [a] -> [a] -> [b] mergeListsBy eq onBoth onLeft onRight lefts rights = concat |