# HG changeset patch # User Yuya Nishihara # Date 1470484013 -32400 # Node ID 98976e3cae57506be5401884c5fe83033425070f # Parent 9c51a5de76dbd5ccc46abbf3ee7082eb71b1b581 revpair: do not optimize tree to check for odd-range spec At cc3a30ff9490, we had to optimize a parsed tree to resolve x^:y ambiguity. Since we've moved the resolution of x^:y to parse(), we no longer have to call optimize(). Therefore, (x:y) can be taken as a single expression, not an odd range expression x:y. diff -r 9c51a5de76db -r 98976e3cae57 mercurial/scmutil.py --- a/mercurial/scmutil.py Sat Aug 06 20:37:48 2016 +0900 +++ b/mercurial/scmutil.py Sat Aug 06 20:46:53 2016 +0900 @@ -781,7 +781,6 @@ def _pairspec(revspec): tree = revset.parse(revspec) - tree = revset.optimize(tree) # fix up "x^:y" -> "(x^):y" return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall') def revpair(repo, revs): diff -r 9c51a5de76db -r 98976e3cae57 tests/test-diff-change.t --- a/tests/test-diff-change.t Sat Aug 06 20:37:48 2016 +0900 +++ b/tests/test-diff-change.t Sat Aug 06 20:46:53 2016 +0900 @@ -50,6 +50,13 @@ @@ -1,1 +1,1 @@ -third +wdir + $ hg diff -r '(2:2)' --nodates + diff -r bf5ff72eb7e0 file.txt + --- a/file.txt + +++ b/file.txt + @@ -1,1 +1,1 @@ + -third + +wdir $ hg diff -r 2::2 --nodates diff -r bf5ff72eb7e0 file.txt --- a/file.txt