Commit Graph

138 Commits

Author SHA1 Message Date
Pierre-Yves David
5dc648f5ae format: create new repository as 'generaldelta' by default
Since we have pushed back the performance issue related to general delta behind
another configuration (Still off by default), we can safely create new
repository with general delta support. As client are compatible with it since
Mercurial 1.9 (4.5 years ago) I do no expect any significant compatibility
issues.
2015-11-02 17:33:18 +00:00
Christian Delahousse
71afd0e97f cmdutil: add origbackuppath helper 2015-11-12 16:56:06 -06:00
Pierre-Yves David
c8b7676e04 format: introduce 'format.usegeneraldelta`
This option will make repositories created as general delta by default but will
not make Mercurial aggressively recompute deltas for all incoming bundle.
Instead, the delta contained in the bundle will be used. This will allow us to
start having general delta repositories created everywhere without triggering
massive recomputation costs for all new clients cloning from old servers.
2015-11-02 15:59:12 +00:00
Augie Fackler
32827d85c7 merge-tools: allow marking a mergetool as completely disabled
Very often in my life I'm finding that the only configured merge tool
present on the system is vimdiff[0], and it's currently impossible (as
far as I can tell) short of specifying `ui.merge = `[1] to actually
*disable* a merge tool. This allows vimdiff-haters to put:

  [merge-tools]
  vimdiff.disable = yes

in their ~/.hgrc and never see vimdiff again. I'm stopping short of
putting this as a commented out entry in the sample new user hgrc
(seen when a user runs `hg config --edit` with no ~/.hgrc) for now,
but I might come back and do that later.

0: vimdiff is at an awkward intersection: it's usually installed by
the vim package which is often installed as a vi substitute, so it's
mere presence doesn't imply me wanting it, unlike (say) kdiff3.

