# HG changeset patch # User Anton Shestakov # Date 1551879752 -28800 # Node ID 461b9a91b662f532444d34bab1e6c0ed8f32e53c # Parent e10ebc58926e8ce723c131b1431612db686241c2 obshistory: remove unused geteffectflag(), it's been in core since 4.4 diff -r e10ebc58926e -r 461b9a91b662 hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Wed Mar 06 16:56:25 2019 +0800 +++ b/hgext3rd/evolve/obshistory.py Wed Mar 06 21:42:32 2019 +0800 @@ -780,46 +780,6 @@ return True -def geteffectflag(relation): - """compute the effect flag by comparing the source and destination""" - effects = 0 - - source = relation[0] - - for changectx in relation[1]: - # Check if description has changed - if changectx.description() != source.description(): - effects |= DESCCHANGED - - # Check if known meta has changed - if changectx.user() != source.user(): - effects |= USERCHANGED - - if changectx.date() != source.date(): - effects |= DATECHANGED - - if changectx.branch() != source.branch(): - effects |= BRANCHCHANGED - - # Check if other meta has changed - changeextra = changectx.extra().items() - ctxmeta = filter(ismetablacklisted, changeextra) - - sourceextra = source.extra().items() - srcmeta = filter(ismetablacklisted, sourceextra) - - if ctxmeta != srcmeta: - effects |= METACHANGED - - # Check if at least one of the parent has changes - if changectx.parents() != source.parents(): - effects |= PARENTCHANGED - - if not _cmpdiff(source, changectx): - effects |= DIFFCHANGED - - return effects - def _prepare_hunk(hunk): """Drop all information but the username and patch""" cleanunk = [] @@ -838,28 +798,6 @@ return None return _prepare_hunk(lines) -def _cmpdiff(leftctx, rightctx): - """return True if both ctx introduce the "same diff" - - This is a first and basic implementation, with many shortcoming. - """ - - # Leftctx or right ctx might be filtered, so we need to use the contexts - # with an unfiltered repository to safely compute the diff - leftunfi = leftctx._repo.unfiltered()[leftctx.rev()] - leftdiff = leftunfi.diff(git=1) - rightunfi = rightctx._repo.unfiltered()[rightctx.rev()] - rightdiff = rightunfi.diff(git=1) - - left, right = (0, 0) - while None not in (left, right): - left = _getdifflines(leftdiff) - right = _getdifflines(rightdiff) - - if left != right: - return False - return True - def _getobsfate(successorssets): """ Compute a changeset obsolescence fate based on his successorssets. Successors can be the tipmost ones or the immediate ones.