comparison tests/test-revset.t @ 42264:6bc1245cd598

revset: populate wdir() by its hash or revision number It belongs to the same category as the null hash/revision, and we do handle these virtual identifiers in id()/rev() predicates. Let's do that more consistently.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 30 Apr 2019 15:15:57 +0900
parents c70bdd222dcd
children 838f3a094b4f
comparison
equal deleted inserted replaced
42262:a0c5e06e9b1a 42264:6bc1245cd598
1954 2147483647 1954 2147483647
1955 $ log 'last(. + wdir())' 1955 $ log 'last(. + wdir())'
1956 2147483647 1956 2147483647
1957 1957
1958 Test working-directory integer revision and node id 1958 Test working-directory integer revision and node id
1959 (BUG: '0:wdir()' is still needed to populate wdir revision) 1959
1960 1960 $ hg debugrevspec '2147483647'
1961 $ hg debugrevspec '0:wdir() & 2147483647'
1962 2147483647 1961 2147483647
1963 $ hg debugrevspec '0:wdir() & rev(2147483647)' 1962 $ hg debugrevspec 'rev(2147483647)'
1964 2147483647 1963 2147483647
1965 $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff' 1964 $ hg debugrevspec 'ffffffffffffffffffffffffffffffffffffffff'
1966 2147483647 1965 2147483647
1967 $ hg debugrevspec '0:wdir() & ffffffffffff' 1966 $ hg debugrevspec 'ffffffffffff'
1968 2147483647 1967 2147483647
1969 $ hg debugrevspec '0:wdir() & id(ffffffffffffffffffffffffffffffffffffffff)' 1968 $ hg debugrevspec 'id(ffffffffffffffffffffffffffffffffffffffff)'
1970 2147483647 1969 2147483647
1971 $ hg debugrevspec '0:wdir() & id(ffffffffffff)' 1970 $ hg debugrevspec 'id(ffffffffffff)'
1972 2147483647 1971 2147483647
1972 $ hg debugrevspec 'ffffffffffff+000000000000'
1973 2147483647
1974 -1
1973 1975
1974 $ cd .. 1976 $ cd ..
1975 1977
1976 Test short 'ff...' hash collision 1978 Test short 'ff...' hash collision
1977 (BUG: '0:wdir()' is still needed to populate wdir revision)
1978 1979
1979 $ hg init wdir-hashcollision 1980 $ hg init wdir-hashcollision
1980 $ cd wdir-hashcollision 1981 $ cd wdir-hashcollision
1981 $ cat <<EOF >> .hg/hgrc 1982 $ cat <<EOF >> .hg/hgrc
1982 > [experimental] 1983 > [experimental]
1998 4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8 1999 4:ffff85cff0ff78504fcdc3c0bc10de0c65379249 ffff8
1999 2147483647:ffffffffffffffffffffffffffffffffffffffff fffff 2000 2147483647:ffffffffffffffffffffffffffffffffffffffff fffff
2000 $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571 2001 $ hg debugobsolete fffbae3886c8fbb2114296380d276fd37715d571
2001 obsoleted 1 changesets 2002 obsoleted 1 changesets
2002 2003
2003 $ hg debugrevspec '0:wdir() & fff' 2004 $ hg debugrevspec 'fff'
2004 abort: 00changelog.i@fff: ambiguous identifier! 2005 abort: 00changelog.i@fff: ambiguous identifier!
2005 [255] 2006 [255]
2006 $ hg debugrevspec '0:wdir() & ffff' 2007 $ hg debugrevspec 'ffff'
2007 abort: 00changelog.i@ffff: ambiguous identifier! 2008 abort: 00changelog.i@ffff: ambiguous identifier!
2008 [255] 2009 [255]
2009 $ hg debugrevspec '0:wdir() & fffb' 2010 $ hg debugrevspec 'fffb'
2010 abort: 00changelog.i@fffb: ambiguous identifier! 2011 abort: 00changelog.i@fffb: ambiguous identifier!
2011 [255] 2012 [255]
2012 BROKEN should be '2' (node lookup uses unfiltered repo) 2013 BROKEN should be '2' (node lookup uses unfiltered repo)
2013 $ hg debugrevspec '0:wdir() & id(fffb)' 2014 $ hg debugrevspec 'id(fffb)'
2014 BROKEN should be '2' (node lookup uses unfiltered repo) 2015 BROKEN should be '2' (node lookup uses unfiltered repo)
2015 $ hg debugrevspec '0:wdir() & ffff8' 2016 $ hg debugrevspec 'ffff8'
2016 4 2017 4
2017 $ hg debugrevspec '0:wdir() & fffff' 2018 $ hg debugrevspec 'fffff'
2018 2147483647 2019 2147483647
2019 2020
2020 $ cd .. 2021 $ cd ..
2021 2022
2022 Test branch() with wdir() 2023 Test branch() with wdir()