comparison mercurial/cmdutil.py @ 29960:fa5e4f58dfbc

log: drop hack to fix order of revset (issue5100) Specify ordered=revset.followorder instead. This patch effectively backs out c407583cf5f6. revs.sort(reverse=True) is replaced by revs.reverse() because the matcher should no longer reorder revisions.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 03 May 2016 14:24:00 +0900
parents 2cec6eaf3610
children e824de573112
comparison
equal deleted inserted replaced
29959:1b5931604a5a 29960:fa5e4f58dfbc
2187 if expr: 2187 if expr:
2188 # Revset matchers often operate faster on revisions in changelog 2188 # Revset matchers often operate faster on revisions in changelog
2189 # order, because most filters deal with the changelog. 2189 # order, because most filters deal with the changelog.
2190 if not opts.get('rev'): 2190 if not opts.get('rev'):
2191 revs.reverse() 2191 revs.reverse()
2192 matcher = revset.match(repo.ui, expr) 2192 matcher = revset.match(repo.ui, expr, order=revset.followorder)
2193 # Revset matches can reorder revisions. "A or B" typically returns
2194 # returns the revision matching A then the revision matching B. Sort
2195 # again to fix that.
2196 fixopts = ['branch', 'only_branch', 'keyword', 'user']
2197 oldrevs = revs
2198 revs = matcher(repo, revs) 2193 revs = matcher(repo, revs)
2199 if not opts.get('rev'): 2194 if not opts.get('rev'):
2200 revs.sort(reverse=True) 2195 revs.reverse()
2201 elif len(pats) > 1 or any(len(opts.get(op, [])) > 1 for op in fixopts):
2202 # XXX "A or B" is known to change the order; fix it by filtering
2203 # matched set again (issue5100)
2204 revs = oldrevs & revs
2205 if limit is not None: 2196 if limit is not None:
2206 limitedrevs = [] 2197 limitedrevs = []
2207 for idx, r in enumerate(revs): 2198 for idx, r in enumerate(revs):
2208 if limit <= idx: 2199 if limit <= idx:
2209 break 2200 break