2141 revs.reverse() |
2141 revs.reverse() |
2142 matcher = revset.match(repo.ui, expr) |
2142 matcher = revset.match(repo.ui, expr) |
2143 # Revset matches can reorder revisions. "A or B" typically returns |
2143 # Revset matches can reorder revisions. "A or B" typically returns |
2144 # returns the revision matching A then the revision matching B. Sort |
2144 # returns the revision matching A then the revision matching B. Sort |
2145 # again to fix that. |
2145 # again to fix that. |
|
2146 fixopts = ['branch', 'only_branch', 'keyword', 'user'] |
|
2147 oldrevs = revs |
2146 revs = matcher(repo, revs) |
2148 revs = matcher(repo, revs) |
2147 if not opts.get('rev'): |
2149 if not opts.get('rev'): |
2148 revs.sort(reverse=True) |
2150 revs.sort(reverse=True) |
|
2151 elif len(pats) > 1 or any(len(opts.get(op, [])) > 1 for op in fixopts): |
|
2152 # XXX "A or B" is known to change the order; fix it by filtering |
|
2153 # matched set again (issue5100) |
|
2154 revs = oldrevs & revs |
2149 if limit is not None: |
2155 if limit is not None: |
2150 limitedrevs = [] |
2156 limitedrevs = [] |
2151 for idx, r in enumerate(revs): |
2157 for idx, r in enumerate(revs): |
2152 if limit <= idx: |
2158 if limit <= idx: |
2153 break |
2159 break |