comparison tests/test-extdiff.t @ 26836:88c4e97b9669 stable

scmutil: abort if an empty revision is given to revpair() When using 'extdiff --patch' to check the changes in a rebase, 'precursors(x)' evaluated to an empty set because I forgot the --hidden flag, so the other revision was used as the replacement for the empty set. The result was the patch for the other revision was diffed against itself, and the tool saying there were no differences. That's misleading since the expected diff args were silently changed, so it's better to bail out. The other uses of scmutil.revpair() are commands.diff and commands.status, and it doesn't make sense to allow an empty revision there either. The code here was suggested by Yuya Nishihara.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 31 Oct 2015 21:45:46 -0400
parents 0fd20a71abdb
children 0945539a3a6b
comparison
equal deleted inserted replaced
26835:6fabc9317b78 26836:88c4e97b9669
67 #else 67 #else
68 $ hg falabala -r 0:1 68 $ hg falabala -r 0:1
69 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) 69 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
70 [1] 70 [1]
71 #endif 71 #endif
72
73 Specifying an empty revision should abort.
74
75 $ hg extdiff --patch --rev 'ancestor()' --rev 1
76 abort: empty revision on one side of range
77 [255]
72 78
73 Test diff during merge: 79 Test diff during merge:
74 80
75 $ hg update -C 0 81 $ hg update -C 0
76 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved