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): |