mercurial/scmutil.py
changeset 31024 0b8356705de6
parent 30639 d524c88511a7
child 31025 6cf2857526c7
equal deleted inserted replaced
31023:aea06029919e 31024:0b8356705de6
    28     osutil,
    28     osutil,
    29     pathutil,
    29     pathutil,
    30     phases,
    30     phases,
    31     pycompat,
    31     pycompat,
    32     revset,
    32     revset,
       
    33     revsetlang,
    33     similar,
    34     similar,
    34     util,
    35     util,
    35 )
    36 )
    36 
    37 
    37 if pycompat.osname == 'nt':
    38 if pycompat.osname == 'nt':
   888     if not l:
   889     if not l:
   889         raise error.Abort(_('empty revision set'))
   890         raise error.Abort(_('empty revision set'))
   890     return repo[l.last()]
   891     return repo[l.last()]
   891 
   892 
   892 def _pairspec(revspec):
   893 def _pairspec(revspec):
   893     tree = revset.parse(revspec)
   894     tree = revsetlang.parse(revspec)
   894     return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall')
   895     return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall')
   895 
   896 
   896 def revpair(repo, revs):
   897 def revpair(repo, revs):
   897     if not revs:
   898     if not revs:
   898         return repo.dirstate.p1(), None
   899         return repo.dirstate.p1(), None
   934 
   935 
   935     ``specs`` can contain integers, in which case they are assumed to be
   936     ``specs`` can contain integers, in which case they are assumed to be
   936     revision numbers.
   937     revision numbers.
   937 
   938 
   938     It is assumed the revsets are already formatted. If you have arguments
   939     It is assumed the revsets are already formatted. If you have arguments
   939     that need to be expanded in the revset, call ``revset.formatspec()``
   940     that need to be expanded in the revset, call ``revsetlang.formatspec()``
   940     and pass the result as an element of ``specs``.
   941     and pass the result as an element of ``specs``.
   941 
   942 
   942     Specifying a single revset is allowed.
   943     Specifying a single revset is allowed.
   943 
   944 
   944     Returns a ``revset.abstractsmartset`` which is a list-like interface over
   945     Returns a ``revset.abstractsmartset`` which is a list-like interface over
   945     integer revisions.
   946     integer revisions.
   946     """
   947     """
   947     allspecs = []
   948     allspecs = []
   948     for spec in specs:
   949     for spec in specs:
   949         if isinstance(spec, int):
   950         if isinstance(spec, int):
   950             spec = revset.formatspec('rev(%d)', spec)
   951             spec = revsetlang.formatspec('rev(%d)', spec)
   951         allspecs.append(spec)
   952         allspecs.append(spec)
   952     m = revset.matchany(repo.ui, allspecs, repo)
   953     m = revset.matchany(repo.ui, allspecs, repo)
   953     return m(repo)
   954     return m(repo)
   954 
   955 
   955 def meaningfulparents(repo, ctx):
   956 def meaningfulparents(repo, ctx):