Commit Graph

28 Commits

Author SHA1 Message Date
Augie Fackler
bd7aa248d4 fancyopts: restore use of callable() since it was readded in Python 3.2 2014-06-23 09:24:16 -04:00
Augie Fackler
9f876f6c89 cleanup: move stdlib imports to their own import statement
There are a few warnings still produced by my import checker, but
those are false positives produced by modules that share a name with
stdlib modules.
2013-11-06 16:48:06 -05:00
Idan Kamara
4d2c787f1d fancyopts: don't show a traceback on invalid integer values 2012-10-08 15:35:16 +02:00
Augie Fackler
fdd2f9d735 globally: use safehasattr(x, '__call__') instead of hasattr(x, '__call__') 2011-07-25 16:24:37 -05:00
FUJIWARA Katsunori
ce06b102df help: show value requirement and multiple occurrence of options
this helps users to know what kind of option is:

  - no value is required(flag option)
  - value is required
  - value is required, and multiple occurrences are allowed

each kinds are shown as below:

 -f --force              force push
 -e --ssh CMD            specify ssh command to use
 -b --branch BRANCH [+]  a specific branch you would like to push

if one or more 3rd type options are shown, explanation for '[+]' mark
is also shown as footnote.
2010-06-06 17:25:00 +09:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Dirkjan Ochtman
43d9564cff some modernization cleanups, forward compatibility 2009-05-13 14:08:39 +02:00
Martin Geisler
f1f94caf9a fancyopts: add copyright and license header 2009-04-26 01:56:52 +02:00
Augie Fackler
7131a2f8b7 fancyopts: Parse options that occur after arguments.
This changes the behavior of qguard in the case of setting negative guards, as -- will now always be required.
Fixes issue1402.
Doc fixes for mq by mpm.
2009-02-10 13:26:00 -06:00
Matt Mackall
63cc8c83c8 transform a bunch of print statements to appropriate ui calls 2008-01-18 10:48:25 -06:00
Matt Mackall
f72837d93d fancyopts: lots of cleanups 2007-12-10 10:24:36 -06:00
Thomas Arendsen Hein
37a2cd8e7d fancyopts: Copy list arguments in command table before modifying.
Before this, executing
commands.dispatch(['log', '-r', '0'])
commands.dispatch(['log', '-r', 'tip'])
would look like:
hg log -r 0
hg log -r 0 -r tip

Reported by TK Soh, patch by Alexis S. L. Carvalho
2007-08-11 13:07:47 +02:00
Alexis S. L. Carvalho
ea7eb1125c additional fixes for issue436 2006-12-01 16:18:16 -02:00
Matt Mackall
f2217f67ed Fix argument handling for hg -v pull -v x (issue 436) 2006-12-01 01:42:52 -06:00
Thomas Arendsen Hein
411d64ce3e white space and line break cleanups 2006-11-17 08:06:54 +01:00
twaldmann@thinkmo.de
55d74a6b77 fixed some stuff pychecker shows, marked unclear/wrong stuff with XXX 2005-11-14 03:59:35 +02:00
Bryan O'Sullivan
d845eb1c18 Map long option names containing dashes to ones containing underscores. 2005-08-24 22:25:55 -07:00
mpm@selenic.com
2a89b7bd1d Fix option parsing bug for empty short options 2005-08-19 18:56:20 -08:00
mark.williamson@cl.cam.ac.uk
7d47f35832 A number of minor fixes to problems that pychecker found.
# HG changeset patch
# User mark.williamson@cl.cam.ac.uk
# Node ID 55d38977b7f2e73b8c1090179928ac96c8922b90
# Parent  0bda45294416406d4c6fbaf1cb643dd0bf6b3a16
A number of minor fixes to problems that pychecker found.
2005-07-10 16:01:11 -08:00
Matt Mackall
c77de876fa Add username/merge/editor to .hgrc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Add username/merge/editor to .hgrc

These take priority over the equivalent environment vars
Deprecate HGMERGE, HGUSER, and HGEDITOR in docs
Add ui section to docs
Remove undocumented HG_OPTS
Raise username code out of changelog class
Make tests ignore ~/.hgrc

manifest hash: d127ef02bc5266036b4c77a55319519e91bd475b
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCyM5NywK+sNU5EO8RAuU7AJ9zKk1TFrJXHM04jOOJJeBSp8jlTgCeP+tr
qwGFd+WaNqTepZ0wun5g9Uc=
=QEBu
-----END PGP SIGNATURE-----
2005-07-03 21:51:09 -08:00
mpm@selenic.com
d56d83961e A bunch of parsing/help updates
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A bunch of parsing/help updates

more explanation of how to get non-basic commands
shorten names of debug functions and add docstrings
add undo long docstring
promote anotate, export, and revert
make the global opts array global
refactor parsing
kill two unused arguments to fancyopts
update test-help

manifest hash: 459ae2273aaf54f71b4576677a681dc53ab2908c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCyEDhywK+sNU5EO8RAr0DAJ9LTu8Fc2quLRtuwLPTQzWqlOJWKwCbBpZk
pnMkYnshsutVYljcil1P46I=
=Sleg
-----END PGP SIGNATURE-----
2005-07-03 11:47:45 -08:00
mpm@selenic.com
398e6f24b7 fancyopts: drop unneeded import
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

fancyopts: drop unneeded import

manifest hash: 09729db8a301510f021fd84a9e82a16ea3ccc67b
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCxZegywK+sNU5EO8RAnJwAKCn8kw2VzLc1NgObPFyYI1NxtBJSACgk1v4
d041JB9E0PybyftBFV55Of0=
=Cp7N
-----END PGP SIGNATURE-----
2005-07-01 11:21:04 -08:00
mpm@selenic.com
0fb5db6915 Whitespace cleanups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whitespace cleanups

manifest hash: ac954bc3a4f034c12638a259ecd65841f5b63c5c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwuubywK+sNU5EO8RAluIAJ98XQpNdZUpSmYKgDmrMRlbL76ZzQCfes0t
rknNUN/PhtyA4bzL646dOz4=
=UyCE
-----END PGP SIGNATURE-----
2005-06-29 10:42:35 -08:00
mpm@selenic.com
6bf860f30e hg help improvements
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hg help improvements

Handle showing option help in commands.py rather than fancyopts
Show getopt exception string if argument parsing fails and call help
Show help for invalid arguments
Show exception string for invalid arguments with -d

manifest hash: 9bd3e908cc080c21bb5e85822f675c35a8396fef
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCp8GNywK+sNU5EO8RAoJfAJ4pB0I4xH4CTuGmAwArfBzIsT9plACeImkm
4ml9x78fmPgKpDYIr/qhfVY=
=YeZv
-----END PGP SIGNATURE-----
2005-06-08 20:11:57 -08:00
mpm@selenic.com
4cc432f9f1 Beginning of new command parsing interface
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Beginning of new command parsing interface

This adds commands.py, with a primary interface dispatch(args)

Dispatch searches a table of known commands, handles switches, sets up
a repo object if appropriate, and dispatches the command.

It also handles KeyboardInterrupt and can handle similar exceptions in
the future.

If the command is unknown, it falls through to the current command handler.

Commands currently handled by the new scheme: help, init, and annotate

manifest hash: 134cd032c880985e3f92f82efb8b629dd862ba4c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCnXEGywK+sNU5EO8RAuDAAJ9q7K4w7qGVWv1NWjCPFGO/UJc6VQCdEhMQ
sBBlSRzah9QPy8K94catZyg=
=wuRf
-----END PGP SIGNATURE-----
2005-06-01 00:25:42 -08:00
mpm@selenic.com
9be61ee466 Make fancyopts handle no arguments
This lets hg serve work with no args.
2005-05-26 09:56:20 -08:00
mpm@selenic.com
ca8cb8ba67 Add back links from file revisions to changeset revisions
Add simple transaction support
Add hg verify
Improve caching in revlog
Fix a bunch of bugs
Self-hosting now that the metadata is close to finalized
2005-05-03 13:16:10 -08:00