mercurial/help/phases.txt
author Matt Mackall <mpm@selenic.com>
Mon, 30 Jan 2012 16:37:15 -0600
branchstable
changeset 16041 6a959318c58e
parent 16011 f2c49d9dee57
child 16244 3d26d69ef822
permissions -rw-r--r--
phases: add resync example to help topic
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?
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     2
----------------
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,
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    17
changeset phases only be changed towards the public phase.
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?
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    20
-----------------------
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
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    31
Phases and servers
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    32
------------------
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    33
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    34
Normally, all servers are ``publishing`` by default. This means::
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    35
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    36
 - all draft changesets that are pulled or cloned appear in phase
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    37
 public on the client
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    38
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    39
 - all draft changesets that are pushed appear as public on both
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    40
 client and server
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
 - secret changesets are neither pushed, pulled, or cloned
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    43
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    44
.. note::
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    45
  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
    46
  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
    47
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    48
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
    49
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
    50
repository to disable publishing in its configuration file::
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    51
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    52
  [phases]
16000
25fa240139cb help: fix publish option spelling in phases topic
Matt Mackall <mpm@selenic.com>
parents: 15998
diff changeset
    53
  publish = False
15998
916de764b4f6 help/phases: remove trailing whitespace
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 15996
diff changeset
    54
15996
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    55
See :hg:`help config` for more information on config files.
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    56
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    57
.. note::
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    58
  Servers running older versions of Mercurial are treated as
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    59
  publishing.
0455463655e0 help: add phases topic
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    60
16011
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    61
Examples
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    62
--------
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    63
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    64
 - list changesets in draft or secret phase::
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    65
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    66
     hg log -r "not public()"
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    67
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    68
 - change all secret changesets to draft::
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    69
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    70
     hg phase --draft "secret()"
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    71
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    72
 - 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
    73
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    74
     hg phase --force --draft .
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    75
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    76
 - show a list of changeset revision and phase::
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    77
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    78
     hg log --template "{rev} {phase}\n"
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    79
16041
6a959318c58e phases: add resync example to help topic
Matt Mackall <mpm@selenic.com>
parents: 16011
diff changeset
    80
 - 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
    81
6a959318c58e phases: add resync example to help topic
Matt Mackall <mpm@selenic.com>
parents: 16011
diff changeset
    82
     hg phase -fd 'outgoing(URL)' 
6a959318c58e phases: add resync example to help topic
Matt Mackall <mpm@selenic.com>
parents: 16011
diff changeset
    83
16011
f2c49d9dee57 help: add examples to phases topic
Matt Mackall <mpm@selenic.com>
parents: 16000
diff changeset
    84
See :hg:`help phase` for more information on manually manipulating phases.