mercurial/revset.py
changeset 17185 2c7c4824969e
parent 17173 c621f84dbb35
child 17186 a3da6f298592
equal deleted inserted replaced
17184:5fa09a3b0034 17185:2c7c4824969e
   886     """``obsolete()``
   886     """``obsolete()``
   887     Mutable changeset with a newer version."""
   887     Mutable changeset with a newer version."""
   888     getargs(x, 0, 0, _("obsolete takes no arguments"))
   888     getargs(x, 0, 0, _("obsolete takes no arguments"))
   889     return [r for r in subset if repo[r].obsolete()]
   889     return [r for r in subset if repo[r].obsolete()]
   890 
   890 
       
   891 def origin(repo, subset, x):
       
   892     """``origin([set])``
       
   893     Changesets that were specified as a source for the grafts, transplants or
       
   894     rebases that created the given revisions.  Omitting the optional set is the
       
   895     same as passing all().  If a changeset created by these operations is itself
       
   896     specified as a source for one of these operations, only the source changeset
       
   897     for the first operation is selected.
       
   898     """
       
   899     if x is not None:
       
   900         args = set(getset(repo, range(len(repo)), x))
       
   901     else:
       
   902         args = set(getall(repo, range(len(repo)), x))
       
   903 
       
   904     def _firstsrc(rev):
       
   905         src = _getrevsource(repo, rev)
       
   906         if src is None:
       
   907             return None
       
   908 
       
   909         while True:
       
   910             prev = _getrevsource(repo, src)
       
   911 
       
   912             if prev is None:
       
   913                 return src
       
   914             src = prev
       
   915 
       
   916     o = set([_firstsrc(r) for r in args])
       
   917     return [r for r in subset if r in o]
       
   918 
   891 def outgoing(repo, subset, x):
   919 def outgoing(repo, subset, x):
   892     """``outgoing([path])``
   920     """``outgoing([path])``
   893     Changesets not found in the specified destination repository, or the
   921     Changesets not found in the specified destination repository, or the
   894     default push location.
   922     default push location.
   895     """
   923     """
  1390     "max": maxrev,
  1418     "max": maxrev,
  1391     "merge": merge,
  1419     "merge": merge,
  1392     "min": minrev,
  1420     "min": minrev,
  1393     "modifies": modifies,
  1421     "modifies": modifies,
  1394     "obsolete": obsolete,
  1422     "obsolete": obsolete,
       
  1423     "origin": origin,
  1395     "outgoing": outgoing,
  1424     "outgoing": outgoing,
  1396     "p1": p1,
  1425     "p1": p1,
  1397     "p2": p2,
  1426     "p2": p2,
  1398     "parents": parents,
  1427     "parents": parents,
  1399     "present": present,
  1428     "present": present,