Commit Graph

11291 Commits

Author SHA1 Message Date
Martin Geisler
5d9db0b74d check-code: fix check for any/all function
The old check would only detect any/all at the beginning of a line.
The regexp was probably just modeled after the preceding regexp which
(correctly) finds the 'with' keyword at the beginning of a line.

We now complain about 'any(' and 'all(' anywhere in a line, unless it
is preceded by 'def'. This allows us to define our own compatibility
wrapper in util and use 'util.any(' in the code.
2010-06-15 09:51:52 +02:00
Renato Cunha
b35e385443 hgext/zeroconf/__init__.py: Separate relative and absolute imports.
2to3 complains when relative and absolute imports are mixed, this fix just
separates them on the zeroconf extension. According to 2to3, the other modules
are fine.
2010-06-14 16:56:20 -03:00
Matt Mackall
ef2640cd30 revset: improve filter argument handling 2010-06-11 15:30:12 -05:00
Martin Geisler
96576cd383 commands: format is a Python2.6 function 2010-06-11 18:54:10 +02:00
Peter Arrenbrecht
b9ce7f49a5 debugbuilddag: build a changelog dag from a concise description
Useful in tests to quickly build a complex DAG in an empty repo.
Handles local tags and named branches.
Options to, at each rev,
 - create a new file,
 - overwrite the same file,
 - append to the same file,
 - write to a specific line in a mergeable file.
Can run shell commands during DAG buildup.
2010-06-10 11:49:48 +02:00
Peter Arrenbrecht
a9d00c7c41 debugdag and debugindexdag: emit changelog/revlog DAGs as concise text
Mainly useful for reusing DAGs somewhere else, for example for attaching
them to a bug report, or for importing them into other environments
(like my test environment for incoming/outgoing discovery).
2010-06-10 11:48:45 +02:00
Peter Arrenbrecht
b2bbef20ef dagparser: parses and formats DAGs as concise text
As discussed during the sprint. See the doc comment and doctests
for specification and examples. This is used in subsequent patches
to export revlog and changelog DAGs, and to generate a repo with
a given changelog DAG.
2010-06-10 11:48:15 +02:00
Matt Mackall
fce0ca4afe tests: fix up webraw encoding 2010-06-10 15:30:15 -05:00
Matt Mackall
251885d01b strip: backup bundles should use the .hg extension 2010-06-10 15:23:31 -05:00
Julian Cowley
3dc90b2c5b hgweb: specify a charset when sending raw text files
Gets the charset from encoding.encoding parameter.
2010-06-09 12:41:44 -10:00
Matt Mackall
1cf1295d6e summary: report copies and renames 2010-06-09 16:39:25 -05:00
Chad Dombrova
22bbfbd44a provide pre- and post- hooks with parsed command line arguments.
python hooks are passed two new keyword arguments:
- opts: a dict of options; unsepcified options are set to their default
- pats: a list of arguments

shell hooks receive two new variables containing string representations
of the above data:
- $HG_OPTS
- $HG_PATS

for example, the opts and pats for 'hg -f v1.1' would be:
{'force': True, 'message': '', 'rev': '', 'user': '', 'date': '', 'local': None, 'remove': None, 'mq': None}
['v1.1']
2010-06-10 09:32:19 -07:00
Dan Villiom Podlaski Christiansen
e64c6d6314 pager: set ui.formatted() prior to redirecting stdout. 2010-06-07 15:34:48 +02:00
Dan Villiom Podlaski Christiansen
de6e2d6afa mq: use ui.formatted() instead of ui.plain(). 2010-06-07 15:33:03 +02:00
Dan Villiom Podlaski Christiansen
eb569c8b47 color: use ui.formatted(). 2010-06-07 15:28:54 +02:00
Dan Villiom Podlaski Christiansen
6d2a041cb0 ui: document the formatted(), interactive() & plain() functions. 2010-06-07 16:14:12 +02:00
Dan Villiom Podlaski Christiansen
a15c6a0d68 ui: add ui.formatted configuration variable and accessor function.
This new configuration variable is similar in nature `ui.interactive',
but applying to output instead of input. This allows as to support
non-interactive sessions where formatted should be enabled, such as
when using the pager extension.

The variable itself is left undocumented; it is not intended for use
outside Mercurial and its extensions.
2010-06-07 14:59:52 +02:00
Martin Geisler
74ffb9edd7 revlog: fix inconsistent comment formatting 2010-06-10 17:10:05 +02:00
Sune Foldager
4e663d3541 improve --branch processing (and differentiate from # syntax)
Previously #foo and --branch foo were handled identically.
The behavior of #foo hasn't changed, but --branch now works like this:

1) If branchmap is not supported on the remote, the operation fails.
2) If branch is '.', substitute with branch of the working dir parent.
3) If branch exists remotely, its heads are expanded.
4) Otherwise, the operation fails.

Tests have been added for the new cases.
2010-06-10 12:46:09 +02: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
Christian Ebert
6241cdaae9 keyword: pass context to kwtemplater.overwrite
Now that we have retrieved the context in every calling function
except commit, pass it as argument to kwtemplater.overwrite to
avoid looking it up twice.

Reorder arguments to kwtemplater.overwrite to reflect their
importance.

Turn node argument into a simple boolean and rename it to iswctx.
2010-06-09 12:45:48 +01:00
Peter Arrenbrecht
e4f22f6bc6 parser: fix missing param in _match 2010-06-08 16:27:59 +02:00
Gilles Moris
d96dd72840 commit: add tests for the 'created new head' message 2010-06-08 22:30:44 +02:00
Gilles Moris
54d30f05ab commit: fix display of 'created new head' message (issue2186)
To avoid recurrent fixes for the display of this message, a summary table with
all case combinations has been added to the code.
Basically, there is two condition for the message to be printed:
* this is not an initial (named branch or topo) root
* none of the parents are in the current branch heads
2010-06-08 22:28:42 +02:00
Stefano Tortarolo
28423089a9 rebase: --abort doesn't strip away the target changeset (issue2220)
When a changeset is skipped, rebase keeps the previous target as next
target and if the skipped cset is the first one, the recorded target is
actually the original target.
--abort did not detect this situation but simply stripped away the cset.
2010-06-08 18:01:07 +02:00
Jan Sorensen
b851482b84 test-branch-option: Updated output to match rev c00f45d9192e 2010-06-09 17:22:59 +02:00
Martin Geisler
0af2030d7c Merge with mpm 2010-06-09 17:50:45 +02:00
Dirkjan Ochtman
87509d8b7e discovery: fix description line 2010-06-09 17:27:47 +02:00
Matt Mackall
8ac0858186 Merge with stable 2010-06-08 15:57:59 -05:00
Steve Borho
0d0e614fc9 Merge backout 2010-06-08 15:52:56 -05:00
Steve Borho
b82bd4f289 Backed out changeset: 1bfde817782c 2010-06-08 15:52:41 -05:00
Thomas Arendsen Hein
56a5e9e864 ui: handle leading newlines/spaces/commas in configlist
Thanks to Greg Ward for spotting the problem introduced in cc0423a3b3fe
and for supplying the test case.
2010-06-08 21:09:41 +02:00
Steve Borho
74a14c2364 mergetools: add configuration for Ultra Compare (issue2226)
Initial config provided by Tim Pietzcker
2010-06-08 11:58:09 -05:00
Martin Geisler
bd1de7cf0d mq: use hg reST role some more 2010-06-08 14:12:46 +02:00
Sune Foldager
3577ed71f2 fix encoding bug in 66b9176ecbe4 2010-06-08 13:19:22 +02:00
Dirkjan Ochtman
64bb18f0dd cleanups: undefined variables 2010-06-08 09:30:45 +02:00
Dirkjan Ochtman
cb25b6f79d cleanups: unused variables 2010-06-08 09:30:33 +02:00
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
Sune Foldager
ebb213954d push/pull: fix bug in "--branch ." handling
The branch wasn't expanded, so only the tip was operated on.
2010-06-07 16:28:23 +02:00
Steve Borho
e91613380a color: labeled text should be passed to ui.write() as ui.labeled
Some implementations of ui.label() (HTML versions in particular) must escape
the provided text and then markup the text with their tags.  When this marked
up text is then passed to ui.write(), we must label the text as 'ui.labeled'
so the implementation knows not to escape it a second time (exposing the initial
markup).

This required the addition of a 'ui.plain' label for text that is purposefully
not marked up.

I was a little pedantic here, passing even ' ' strings to ui.label() when it
would be included with other labeled text in a ui.write() call.   But it seemed
appropriate to lean to the side of caution.
2010-06-03 23:18:18 -05:00
Dirkjan Ochtman
cf1de649bd move discovery methods from localrepo into new discovery module 2010-06-07 18:35:54 +02:00
Sune Foldager
e0cc1e8ad9 merge with stable 2010-06-07 16:29:06 +02:00
Pradeepkumar Gayam
ade05bacc0 shrink-repo: wrong variable name 2010-06-06 22:39:32 +05:30
FUJIWARA Katsunori
9cce255bec replace Python standard textwrap by MBCS sensitive one for i18n text
Mercurial has problem around text wrapping/filling in MBCS encoding
environment, because standard 'textwrap' module of Python can not
treat it correctly. It splits byte sequence for one character into two
lines.

According to unicode specification, "east asian width" classifies
characters into:

   W(ide), N(arrow), F(ull-width), H(alf-width), A(mbiguous)


W/N/F/H can be always recognized as 2/1/2/1 bytes in byte sequence,
but 'A' can not. Size of 'A' depends on language in which it is used.

Unicode specification says:

   If the context(= language) cannot be established reliably they
   should be treated as narrow characters by default

but many of class 'A' characters are full-width, at least, in Japanese
environment.

So, this patch treats class 'A' characters as full-width always for
safety wrapping.

This patch focuses only on MBCS safe-ness, not on writing/printing
rule strict wrapping for each languages

MBCS sensitive textwrap class is originally implemented
by ITO Nobuaki <daydream.trippers@gmail.com>.
2010-06-06 17:20:10 +09:00
Christian Ebert
9f4630cb27 keyword: use context to detect uncommitted merge 2010-06-03 10:37:31 +01:00
Adrian Buehlmann
304c69c642 tests: use --debug on test-clone 2010-06-03 13:58:00 +02:00
Greg Ward
6e1d6aff0f shrink-revlog: use util.mktempcopy() to preserve mode of index file.
(There's still a chmod() call to manually preserve the mode of the
data file.)
2010-06-03 10:18:33 -04:00
Matt Mackall
420e7ec722 revset: delay import of hg to avoid start-up import loops 2010-06-05 09:58:02 -05:00
Matt Mackall
476998d3a8 error: fix up test-hgrc 2010-06-04 23:04:31 -05:00
Matt Mackall
0625b02fef error: update test-trusted.py 2010-06-04 23:00:22 -05:00