# HG changeset patch # User Pierre-Yves David # Date 2016-08-09 13:55:44 # Node ID f09d0004481cc1c9a5ae1da87eb93834f2cc7918 # Parent 7b9157aa752fae38de54eac40e67575ee1a1204b outgoing: adds some default value for argument We are about to introduce a third option to create an outgoing object: 'missingroots'. This argument will be mutually exclusive with 'commonheads' so we implement some default value handling in preparation. This will also help use to make more use of outgoing creation around the code base. diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -76,10 +76,15 @@ class outgoing(object): The sets are computed on demand from the heads, unless provided upfront by discovery.''' - def __init__(self, repo, commonheads, missingheads): + def __init__(self, repo, commonheads=None, missingheads=None): + cl = repo.changelog + if not missingheads: + missingheads = cl.heads() + if not commonheads: + commonheads = [nullid] self.commonheads = commonheads self.missingheads = missingheads - self._revlog = repo.changelog + self._revlog = cl self._common = None self._missing = None self.excluded = []