bookmarks: introduce a repo._bookmarks.changectx(mark) method and use it
Many places were doing repo[mark], which usually works, but it's
slightly incorrect: if the bookmark has a name that matches a full hex
nodeid of another node, then the context for the other node will be
returned instead. Also, I'm about to remove support for
repo[<namespace thing>] :)
Differential Revision: https://phab.mercurial-scm.org/D3162
#require serve killdaemons
$ hg clone http://localhost:$HGPORT/ copy
abort: * (glob)
[255]
$ test -d copy
[1]
$ $PYTHON "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid
$ cat dumb.pid >> $DAEMON_PIDS
$ hg clone http://localhost:$HGPORT/foo copy2
abort: HTTP Error 404: * (glob)
[255]
$ killdaemons.py