Commit Graph

193 Commits

Author SHA1 Message Date
Martin Geisler
65ea7aa7d4 dispatch: lowercase --time message 2012-06-12 14:18:18 +02:00
Adrian Buehlmann
cf5a074e7d dispatch: tolerate non-standard version strings in tuplever() (issue3470)
When developing, we may see non-standard version strings of the form

  5d64306f39bb+20120525

which caused tuplever() to raise

  ValueError: invalid literal for int() with base 10: '5d64306f39bb'

and shadowing the real traceback.
2012-05-25 14:24:07 +02:00
Augie Fackler
1d813c0d7e dispatch: try and identify third-party extensions as sources of tracebacks
Extension authors should explicitly declare their supported hg
versions and include a buglink attribute in their extension. In the
event that a traceback occurs, we'll identify the
least-recently-tested extensionas the most likely source of the defect
and suggest the user disable that extension.

Packagers should make every effort to ship hg versions from exact
tags, or with as few modifications as possible so that the versioning
can work appropriately.
2012-05-16 16:18:07 -05:00
Brodie Rao
7f47d4e347 check-code: ignore naked excepts with a "re-raise" comment
This also promotes the naked except check from a warning to an error.
2012-05-13 13:18:06 +02:00
Brodie Rao
a7ef0a0cc5 cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Patrick Mezard
9c5568246f alias: inherit command optionalrepo flag (issue3298)
Commands working without a repository, like "init", are listed in
commands.norepo. Commands optionally using a repository, like "showconfig", are
listed in commands.optionalrepo. Command aliases were inheriting the former but
not the latter.
2012-05-05 12:21:22 +02:00
Yuya Nishihara
8284425c7d commands: parse ui.strict config item as bool 2012-05-06 23:58:04 +09:00
Bryan O'Sullivan
af2413c514 dispatch: add support for statprof as a profiler
This can be selected using the config variable profiling.type or
the environment variable HGPROF ("ls" for the default, "stat" for
statprof).  The only tuneable is the frequency, profiling.freq,
which defaults to 1000 Hz.

If statprof is not available, a warning is printed.
2012-04-09 13:48:45 -07:00
Matt Mackall
2cf26ea8f0 merge with stable 2012-03-27 16:17:46 -05:00
Matt Mackall
3eb6e77c5e alias: abort on missing positional args (issue3331) 2012-03-27 16:13:59 -05:00
Matt Mackall
39c1d7334a merge with stable 2012-03-22 17:08:05 -05:00
Matt Mackall
8fac36f6df aliases: use empty string for missing position parameters (issue3331) 2012-03-22 17:07:39 -05:00
Matt Mackall
000c79b7ce profile: add undocumented config options for profiler output 2012-03-15 15:59:26 -05:00
Martin Geisler
cf414756e1 dispatch: lowercase abort message 2012-01-06 16:16:58 +01:00
Martin Geisler
237daccf1b dispatch: remove extra newline
The return statement belongs to the lines above.
2011-12-10 18:40:05 +01:00
Matt Mackall
75db0d196a merge with stable 2011-11-17 16:53:17 -06:00
Mads Kiilerich
065de91b14 add missing localization markup 2011-11-11 01:07:10 +01:00
Mads Kiilerich
06a1eb11e4 dispatch: exit with 8-bit exit code
The exit code returned from a program to the shell is unsigned 8-bit, but
Mercurial would sometimes try to exit with negative numbers or None. sys.exit
on Unix will convert that to 8-bit exit codes, but on Windows negative values
showed up as 0.

The exit code is now explicitly converted to unsigned 8-bit.
2011-11-07 03:14:53 +01:00
Augie Fackler
b0cd40af6a alias: don't shadow commands that we only partially matched (issue2993) (BC)
Previously, if you set an alias for "ci", it'd also shadow "commit"
even though you didn't specify that. This occurred for all commands
with explicit short variations.
2011-10-11 17:20:03 -05:00
Matt Mackall
96e41d94f5 merge with stable 2011-08-05 16:07:51 -05:00
Matt Mackall
1731276051 help: drop with_version
If --version is specified, we print the version and exit (as documented).
2011-08-04 15:08:41 -05:00
Idan Kamara
073a89cf8a dispatch: don't rewrap aliases that have the same definition
Previously aliases that overrode existing commands would wrap the old alias
on every call to dispatch() (twice actually), which is an obvious re-entrancy
issue for things like the command server or TortoiseHG.
2011-08-04 19:41:23 +03:00
Andrew Pritchard
2d8acb3e0b wireproto: add out-of-band error class to allow remote repo to report errors
Older clients will still print the provided error message and not much else:
over ssh, this will be each line prefixed with 'remote: ' in addition to an
"abort: unexpected response: '\n'"; over http, this will be the '---%<---'
banners in addition to the 'does not appear to be a repository' message.

