Patchwork [1,of,3] obsutil: make sure "addedrevs" is not None in getobsoleted()

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 25, 2018, 9:46 a.m.
Message ID <21d6316839fbd3acd6da.1535190363@mimosa>
Download mbox | patch
Permalink /patch/34042/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 25, 2018, 9:46 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# 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.

Patch

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: