mercurial/sparse.py
changeset 41676 0531dff73d0b
parent 41675 ddbebce94665
child 41759 aaad36b88298
equal deleted inserted replaced
41675:ddbebce94665 41676:0531dff73d0b
   275 
   275 
   276     ``includetemp`` indicates whether to use the temporary sparse profile.
   276     ``includetemp`` indicates whether to use the temporary sparse profile.
   277     """
   277     """
   278     # If sparse isn't enabled, sparse matcher matches everything.
   278     # If sparse isn't enabled, sparse matcher matches everything.
   279     if not enabled:
   279     if not enabled:
   280         return matchmod.always(repo.root, '')
   280         return matchmod.always()
   281 
   281 
   282     if not revs or revs == [None]:
   282     if not revs or revs == [None]:
   283         revs = [repo.changelog.rev(node)
   283         revs = [repo.changelog.rev(node)
   284                 for node in repo.dirstate.parents() if node != nullid]
   284                 for node in repo.dirstate.parents() if node != nullid]
   285 
   285 
   303                 matchers.append(matcher)
   303                 matchers.append(matcher)
   304         except IOError:
   304         except IOError:
   305             pass
   305             pass
   306 
   306 
   307     if not matchers:
   307     if not matchers:
   308         result = matchmod.always(repo.root, '')
   308         result = matchmod.always()
   309     elif len(matchers) == 1:
   309     elif len(matchers) == 1:
   310         result = matchers[0]
   310         result = matchers[0]
   311     else:
   311     else:
   312         result = matchmod.unionmatcher(matchers)
   312         result = matchmod.unionmatcher(matchers)
   313 
   313