diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -62,7 +62,10 @@ class match(object): pats = _normalize(exclude, 'glob', root, cwd, auditor) self.excludepat, em = _buildmatch(ctx, pats, '(?:/|$)') if exact: - self._files = patterns + if isinstance(patterns, list): + self._files = patterns + else: + self._files = list(patterns) pm = self.exact elif patterns: pats = _normalize(patterns, default, root, cwd, auditor) diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -525,9 +525,11 @@ def revpair(repo, revs): l = revrange(repo, revs) if len(l) == 0: + if revs: + raise util.Abort(_('empty revision range')) return repo.dirstate.p1(), None - if len(l) == 1: + if len(l) == 1 and len(revs) == 1 and _revrangesep not in revs[0]: return repo.lookup(l[0]), None return repo.lookup(l[0]), repo.lookup(l[-1]) diff --git a/tests/test-diff-change.t b/tests/test-diff-change.t --- a/tests/test-diff-change.t +++ b/tests/test-diff-change.t @@ -29,6 +29,12 @@ Testing diff --change -first +second +Test dumb revspecs (issue3474) + + $ hg diff -r 2:2 + $ hg diff -r "2 and 1" + abort: empty revision range + [255] Testing diff --change when merge: