mercurial/discovery.py
changeset 51595 3a6fae3bef35
parent 51594 e3a5ec2d236a
equal deleted inserted replaced
51594:e3a5ec2d236a 51595:3a6fae3bef35
   102         # at most one of them must not be set
   102         # at most one of them must not be set
   103         if commonheads is not None and missingroots is not None:
   103         if commonheads is not None and missingroots is not None:
   104             m = 'commonheads and missingroots arguments are mutually exclusive'
   104             m = 'commonheads and missingroots arguments are mutually exclusive'
   105             raise error.ProgrammingError(m)
   105             raise error.ProgrammingError(m)
   106         cl = repo.changelog
   106         cl = repo.changelog
       
   107         unfi = repo.unfiltered()
       
   108         ucl = unfi.changelog
       
   109         to_node = ucl.node
   107         missing = None
   110         missing = None
   108         common = None
   111         common = None
       
   112         arg_anc = ancestorsof
   109         if ancestorsof is None:
   113         if ancestorsof is None:
   110             ancestorsof = cl.heads()
   114             ancestorsof = cl.heads()
   111         if missingroots:
   115 
       
   116         # XXX-perf: do we need all this to be node-list? They would be simpler
       
   117         # as rev-num sets (and smartset)
       
   118         if missingroots == [nodemod.nullrev] or missingroots == []:
       
   119             commonheads = [repo.nullid]
       
   120             common = set()
       
   121             if arg_anc is None:
       
   122                 missing = [to_node(r) for r in cl]
       
   123             else:
       
   124                 missing_rev = repo.revs('::%ln', missingroots, ancestorsof)
       
   125                 missing = [to_node(r) for r in missing_rev]
       
   126         elif missingroots is not None:
   112             # TODO remove call to nodesbetween.
   127             # TODO remove call to nodesbetween.
   113             missing_rev = repo.revs('%ln::%ln', missingroots, ancestorsof)
   128             missing_rev = repo.revs('%ln::%ln', missingroots, ancestorsof)
   114             unfi = repo.unfiltered()
       
   115             ucl = unfi.changelog
       
   116             to_node = ucl.node
       
   117             ancestorsof = [to_node(r) for r in ucl.headrevs(missing_rev)]
   129             ancestorsof = [to_node(r) for r in ucl.headrevs(missing_rev)]
   118             parent_revs = ucl.parentrevs
   130             parent_revs = ucl.parentrevs
   119             common_legs = set()
   131             common_legs = set()
   120             for r in missing_rev:
   132             for r in missing_rev:
   121                 p1, p2 = parent_revs(r)
   133                 p1, p2 = parent_revs(r)