Currently, clients with this patch will display 'abort: remote error:\n' and
the provided error text, but it is trivial to style the error text however is
deemed appropriate.
2011-08-02 15:21:10 -04:00
Matt Mackall
e75325116a merge with stable 2011-08-01 10:54:34 -05:00
Idan Kamara
19f1b36e00 dispatch: make sure global options on the command line take precedence
So if a user has verbose=True somewhere in his .hgrc files, giving -q
on the command line will override that.

This basically reverts cd10f447ccba.
2011-07-30 21:04:14 +03:00
David Golub
11baa243a9 dispatch: avoid double backslashes in error message
The use of %r in the format string caused Python to display Windows paths with
double backslashes.
2011-07-21 16:02:34 -04:00
Idan Kamara
27bbf9363c dispatch: don't use request repo if we have --cwd 2011-07-11 17:46:55 +03:00
Pierre-Yves David
f95a6cfc12 error: Add a hint argument to RepoError
This use the same mechanism than Abort. Except clause stay distinct
because RepoError add "!" at the end of the message.
2011-06-25 02:30:17 +02:00
Idan Kamara
a1bff0c5fe dispatch: set config options on the request repo.ui 2011-06-24 19:44:59 +03:00
Idan Kamara
f0f55bda59 dispatch: return read config options 2011-06-24 19:44:59 +03:00
Idan Kamara
122edf3c57 dispatch: set global options on the request repo.ui
If the request has a repo, and global options such as --verbose are passed,
we need to set those explicitly on the repo.ui.
2011-06-24 19:44:58 +03:00
Idan Kamara
ff97debbbd dispatch: make sure unspecified global ui options don't override old values 2011-06-24 12:16:14 +03:00
Idan Kamara
c368cbab93 dispatch: set descriptors on the request repo.ui 2011-06-24 19:38:28 +03:00
Idan Kamara
22edb918b3 dispatch: pass the correct ui to runcommand
For commands that take a repo, repo.ui is passed as the ui to runcommand.
This restores that behaviour when the request has a repo.
2011-06-24 19:36:44 +03:00
Idan Kamara
848255e076 dispatch: check for None before closing repo
We were trying to call close() if repo == None and req.repo != None.
This can happen when running commands that don't take a repo.
2011-06-24 16:30:43 +03:00
Idan Kamara
27964e7418 dispatch: do not close the request repo
Closing here means we've closed the repo passed to us in the request,
which is not our responsibility.

This is essential for bundlerepo, and possibly other localrepository
subclasses who do something in their close().
2011-06-21 17:08:21 +03:00
David Soria Parra
881ac28f17 i18n: remove translation of debug messages 2011-06-21 18:35:13 +02:00
Martin Geisler
01ba8f6e18 Backed out changeset 48c996bf6ba4
Debug messages should not be translated.
2011-06-21 14:57:17 +02:00
David Soria Parra
81153f2f12 dispatch: translate alias debugging messages 2011-06-21 13:24:19 +02:00
Idan Kamara
5e2d608efc dispatch: write shell alias output to ui out descriptor 2011-06-07 13:39:09 +03:00
Idan Kamara
c2b2fe4489 dispatch: fix for-loop variable name 2011-06-14 20:25:38 +03:00
Idan Kamara
c08a096623 dispatch: assign I/O descriptors from the request to the ui 2011-06-08 14:54:47 +03:00
Idan Kamara
e05ad378b0 dispatch: add I/O descriptors to the request 2011-06-07 13:39:09 +03:00
Idan Kamara
b335d3e278 dispatch: propagate ui command options to the local ui (issue2523)
so the ui object passed to pre/post python hooks has the verbose flag
(and the rest) set correctly
2011-06-13 00:19:26 +03:00
Idan Kamara
a910ab36b8 dispatch: add repo to the request
allows callers of dispatch.dispatch to pass in
an initialized repo object to be used.

-R/--repository overrides the request repo.
2011-06-02 00:43:34 +03:00
Idan Kamara
b9dc5b5bf7 dispatch: use the request to store the ui object
and check if we got one before creating.

note that the contents of the ui object might change after
dispatch() returns (by options passed through --config for example),
to ensure it doesn't, pass a copy() of it.
2011-05-26 00:53:23 +03:00
Idan Kamara
5544ef8f07 dispatch: wrap dispatch related information in a request class
currently only stores the arguments.
2011-05-26 00:44:11 +03:00
Martin Geisler
58a533fee9 help: add -c/--command flag to only show command help (issue2799) 2011-05-10 14:42:53 +02:00
Augie Fackler
79ea417a18 dispatch: use safehasattr instead of hasattr 2011-07-25 15:17:47 -05:00