# HG changeset patch # User Boris Feld # Date 1534386034 -7200 # Node ID 6f4b8f607a311a9bf2129753b738be9430515fe3 # Parent fd0150a3c2fedaa63fb40a48797772f43d2507d6 revlogdeltas: move special cases around raw revisions in finddeltainfo The method already contains logic for no-diff cases. Having everything in the same place is more consistent and unlocks other code improvements. diff -r fd0150a3c2fe -r 6f4b8f607a31 mercurial/revlog.py --- a/mercurial/revlog.py Wed Aug 29 09:41:04 2018 -0700 +++ b/mercurial/revlog.py Thu Aug 16 04:20:34 2018 +0200 @@ -1965,13 +1965,7 @@ revinfo = _revisioninfo(node, p1, p2, btext, textlen, cachedelta, flags) - # no delta for flag processor revision (see "candelta" for why) - # not calling candelta since only one revision needs test, also to - # avoid overhead fetching flags again. - if flags & REVIDX_RAWTEXT_CHANGING_FLAGS: - deltainfo = None - else: - deltainfo = deltacomputer.finddeltainfo(revinfo, fh) + deltainfo = deltacomputer.finddeltainfo(revinfo, fh) if deltainfo is not None: base = deltainfo.base diff -r fd0150a3c2fe -r 6f4b8f607a31 mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py Wed Aug 29 09:41:04 2018 -0700 +++ b/mercurial/revlogutils/deltas.py Thu Aug 16 04:20:34 2018 +0200 @@ -703,6 +703,12 @@ if not revinfo.textlen: return None # empty file do not need delta + # no delta for flag processor revision (see "candelta" for why) + # not calling candelta since only one revision needs test, also to + # avoid overhead fetching flags again. + if revinfo.flags & REVIDX_RAWTEXT_CHANGING_FLAGS: + return None + cachedelta = revinfo.cachedelta p1 = revinfo.p1 p2 = revinfo.p2