Commit Graph

289 Commits

Author SHA1 Message Date
Mike Edgar
2dcf6e652f wireproto: add config knob for http header length limit
Well-behaved Mercurial clients will respect the httpheader capability by not
sending http headers longer than the given limit in bytes. The limit is
currently hard-coded at 1024 bytes, a safe value for any web server.

Since parsing headers is a notable factor in web server performance, tuning
header size can nontrivially improve performance for request-heavy operations
(eg. obsolete marker negotiation). Exposing the maximum header length limit
as a configuration setting is a simple way to enable such tuning.
2015-06-29 12:35:31 -04:00
Jordi Gutiérrez Hermoso
c63f5d825c doc: document the ui.patch option
This option has been undocumented since 2ad3e7d82d89 (July 2007).
2015-06-23 13:47:42 -04:00
Matt Mackall
7c6674833f patch: add fuzz config flag (issue4697) 2015-06-18 15:42:40 -05:00
Yuya Nishihara
d95129ee92 templater: take any string literals as template, but not for rawstring (BC)
This patch series is intended to unify the interpretation of string literals.
It is breaking change that boldly assumes

 a. string literal "..." never contains template-like fragment or it is
    intended to be a template
 b. we tend to use raw string literal r"..." for regexp pattern in which "{"
    should have different meaning

Currently, we don't have a comprehensible rule how string literals are
evaluated in template functions. For example, fill() takes "initialindent"
and "hangindent" as templates, but not for "text", whereas "text" is a
template in pad() function.

  date(date, fmt)
  diff(includepattern, excludepattern)
  fill(text, width, initialident: T, hangindent: T)
  get(dict, key)
  if(expr, then: T, else: T)
  ifcontains(search, thing, then: T, else: T)
  ifeq(expr1, expr2, then: T, else: T)
  indent(text, indentchars, firstline)
  join(list, sep)
  label(label: T, expr: T)
  pad(text: T, width, fillchar, right)
  revset(query, formatargs...])
  rstdoc(text, style)
  shortest(node, minlength)
  startswith(pattern, text)
  strip(text, chars)
  sub(pattern, replacement, expression: T)
  word(number, text, separator)
  expr % template: T

  T: interpret "string" or r"rawstring" as template

This patch series adjusts the rule as follows:

 a. string literal, '' or "", starts template processing (BC)
 b. raw string literal, r'' or r"", disables both \-escape and template
    processing (BC, done by subsequent patches)
 c. fragment not surrounded by {} is non-templated string

  "ccc{'aaa'}{r'bbb'}"
   ------------------  *: template
   ---                 c: string
        ---            a: template
                ---    b: rawstring

Because this can eliminate the compilation of template arguments from the
evaluation phase, "hg log -Tdefault" gets faster.

  % cd mozilla-central
  % LANG=C HGRCPATH=/dev/null hg log -Tdefault -r0:10000 --time > /dev/null
  before: real 4.870 secs (user 4.860+0.000 sys 0.010+0.000)
  after:  real 3.480 secs (user 3.440+0.000 sys 0.030+0.000)

Also, this will allow us to parse nested templates at once for better error
indication.
2015-06-13 19:49:54 +09:00
Pierre-Yves David
cb27f72a61 help: use 'color' as an example (instead of 'progress')
Progress is now deprecated, using it as an example is suboptimal.
2015-06-11 00:26:06 -07:00
Pierre-Yves David
78d3116873 progress: move config help into core config help
This is core feature now.
2015-06-10 11:56:55 -07:00
Yuya Nishihara
c09636067e ssl: drop support for Python < 2.6, require ssl module
try-except clause is kept for readability of this patch, and it will be
removed soon.
2015-06-05 21:37:46 +09:00
Ryan McElroy
7cd7aaf7a6 templatekw: introduce active subkeyword from bookmarks keyword
Today, the terms 'active' and 'current' are interchangeably used throughout the
codebase in reference to the active bookmark (the bookmark that will be updated
with the next commit). This leads to confusion among developers and users.
This patch is part of a series to standardize the usage to 'active' throughout
the mercurial codebase and user interface.
2015-05-28 20:03:42 -07:00
Durham Goode
97174c82e5 help: add documentation on include: and subinclude:
Adds some help text about the new include: and subinclude: match syntax.
2015-05-20 14:54:09 -07:00
Matt Harbison
f25dcb1c8d files: recurse into subrepos automatically with an explicit path 2015-05-17 22:42:47 -04:00
Ryan McElroy
1729fe1e93 templatekw: replace currentbookmark with activebookmark keyword
Today, the terms 'active' and 'current' are interchangeably used throughout the
codebase in reference to the active bookmark (the bookmark that will be updated
with the next commit). This leads to confusion among developers and users.
This patch is part of a series to standardize the usage to 'active' throughout
the mercurial codebase and user interface.
2015-04-15 08:19:36 -07:00
Yuya Nishihara
6db323dd98 help: rewrite template examples to use integer literals where appropriate 2015-05-02 15:51:57 +09:00
Matt Harbison
f79d96d03a subrepo: update the help text to account for diff -I/-X gitsubrepo support
The functionality was added in e6e24423f817.
2015-04-27 20:25:09 -04:00
Wagner Bruna
a6d1f7d563 help: fix typos in txnclose and txnabort documentation 2015-04-21 21:01:05 -03:00
Javi Merino
865602fca3 help: fix typo commited -> committed 2015-04-19 11:37:29 +01:00
Pierre-Yves David
bfdd8d2ada hooks: add a 'txnabort' hook
This hook will be called whenever a transaction is aborted. This will make it
easy for people to clean up temporary content they may have created during a
transaction.
2015-04-16 05:36:49 -04:00
Pierre-Yves David
ce7797818b help: document the ''HG_TXNID'' environment variable during hooks
We forgot to document the new "transaction ID" mechanism.
2015-04-16 05:41:07 -04:00
Mathias De Maré
8b3f5b98e3 commands: add ui.statuscopies config knob
statuscopies enables viewing of copies and moves in 'hg status' by default.
2015-03-24 21:25:57 +01:00
Gregory Szorc
acb5f54ecc help: populate template functions via docstrings
We do this for revsets, template keywrods, and template filters. Now we
do it for template functions as well.
2015-04-01 20:23:58 -07:00
Matt Mackall
91b7caa71a merge with stable 2015-03-31 16:14:14 -05:00
Nathan Goldbaum
08c916638d filemerge: clean up language in mergemarkertemplate help 2015-03-31 11:58:14 -07:00
Matt Harbison
3ea5067ed3 subrepo: add basic support to hgsubrepo for the files command
Paths into the subrepo are not yet supported.

The need to use the workingctx in the subrepo will likely be used more in the
future, with the proposed working directory revset symbol.  It is also needed
with archive, if that code is to be reused to support 'extdiff -S'.
Unfortunately, it doesn't seem possible to put the smarts in subrepo.subrepo(),
as it breaks various status and diff tests.

I opted not to pass the desired revision into the subrepo method explicitly,
because the only ones that do pass an explicit revision are methods like status
and diff, which actually operate on two contexts- the subrepo state and the
explicitly passed revision.
2015-03-18 23:03:41 -04:00
Pierre-Yves David
06735d963a hook: add a generic hook right before we commit a transaction
We are adding a 'txnclose' hook that will be run right before a transaction is
closed. Hooks running at that time will have access to the full transaction
content through both 'hookargs' content and on-disk reading. They will be able
to abort the transaction.
2015-03-09 22:50:49 -07:00
Pierre-Yves David
44751929cc hook: add a generic hook after transaction has been closed
We are adding generic hooking for all transactions. We may have useful
information about what happened during the transaction, user of the transaction
should have filled the 'hookargs' dictionnary of the transaction. This hook is
simple because it has no power to rollback the transaction.
2015-03-09 22:36:56 -07:00
Pierre-Yves David
dd9fda46b5 hook: have a generic hook for transaction opening
We are adding generic hooking for all transactions. We do not really have any
useful information to include when opening the transaction but this is a
useful time to allow a hook anyway. We better let people abort transaction before
they happen than after multiple seconds/minutes of processing.
2014-12-10 18:19:49 -08:00
Jesus Cea
60d6ae885a copyright: update to 2015
Many files and translations have an outdated copyright date.
Change that to the correct "2005-2015" dates.
2015-03-02 14:52:04 +01:00
Mathias De Maré
50bc3c4ab5 subrepos: support adding files in git subrepos
This support includes correct matching, so includes,
excludes and patterns are all supported.
2015-02-24 08:49:22 +01:00
Gregory Szorc
c26c3581a4 help: add web commands to help documentation
The capabilities and URL endpoints of the hgweb server can currently
only be inferred by looking at links in `hg serve` output or by reading
the source code. I've frequently found myself wanting to quickly see
what URLs and capabilities are available.

This patch teaches the help system how to display information about
web commands and their URLs. Using a mechanism similar to revsets,
templates, etc, we can now iterate over the docstrings of registered
web command functions and display them in the help output.

Unfortunately, web commands don't currently have docstrings, so the
output is currently empty. This will be addressed in the following
patches. I apologize for the patch bomb.
2015-02-06 20:27:56 -08:00
Gregory Szorc
d2d0fbc4d0 help.hgweb: add a section describing URLs and common parameters
The behavior of hgweb's URLs isn't documented anywhere inside Mercurial.
Let's start to change that.
2015-02-06 23:08:47 -08:00
Mathias De Maré
6915ed3f3b subrepo: add 'cat' support for git subrepos
V2: use 'self._ctx.node()' instead of 'rev' in makefileobj.
As Matt Harbison mentioned, using 'rev' does not make sense,
since we'd be passing a git revision to the top-level
Mercurial repository.
2015-02-01 14:09:31 +01:00
FUJIWARA Katsunori
fa0f66b4fb revset: introduce new operator "##" to concatenate strings/symbols at runtime
Before this patch, there is no way to concatenate strings at runtime.

For example, to search for the issue ID "1234" in descriptions against
all of "issue 1234", "issue:1234", issue1234" and "bug(1234)"
patterns, the revset below should be written fully from scratch for
each issue ID.

    grep(r"\bissue[ :]?1234\b|\bbug\(1234\)")

This patch introduces new infix operator "##" to concatenate
strings/symbols at runtime. Operator symbol "##" comes from the same
one of C pre-processor. This concatenation allows parametrizing a part
of strings in revset queries.

In the case of example above, the definition of the revset alias using
operator "##" below can search issue ID "1234" in complicated patterns
by "issue(1234)" simply:

    issue($1) = grep(r"\bissue[ :]?" ## $1 ## r"\b|\bbug\(" ## $1 ## r"\)")

"##" operator does:

  - concatenate not only strings but also symbols into the string

    Exact distinction between strings and symbols seems not to be
    convenience, because it is tiresome for users (and
    "revset.getstring" treats both similarly)

    For example of revset alias "issue()", "issue(1234)" is easier
    than "issue('1234')".

  - have higher priority than any other prefix, infix and postfix
    operators (like as "##" of C pre-processor)

    This patch (re-)assigns the priority 20 to "##", and 21 to "(",
    because priority 19 is already assigned to "-" as prefix "negate".
2015-01-06 23:46:18 +09:00
Siddharth Agarwal
5bc4775669 ignore: resolve ignore files relative to repo root (issue4473) (BC)
Previously these would be considered to be relative to the current working
directory. That behavior is both undocumented and doesn't really make sense.
There are two reasonable options for how to resolve relative paths:
- relative to the repo root
- relative to the config file

Resolving these files relative to the repo root matches existing behavior with
hooks. An earlier discussion about this is available at
http://mercurial.markmail.org/thread/tvu7yhzsiywgkjzl.

Thanks to Isaac Jurado <diptongo@gmail.com> for the initial patchset that
spurred the discussion.
2014-12-16 14:34:53 -08:00
Matt Harbison
a7a84e8adc addremove: support addremove with explicit paths in subrepos
Git and svn subrepos are currently not supported.
2014-11-09 23:46:25 -05:00
Matt Harbison
3b63e95b8e addremove: add support for the -S flag
Git and svn subrepos are currently not supported.  It doesn't look like git or
svn have these commands natively, so that's an area for a git or svn expert.
2014-11-24 23:51:26 -05:00
Matt Harbison
3c47e94de7 commit: propagate --addremove to subrepos if -S is specified (issue3759)
The recursive addremove operation occurs completely before the first subrepo is
committed.  Only hg subrepos support the addremove operation at the moment- svn
and git subrepos will warn and abort the commit.
2014-11-24 22:27:49 -05:00
Mathias De Maré
60f4f56e86 subrepo: add partial diff support for git subrepos
So far, git subrepositories were silently ignored for diffs.
This patch adds support for git subrepositories,
with the remark that --include and --exclude are not supported.
If --include or --exclude are used, the subrepo is ignored.
2014-12-10 10:32:51 +01:00
Matt Harbison
c0a7d4f5bc remove: support remove with explicit paths in subrepos 2014-11-12 23:15:20 -05:00
Matt Harbison
17e7835237 remove: recurse into subrepositories with --subrepos/-S flag
Like 'forget', git and svn subrepos are currently not supported.  Unfortunately
the name 'remove' is already used in the subrepo classes, so we break the
convention of naming the subrepo function after the command.
2014-11-15 21:36:19 -05:00
Siddharth Agarwal
37a8021dad patch.diffopts: add support for noprefix
In an upcoming patch we'll enable support as an option to 'hg diff' as well.

The tests reflect the current state of the world -- as we add support we'll see
changes in the test output.
2014-11-13 00:08:44 -08:00
Mads Kiilerich
7f5af5ba4c config: introduce "built-in" default configuration settings in default.d
This helps providing a more consistent user experience on all platforms and
with all packaging.

The exact location of default.d depends on how Mercurial is installed and
whether it is 'frozen'. The exact location should never be relevant to users
and is intentionally not explained in details in the documentation. It will
however always be next to the help and templates files.

Note that setting HGRCPATH also disables these defaults. I don't know if that
should be considered a bug or a feature.
2014-09-04 21:36:35 +02:00
Mads Kiilerich
ddd482eeb0 help: fix config description of ui.reportoldssl 2014-11-01 18:28:54 +01:00
FUJIWARA Katsunori
45bd2bfacb help: refer ":merge3" instead of "internal:merge3"
According to warning message (introduced by 727c196b0843) in
filemerge.py, the former should be used as official name.
2014-11-01 02:43:08 +09:00
FUJIWARA Katsunori
18a0e8a463 help: use "hg files" instead of "hg locate" in "hg help filesets"
The latter command is already deprecated.
2014-11-01 02:43:08 +09:00
Wagner Bruna
6791cdb7aa help/config: fix typo 2014-10-23 12:28:00 -02:00
Matt Mackall
be7ae55914 glossary: add deprecated and experimental 2014-10-17 12:34:27 -05:00
Mads Kiilerich
26870bfa1d filemerge: switch the default name for internal tools from internal:x to :x 2014-09-28 17:15:28 +02:00
Matt Mackall
b738313af7 merge with stable 2014-10-01 15:05:09 -05:00
Jordi Gutiérrez Hermoso
678a04feed diff: document the nobinary option
Since ce44c3c7c2be, we have a diff.nobinary option. This is handy, but
the only way I found out about it was by looking at the release notes
for 3.1, which is not something I normally do.
2014-09-30 16:59:07 -04:00
Matt Mackall
ed7915788e help: use OS containers for config file lists 2014-09-30 15:55:30 -05:00
Augie Fackler
b9ffc43057 help: document that default hgweb style is called paper (issue4373) 2014-09-23 14:20:08 -04:00