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