From patchwork Sat Aug 25 09:46:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 3] obsutil: make sure "addedrevs" is not None in getobsoleted() From: Yuya Nishihara X-Patchwork-Id: 34042 Message-Id: <21d6316839fbd3acd6da.1535190363@mimosa> To: mercurial-devel@mercurial-scm.org Date: Sat, 25 Aug 2018 18:46:03 +0900 # HG changeset patch # User Yuya Nishihara # Date 1535177983 -32400 # Sat Aug 25 15:19:43 2018 +0900 # Node ID 21d6316839fbd3acd6da8c061329a01490135f2c # Parent f98d3c57906fd31a3068446a5448a655cc22f108 obsutil: make sure "addedrevs" is not None in getobsoleted() If it were None, "rev in addedrevs" would crash. So tr.changes["revs"] should be a mandatory parameter here. diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py --- a/mercurial/obsutil.py +++ b/mercurial/obsutil.py @@ -465,7 +465,7 @@ def getobsoleted(repo, tr): succsmarkers = repo.obsstore.successors.get public = phases.public addedmarkers = tr.changes.get('obsmarkers') - addedrevs = tr.changes.get('revs') + addedrevs = tr.changes['revs'] seenrevs = set() obsoleted = set() for mark in addedmarkers: