mercurial/discovery.py
changeset 29804 7b9157aa752f
parent 29690 5684bc429e6a
child 29805 f09d0004481c
equal deleted inserted replaced
29803:dab7069fc2bd 29804:7b9157aa752f
    74       commonheads is the list of heads of common.
    74       commonheads is the list of heads of common.
    75 
    75 
    76     The sets are computed on demand from the heads, unless provided upfront
    76     The sets are computed on demand from the heads, unless provided upfront
    77     by discovery.'''
    77     by discovery.'''
    78 
    78 
    79     def __init__(self, revlog, commonheads, missingheads):
    79     def __init__(self, repo, commonheads, missingheads):
    80         self.commonheads = commonheads
    80         self.commonheads = commonheads
    81         self.missingheads = missingheads
    81         self.missingheads = missingheads
    82         self._revlog = revlog
    82         self._revlog = repo.changelog
    83         self._common = None
    83         self._common = None
    84         self._missing = None
    84         self._missing = None
    85         self.excluded = []
    85         self.excluded = []
    86 
    86 
    87     def _computecommonmissing(self):
    87     def _computecommonmissing(self):
   118     # TODO populate attributes on outgoing instance instead of setting
   118     # TODO populate attributes on outgoing instance instead of setting
   119     # discbases.
   119     # discbases.
   120     csets, roots, heads = cl.nodesbetween(roots, heads)
   120     csets, roots, heads = cl.nodesbetween(roots, heads)
   121     included = set(csets)
   121     included = set(csets)
   122     discbases = [n for n in discbases if n not in included]
   122     discbases = [n for n in discbases if n not in included]
   123     return outgoing(cl, discbases, heads)
   123     return outgoing(repo, discbases, heads)
   124 
   124 
   125 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
   125 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
   126                        commoninc=None, portable=False):
   126                        commoninc=None, portable=False):
   127     '''Return an outgoing instance to identify the nodes present in repo but
   127     '''Return an outgoing instance to identify the nodes present in repo but
   128     not in other.
   128     not in other.
   135     findcommonincoming(repo, other, force) to avoid recomputing it here.
   135     findcommonincoming(repo, other, force) to avoid recomputing it here.
   136 
   136 
   137     If portable is given, compute more conservative common and missingheads,
   137     If portable is given, compute more conservative common and missingheads,
   138     to make bundles created from the instance more portable.'''
   138     to make bundles created from the instance more portable.'''
   139     # declare an empty outgoing object to be filled later
   139     # declare an empty outgoing object to be filled later
   140     og = outgoing(repo.changelog, None, None)
   140     og = outgoing(repo, None, None)
   141 
   141 
   142     # get common set if not provided
   142     # get common set if not provided
   143     if commoninc is None:
   143     if commoninc is None:
   144         commoninc = findcommonincoming(repo, other, force=force)
   144         commoninc = findcommonincoming(repo, other, force=force)
   145     og.commonheads, _any, _hds = commoninc
   145     og.commonheads, _any, _hds = commoninc