ui.py: untangle updateopts
The code in ui.updateopts that handles ui.quiet, ui.verbose and
ui.debugflag is too smart, making it somewhat hard to see what
are the exact constraints placed on the values of these variables,
hiding some buglets.
This patch makes these constraints more explicit, fixing these
buglets and changing the behaviour slightly. It also adds a test
to make sure things work as expected in the future.
The buglets:
- setting ui.debug = True in a hgrc wouldn't turn on verbose mode
- additionally, setting ui.quiet = True or using --quiet would give
you a "quiet debug" mode.
The behaviour change:
- previously, in a hgrc file, ui.quiet wins against ui.verbose (i.e.
the final result would be quiet mode), but --verbose wins against
--quiet
- now ui.quiet nullifies ui.verbose and --verbose nullifies --quiet.
As a consequence, using -qv always gives you normal mode (unless
debug mode was turned on somewhere)
adding a
0: a
hg: unknown command 'an'
Mercurial Distributed SCM
basic commands (use "hg help" for the full list or option "-v" for details):
add add the specified files on the next commit
annotate show changeset information per file line
clone make a copy of an existing repository
commit commit the specified files or all outstanding changes
diff diff repository (or selected files)
export dump the header and diffs for one or more changesets
init create a new repository in the given directory
log show revision history of entire repository or files
parents show the parents of the working dir or revision
pull pull changes from the specified source
push push changes to the specified destination
remove remove the specified files on the next commit
revert revert files or dirs to their states as of some revision
serve export the repository via HTTP
status show changed files in the working directory
update update or merge working directory
0: a
% should succeed - up is an alias, not an abbreviation
0 files updated, 0 files merged, 0 files removed, 0 files unresolved