mercurial/help/phases.txt
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 24 Dec 2016 15:29:32 -0700
changeset 30764 e75463e3179f
parent 27514 311eddddca49
child 34948 ff178743e59b
permissions -rw-r--r--
protocol: send application/mercurial-0.2 responses to capable clients With this commit, the HTTP transport now parses the X-HgProto-<N> header to determine what media type and compression engine to use for responses. So far, we only compress responses that are already being compressed with zlib today (stream response types to specific commands). We can expand things to cover additional response types later. The practical side-effect of this commit is that non-zlib compression engines will be used if both ends support them. This means if both ends have zstd support, zstd - not zlib - will be used to compress data! When cloning the mozilla-unified repository between a local HTTP server and client, the benefits of non-zlib compression are quite noticeable: engine server CPU (s) client CPU (s) bundle size zlib (l=6) 174.1 283.2 1,148,547,026 zstd (l=1) 99.2 267.3 1,127,513,841 zstd (l=3) 103.1 266.9 1,018,861,363 zstd (l=7) 128.3 269.7 919,190,278 zstd (l=10) 162.0 - 894,547,179 none 95.3 277.2 4,097,566,064 The default zstd compression level is 3. So if you deploy zstd capable Mercurial to your clients and servers and CPU time on your server is dominated by "getbundle" requests (clients cloning and pulling) - and my experience at Mozilla tells me this is often the case - this commit could drastically reduce your server-side CPU usage *and* save on bandwidth costs! Another benefit of this change is that server operators can install *any* compression engine. While it isn't enabled by default, the "none" compression engine can now be used to disable wire protocol compression completely. Previously, commands like "getbundle" always zlib compressed output, adding considerable overhead to generating responses. If you are on a high speed network and your server is under high load, it might be advantageous to trade bandwidth for CPU. Although, zstd at level 1 doesn't use that much CPU, so I'm not convinced that disabling compression wholesale is worthwhile. And, my data seems to indicate a slow down on the client without compression. I suspect this is due to a lack of buffering resulting in an increase in socket read() calls and/or the fact we're transferring an extra 3 GB of data (parsing HTTP chunked transfer and processing extra TCP packets can add up). This is definitely worth investigating and optimizing. But since the "none" compressor isn't enabled by default, I'm inclined to punt on this issue. This commit introduces tons of tests. Some of these should arguably have been implemented on previous commits. But it was difficult to test without the server functionality in place.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     1
What are phases?
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16244
diff changeset
     2
================
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     3
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     4
Phases are a system for tracking which changesets have been or should
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     5
be shared. This helps prevent common mistakes when modifying history
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     6
(for instance, with the mq or rebase extensions).
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     7
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     8
Each changeset in a repository is in one of the following phases:
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     9
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    10
 - public : changeset is visible on a public server
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    11
 - draft : changeset is not yet published
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    12
 - secret : changeset should not be pushed, pulled, or cloned
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    13
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    14
These phases are ordered (public < draft < secret) and no changeset
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    15
can be in a lower phase than its ancestors. For instance, if a
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    16
changeset is public, all its ancestors are also public. Lastly,
16244
3d26d69ef822 help: add verb to sentence in phases.txt
Johan Samyn <johan.samyn@gmail.com>
parents: 16041
diff changeset
    17
changeset phases should only be changed towards the public phase.
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    18
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    19
How are phases managed?
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16244
diff changeset
    20
=======================
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    21
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    22
For the most part, phases should work transparently. By default, a
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    23
changeset is created in the draft phase and is moved into the public
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    24
phase when it is pushed to another repository.
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    25
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    26
Once changesets become public, extensions like mq and rebase will
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    27
refuse to operate on them to prevent creating duplicate changesets.
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    28
Phases can also be manually manipulated with the :hg:`phase` command
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    29
if needed. See :hg:`help -v phase` for examples.
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    30
27514
311eddddca49 phases: mention how to make secret commits in help
timeless <timeless@mozdev.org>
parents: 20532
diff changeset
    31
To make yours commits secret by default, put this in your
311eddddca49 phases: mention how to make secret commits in help
timeless <timeless@mozdev.org>
parents: 20532
diff changeset
    32
configuration file::
311eddddca49 phases: mention how to make secret commits in help
timeless <timeless@mozdev.org>
parents: 20532
diff changeset
    33
311eddddca49 phases: mention how to make secret commits in help
timeless <timeless@mozdev.org>
parents: 20532
diff changeset
    34
  [phases]
311eddddca49 phases: mention how to make secret commits in help
timeless <timeless@mozdev.org>
parents: 20532
diff changeset
    35
  new-commit = secret
311eddddca49 phases: mention how to make secret commits in help
timeless <timeless@mozdev.org>
parents: 20532
diff changeset
    36
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    37
Phases and servers
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16244
diff changeset
    38
==================
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    39
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    40
Normally, all servers are ``publishing`` by default. This means::
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    41
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    42
 - all draft changesets that are pulled or cloned appear in phase
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    43
 public on the client
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    44
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    45
 - all draft changesets that are pushed appear as public on both
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    46
 client and server
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    47
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    48
 - secret changesets are neither pushed, pulled, or cloned
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    49
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    50
.. note::
20532
f1a3ae7c15df help: remove last occurrences of ".. note::" without two newlines
Simon Heimberg <simohe@besonet.ch>
parents: 20299
diff changeset
    51
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    52
  Pulling a draft changeset from a publishing server does not mark it
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    53
  as public on the server side due to the read-only nature of pull.
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    54
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    55
Sometimes it may be desirable to push and pull changesets in the draft
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    56
phase to share unfinished work. This can be done by setting a
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    57
repository to disable publishing in its configuration file::
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    58
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    59
  [phases]
16000
25fa240139cb help: fix publish option spelling in phases topic
Matt Mackall <mpm@selenic.com>
parents: 15998
diff changeset
    60
  publish = False
15998
916de764b4f6 help/phases: remove trailing whitespace
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 15996
diff changeset
    61
19295
73066ba46ec5 doc: reword "config file" to "configuration file"
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 18960
diff changeset
    62
See :hg:`help config` for more information on configuration files.
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    63
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    64
.. note::
20532
f1a3ae7c15df help: remove last occurrences of ".. note::" without two newlines
Simon Heimberg <simohe@besonet.ch>
parents: 20299
diff changeset
    65
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    66
  Servers running older versions of Mercurial are treated as
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    67
  publishing.
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    68
20299
b4b77909318f phases: add a formal note that hash of secret changeset may leak out
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19959
diff changeset
    69
.. note::
20532
f1a3ae7c15df help: remove last occurrences of ".. note::" without two newlines
Simon Heimberg <simohe@besonet.ch>
parents: 20299
diff changeset
    70
20299
b4b77909318f phases: add a formal note that hash of secret changeset may leak out
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19959
diff changeset
    71
   Changesets in secret phase are not exchanged with the server. This
b4b77909318f phases: add a formal note that hash of secret changeset may leak out
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19959
diff changeset
    72
   applies to their content: file names, file contents, and changeset
b4b77909318f phases: add a formal note that hash of secret changeset may leak out
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19959
diff changeset
    73
   metadata. For technical reasons, the identifier (e.g. d825e4025e39)
b4b77909318f phases: add a formal note that hash of secret changeset may leak out
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19959
diff changeset
    74
   of the secret changeset may be communicated to the server.
b4b77909318f phases: add a formal note that hash of secret changeset may leak out
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19959
diff changeset
    75
b4b77909318f phases: add a formal note that hash of secret changeset may leak out
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 19959
diff changeset
    76
16011
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    77
Examples
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16244
diff changeset
    78
========
16011
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    79
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    80
 - list changesets in draft or secret phase::
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    81
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    82
     hg log -r "not public()"
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    83
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    84
 - change all secret changesets to draft::
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    85
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    86
     hg phase --draft "secret()"
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    87
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    88
 - forcibly move the current changeset and descendants from public to draft::
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    89
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    90
     hg phase --force --draft .
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    91
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    92
 - show a list of changeset revision and phase::
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    93
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    94
     hg log --template "{rev} {phase}\n"
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    95
16041
6a959318c58e phases: add resync example to help topic
Matt Mackall <mpm@selenic.com>
parents: 16011
diff changeset
    96
 - resynchronize draft changesets relative to a remote repository::
6a959318c58e phases: add resync example to help topic
Matt Mackall <mpm@selenic.com>
parents: 16011
diff changeset
    97
19959
9ef92384415c doc: use double quotation mark to quote arguments in examples for Windows users
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19295
diff changeset
    98
     hg phase -fd "outgoing(URL)"
16041
6a959318c58e phases: add resync example to help topic
Matt Mackall <mpm@selenic.com>
parents: 16011
diff changeset
    99
16011
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
   100
See :hg:`help phase` for more information on manually manipulating phases.