ui.config: fix bug in config alternatives from cc669e4fec95

--HG--
extra : rebase_source : 2ee469954b886e562804b59dee13f54289ff153b
basectx: add an empty class that will be used as a parent of all contexts

At the moment, there is no simple way to check if an object is a context
because there is no common parent class. If there were, we could use
'isinstance' everywhere. Simply having memctx inherit from workingctx or
changectx would allow the use of 'isinstance' but that could lead to some
confusing situations of reading the code since we have three distinct concepts
of a context:

- changectx represents a changeset *already* in the repo, and is therefore immutable
- workingctx represents changes on disk in the working directory
- memctx represents changes solely in memory which may or may not be on disk

Therefore, I propose refactoring context.py to have all three contexts inherit
from a parent class 'basectx'.

--HG--
extra : rebase_source : bbc2f53a34cdb880fd51adc8c4ab334099240073
basectx: return a copied context if changeid is already a basectx

This implements a copy constructor so that we can pass a basectx-derived object
in future refactorings.

--HG--
extra : rebase_source : 10b5505b4c9e0889dc6fcc826a37af8afda0ebf3
changectx: if passing a basectx then exit __init__ immediately

--HG--
extra : rebase_source : d42aa702d41fc526720c18a5a71599870501c2cf
basectx: move __str__ from changectx

--HG--
extra : rebase_source : 1bd7414eae6e417fa7c733660bd77f66e808cea0
basectx: move rev from changectx

--HG--
extra : rebase_source : 3e249ccafec59c485ab0d1dc3298d96a35d0f9ca
basectx: move node from changectx

--HG--
extra : rebase_source : 1c8c04fd7caa83133625538cc7378bfada51a3af
basectx: move hex from changectx

--HG--
extra : rebase_source : a6829c44fe8c44c76a53205eb8462996de4be06c
basectx: change _node to node() in hex

This allows a child class to overload the node() function and still share the
same code for hex().

--HG--
extra : rebase_source : 166f728700d146b45592aec767807b52b689f83f
basectx: move __int__ from changectx

--HG--
extra : rebase_source : 8a87b177bd667f489c8a3198d64d2061e976d4de
basectx: move __repr__ from changectx

We change the hardcoded 'changectx' to instead use type(self).__name__ so that
objects that inherit from basectx in the future will be able to use the same
representation.

--HG--
extra : rebase_source : 1c045327d4c41f0c916b4cebc5dd2cbf73831824
basectx: move __eq__ from changectx

We also add type checking for extra protection.

--HG--
extra : rebase_source : 0125da17a3a9a50d7676e7e0fa1ec392dd2dcfab
basectx: move __ne__ from changectx

--HG--
extra : rebase_source : 0940e8dfb8537ec781ed3ee53aa1faf005495d3e
basectx: move substate from changectx

--HG--
extra : rebase_source : 6679b98b86deac154ce43733339b494e9dda9c3a
basectx: move __contains__ from changectx

--HG--
extra : rebase_source : d0410827ff346a3d0dcd58de3552541707b938f6
basectx: move __getitem__ from changectx

--HG--
extra : rebase_source : 6f8bce7d8b29768759d0c486f5e5b30b071a210c
basectx: move __iter__ from changectx

--HG--
extra : rebase_source : a794094708bda4f37044891973bc6a0cde05a9d9
basectx: move manifest from changectx

--HG--
extra : rebase_source : d557267065af9824c86703e0f290713bcd030bc6
basectx: move phasestr from changectx

--HG--
extra : rebase_source : cff9cb2e46cab68469b8c63bf7779b24abc8a9a0
basectx: move mutable from changectx

--HG--
extra : rebase_source : 960ba4c2412eae65d17f59640bad5508e20d0b80