# HG changeset patch # User Pierre-Yves David # Date 2015-12-02 00:22:49 # Node ID b481bf14992d50bfa67d6fefe8adb6ad1a4c1c88 # Parent 5ebc4a192550df213816c3235d9b1dbf1a338609 addrevision: handle code path not producing delta We would like to be able to exit the delta generation block without a valid delta (for a more flexible control flow). So we make sure we do not expand the "delta" content unless we actually have a delta. We can do it one level lower because 'delta' is initialised at None anyway. Not adding a level to the assignment prevent a line length issue. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1459,6 +1459,7 @@ class revlog(object): delta = builddelta(prev) else: delta = builddelta(prev) + if delta is not None: dist, l, data, base, chainbase, chainlen, compresseddeltalen = delta if not self._isgooddelta(delta, textlen):