##// END OF EJS Templates
help: add examples to phases topic
Matt Mackall -
r16011:f2c49d9d stable
parent child Browse files
Show More
@@ -1,61 +1,80 b''
1 What are phases?
1 What are phases?
2 ----------------
2 ----------------
3
3
4 Phases are a system for tracking which changesets have been or should
4 Phases are a system for tracking which changesets have been or should
5 be shared. This helps prevent common mistakes when modifying history
5 be shared. This helps prevent common mistakes when modifying history
6 (for instance, with the mq or rebase extensions).
6 (for instance, with the mq or rebase extensions).
7
7
8 Each changeset in a repository is in one of the following phases:
8 Each changeset in a repository is in one of the following phases:
9
9
10 - public : changeset is visible on a public server
10 - public : changeset is visible on a public server
11 - draft : changeset is not yet published
11 - draft : changeset is not yet published
12 - secret : changeset should not be pushed, pulled, or cloned
12 - secret : changeset should not be pushed, pulled, or cloned
13
13
14 These phases are ordered (public < draft < secret) and no changeset
14 These phases are ordered (public < draft < secret) and no changeset
15 can be in a lower phase than its ancestors. For instance, if a
15 can be in a lower phase than its ancestors. For instance, if a
16 changeset is public, all its ancestors are also public. Lastly,
16 changeset is public, all its ancestors are also public. Lastly,
17 changeset phases only be changed towards the public phase.
17 changeset phases only be changed towards the public phase.
18
18
19 How are phases managed?
19 How are phases managed?
20 -----------------------
20 -----------------------
21
21
22 For the most part, phases should work transparently. By default, a
22 For the most part, phases should work transparently. By default, a
23 changeset is created in the draft phase and is moved into the public
23 changeset is created in the draft phase and is moved into the public
24 phase when it is pushed to another repository.
24 phase when it is pushed to another repository.
25
25
26 Once changesets become public, extensions like mq and rebase will
26 Once changesets become public, extensions like mq and rebase will
27 refuse to operate on them to prevent creating duplicate changesets.
27 refuse to operate on them to prevent creating duplicate changesets.
28 Phases can also be manually manipulated with the :hg:`phase` command
28 Phases can also be manually manipulated with the :hg:`phase` command
29 if needed. See :hg:`help -v phase` for examples.
29 if needed. See :hg:`help -v phase` for examples.
30
30
31 Phases and servers
31 Phases and servers
32 ------------------
32 ------------------
33
33
34 Normally, all servers are ``publishing`` by default. This means::
34 Normally, all servers are ``publishing`` by default. This means::
35
35
36 - all draft changesets that are pulled or cloned appear in phase
36 - all draft changesets that are pulled or cloned appear in phase
37 public on the client
37 public on the client
38
38
39 - all draft changesets that are pushed appear as public on both
39 - all draft changesets that are pushed appear as public on both
40 client and server
40 client and server
41
41
42 - secret changesets are neither pushed, pulled, or cloned
42 - secret changesets are neither pushed, pulled, or cloned
43
43
44 .. note::
44 .. note::
45 Pulling a draft changeset from a publishing server does not mark it
45 Pulling a draft changeset from a publishing server does not mark it
46 as public on the server side due to the read-only nature of pull.
46 as public on the server side due to the read-only nature of pull.
47
47
48 Sometimes it may be desirable to push and pull changesets in the draft
48 Sometimes it may be desirable to push and pull changesets in the draft
49 phase to share unfinished work. This can be done by setting a
49 phase to share unfinished work. This can be done by setting a
50 repository to disable publishing in its configuration file::
50 repository to disable publishing in its configuration file::
51
51
52 [phases]
52 [phases]
53 publish = False
53 publish = False
54
54
55 See :hg:`help config` for more information on config files.
55 See :hg:`help config` for more information on config files.
56
56
57 .. note::
57 .. note::
58 Servers running older versions of Mercurial are treated as
58 Servers running older versions of Mercurial are treated as
59 publishing.
59 publishing.
60
60
61 See :hg:`help phase` for information on manually manipulating phases.
61 Examples
62 --------
63
64 - list changesets in draft or secret phase::
65
66 hg log -r "not public()"
67
68 - change all secret changesets to draft::
69
70 hg phase --draft "secret()"
71
72 - forcibly move the current changeset and descendants from public to draft::
73
74 hg phase --force --draft .
75
76 - show a list of changeset revision and phase::
77
78 hg log --template "{rev} {phase}\n"
79
80 See :hg:`help phase` for more information on manually manipulating phases.
General Comments 0
You need to be logged in to leave comments. Login now