1: There's a related problem I ran into today where specifying
`ui.merge = :merge` failed because :merge isn't a command, which I
think is a regression. I'll try and figure that out and at least file
a bug.
2015-10-14 12:57:33 -04:00
Mads Kiilerich
3772833300 windows: read all global config files, not just the first (issue4491) (BC)
On windows, hgrc.d/*.rc would not be read if mercurial.ini was found. That was
far from obvious from the documentation and different from the behavior on
posix systems.

As a consequence of this, TortoiseHg cacert configuration placed in hgrc.d
would not be read if an old global mercurial.ini still existed.

"hg config -g" could also crash when no global configuration files could be
found.

Instead, make windows behave like posix and read all global configuration
files.

The documentation was in a way right that individual config settings in the
global Mercurial.ini would override settings from for example .hgrc.d\*.rc, but
only because the .d files not would be read at all if a Mercurial.ini was
found. The ordering in the documentation is thus changed to match the code.
2015-10-12 20:13:12 +02:00
Gregory Szorc
5d1b4c49ee clonebundles: support for seeding clones from pre-generated bundles
Cloning can be an expensive operation for servers because the server
generates a bundle from existing repository data at request time. For
a large repository like mozilla-central, this consumes 4+ minutes
of CPU time on the server. It also results in significant network
utilization. Multiplied by hundreds or even thousands of clients and
the ensuing load can result in difficulties scaling the Mercurial server.

Despite generation of bundles being deterministic until the next
changeset is added, the generation of bundles to service a clone request
is not cached. Each clone thus performs redundant work. This is
wasteful.

This patch introduces the "clonebundles" extension and related
client-side functionality to help alleviate this deficiency. The
client-side feature is behind an experimental flag and is not enabled by
default.

It works as follows:

1) Server operator generates a bundle and makes it available on a
   server (likely HTTP).
2) Server operator defines the URL of a bundle file in a
   .hg/clonebundles.manifest file.
3) Client `hg clone`ing sees the server is advertising bundle URLs.
4) Client fetches and applies the advertised bundle.
5) Client performs equivalent of `hg pull` to fetch changes made since
   the bundle was created.

Essentially, the server performs the expensive work of generating a
bundle once and all subsequent clones fetch a static file from
somewhere. Scaling static file serving is a much more manageable
problem than scaling a Python application like Mercurial. Assuming your
repository grows less than 1% per day, the end result is 99+% of CPU
and network load from clones is eliminated, allowing Mercurial servers
to scale more easily. Serving static files also means data can be
transferred to clients as fast as they can consume it, rather than as
fast as servers can generate it. This makes clones faster.

Mozilla has implemented similar functionality of this patch on
hg.mozilla.org using a custom extension. We are hosting bundle files in
Amazon S3 and CloudFront (a CDN) and have successfully offloaded
>1 TB/day in data transfer from hg.mozilla.org, freeing up significant
bandwidth and CPU resources. The positive impact has been stellar and
I believe it has proved its value to be included in Mercurial core. I
feel it is important for the client-side support to be enabled in core
by default because it means that clients will get faster, more reliable
clones and will enable server operators to reduce load without
requiring any client-side configuration changes (assuming clients are
up to date, of course).

The scope of this feature is narrowly and specifically tailored to
cloning, despite "serve pulls from pre-generated bundles" being a valid
and useful feature. I would eventually like for Mercurial servers to
support transferring *all* repository data via statically hosted files.
You could imagine a server that siphons all pushed data to bundle files
and instructs clients to apply a stream of bundles to reconstruct all
repository data. This feature, while useful and powerful, is
significantly more work to implement because it requires the server
component have awareness of discovery and a mapping of which changesets
are in which files. Full, clone bundles, by contrast, are much simpler.

The wire protocol command is named "clonebundles" instead of something
more generic like "staticbundles" to leave the door open for a new, more
powerful and more generic server-side component with minimal backwards
compatibility implications. The name "bundleclone" is used by Mozilla's
extension and would cause problems since there are subtle differences
in Mozilla's extension.

Mozilla's experience with this idea has taught us that some form of
"content negotiation" is required. Not all clients will support all
bundle formats or even URLs (advanced TLS requirements, etc). To ensure
the highest uptake possible, a server needs to advertise multiple
versions of bundles and clients need to be able to choose the most
appropriate from that list one. The "attributes" in each
server-advertised entry facilitate this filtering and sorting. Their
use will become apparent in subsequent patches.

Initial inspiration and credit for the idea of cloning from static files
belongs to Augie Fackler and his "lookaside clone" extension proof of
concept.
2015-10-09 11:22:01 -07:00
Matt Mackall
5e1b4ad958 urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
timeless@mozdev.org
e7c8225164 help: add config.troubleshooting section at the top 2015-09-24 14:45:17 -04:00
Kevin Bullock
55b433ef64 help: copy-edit description of ui.supportcontact 2015-09-22 15:10:24 -05:00
timeless@mozdev.org
ed7f1d1663 help/config: reword committemplate external editor text 2015-09-04 05:40:52 -04:00
timeless@mozdev.org
59c061a8d6 help/config: reword committemplate multibyte character text 2015-09-04 05:40:37 -04:00
timeless@mozdev.org
11a62cdebb help/config: use :hg:help config.... notation 2015-08-28 15:43:14 -04:00
timeless@mozdev.org
a92c1c739a help/config: omit True or False 2015-08-28 15:24:58 -04:00
timeless@mozdev.org
37e4b0effc help/config: capitalize items 2015-08-28 15:13:28 -04:00
Pierre-Yves David
4595c06fb1 traceback: allow providing a local support contact point
The extensions blaming code is fine for casual users but pretty terrible for
corporate environments that can deploy a large amount of extensions to
unsuspecting users. Reports will likely blame a random "innocent" extension (in
our case crecord) and the hint in the message will triggers endless debug
attempts from the user.

We introduce a "ui.supportcontact" option that allow such big company to redirect
their users to their own support desk. This disables all extensions blaming and
just point people to the local support in all cases.
2015-09-11 12:45:19 -07:00
Augie Fackler
f68e607993 help/config: back out dc22f967e9b0
This breaks building manpages, and by association breaks building
debs. timeless has a fix coming, but it turns out we'll need to back
out dc22f967e9b0 anyway, so just back it out now to fix building
packages.
2015-09-10 13:45:00 -04:00
timeless@mozdev.org
5dce21bc0b help/config: make defaults consistent 2015-09-02 13:39:46 -04:00
timeless@mozdev.org
a5ccdf8bf5 help/config: reword allow_push to fix grammar 2015-09-02 02:05:32 -04:00
timeless@mozdev.org
46737cf254 help/config: change local_hostname help style 2015-09-02 02:05:04 -04:00
timeless@mozdev.org
72986f8a79 help/config: include check values 2015-09-02 02:04:45 -04:00
timeless@mozdev.org
2d3f8ecba7 help/config: simplify default text 2015-09-02 02:04:22 -04:00
timeless@mozdev.org
8b66a4c8a8 help/config: add trailing periods 2015-09-02 02:03:55 -04:00
timeless@mozdev.org
9685343556 help/config: alias, ui.mergemarkertemplate add period for etc. 2015-09-02 02:03:22 -04:00
timeless@mozdev.org
c48a587b8a help/config: add blank lines 2015-09-02 02:02:58 -04:00
timeless@mozdev.org
803dbc2b35 help: config indent committemplate.changeset section 2015-09-04 05:42:21 -04:00
Gregory Szorc
6e680ddd62 hgweb: make refresh interval configurable
hgwebdir refreshes the set of known repositories periodically. This
is necessary because refreshing on every request could add significant
request latency.

More than once I've found myself wanting to tweak this interval at
Mozilla. I've also wanted the ability to always refresh (often when
writing tests for our replication setup).

This patch makes the refresh interval configurable. Negative values
indicate to always refresh. The default is left unchanged.
2015-08-22 22:59:51 -07:00
Matt Mackall
cb0d66d090 hgweb: document web.certificates option 2015-07-18 14:18:31 -05:00
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
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
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
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
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
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
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
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
Wagner Bruna
6791cdb7aa help/config: fix typo 2014-10-23 12:28:00 -02:00