$ cat >> $HGRCPATH <<EOF
> [web]
> push_ssl = false
> allow_push = *
> [extensions]
> hgext.rebase=
> hgext.mq=
> EOF
$ echo "states=$(echo $(dirname $TESTDIR))/hgext/states.py" >> $HGRCPATH
init stuff
$ hg init local
$ cd local
$ echo "celestine" > babar
$ hg add babar
$ hg ci -m "add babar"
$ echo "la veille dame" > babar
$ hg ci -m "add dame"
$ hg up 0 -q
$ echo "Rataxes" > rhino
$ hg add rhino
$ hg ci -m "add rhino"
created new head
$ hg published 1 2
$ hg up 1 -q
$ hg states draft
$ echo "avion" > vehicule
$ hg add vehicule
$ hg ci -m "add some plane"
$ hg log --template='{rev}:{node|short}: {state}\n'
3:4ee052f12c59: draft
2:5468aa9f5c63: published
1:710fe444b3b0: published
0:5caa672bac26: published
test you can't qimport published changeset
$ hg qimport -r 1
abort: can not qimport published changeset 710fe444b3b0
(see `hg help --extension states` for details)
[255]
but other are ok
$ hg qimport -r 3
$ hg qfinish -a
test you can't rebase published changeset
$ hg rebase --dest 2 -b 1
abort: can not rebase published changeset 710fe444b3b0
(see `hg help --extension states` for details)
[255]
test you still can rebase other one
$ hg rebase --dest 2 -s 3 --detach
saved backup bundle to $TESTTMP/local/.hg/strip-backup/4ee052f12c59-backup.hg
$ hg rebase --dest 1 -s 3
saved backup bundle to $TESTTMP/local/.hg/strip-backup/f708bc50a098-backup.hg