diff -r 0fe00bdb2f4f -r c7f89ad87bae mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat Feb 27 21:29:42 2016 -0800 +++ b/mercurial/cmdutil.py Mon Feb 29 17:52:17 2016 -0600 @@ -2143,9 +2143,15 @@ # Revset matches can reorder revisions. "A or B" typically returns # returns the revision matching A then the revision matching B. Sort # again to fix that. + fixopts = ['branch', 'only_branch', 'keyword', 'user'] + oldrevs = revs revs = matcher(repo, revs) if not opts.get('rev'): revs.sort(reverse=True) + elif len(pats) > 1 or any(len(opts.get(op, [])) > 1 for op in fixopts): + # XXX "A or B" is known to change the order; fix it by filtering + # matched set again (issue5100) + revs = oldrevs & revs if limit is not None: limitedrevs = [] for idx, r in enumerate(revs):