README
changeset 35 0f98f87881bd
parent 34 f28116682827
child 36 6531b01b2763
equal deleted inserted replaced
34:f28116682827 35:0f98f87881bd
     1 =============================
     1 =============================
     2 Mutable History For Mercurial
     2 Mutable History For Mercurial
     3 =============================
     3 =============================
     4 
     4 
     5 This repository hold several experimental extension that introduce concept
     5 This repository holds three experimental extensions that introduce concepts
     6 related to history rewriting in mercurial. You will find three different
     6 related to history rewriting in mercurial.
     7 extensions.
       
     8 
     7 
     9 :states:
     8 :states:
    10 
     9 
    11     Introduce a state concept. It allow to track which changeset have been make
    10     Introduce a state concept. It allows to track which changesets have been
    12     public and immutable and which you want to keep local.
    11     made public and immutable and which you want to keep local.
    13 
    12 
    14 :obsolete:
    13 :obsolete:
    15 
    14 
    16     Introduce an obsolete concept that track new version of rewritten changeset.
    15     Introduce an ``obsolete`` concept that tracks new versions of rewritten
       
    16     changesets.
    17 
    17 
    18 :rewrite:
    18 :rewrite:
    19     A collection of command to rewrite the mutable part of the history.
    19     A collection of commands to rewrite the mutable part of the history.
    20 
    20 
    21 
    21 
    22 
    22 
    23 **These extensions are experimental and are not meant for production.**
    23 **These extensions are experimental and are not meant for production.**
    24 
    24 
    25 
    25 
    26 States Extension
    26 States Extension
    27 ======================
    27 ================
    28 
    28 
    29 state: experimentally functional
    29 state: experimentally functional
    30 
    30 
    31 (see http://mercurial.selenic.com/wiki/StatesPlan)
    31 (see http://mercurial.selenic.com/wiki/StatesPlan)
    32 
    32 
    33 This extension the state concept. A changeset now have one of the following *state*:
    33 This extension adds the state concept. A changeset now has one of the following
       
    34 *states*:
    34 
    35 
    35 :published:
    36 :published:
    36 
    37 
    37     Changeset in the ``published`` state are the core of the history.  They are
    38     Changesets in the ``published`` state are the core of the history.  They are
    38     changeset that you published to the world. People can expect them to always
    39     changesets that you published to the world. People can expect them to always
    39     be exist. This is changeset as you know them. **By default all changeset
    40     exist. They are changesets as you know them. **By default all changesets
    40     are published**
    41     are published**
    41 
    42 
    42     * They are exchanged with other repository (included in pull//push).
    43     * They are exchanged with other repositories (included in pull//push).
    43 
    44 
    44     * They are not mutable, extension rewriting history should refuse to
    45     * They are not mutable, extensions rewriting history should refuse to
    45       rewrite them.
    46       rewrite them.
    46 
    47 
    47 :ready:
    48 :ready:
    48 
    49 
    49     Changeset in the ``ready`` state have not been accepted in the immutable
    50     Changesets in the ``ready`` state have not yet been accepted in the
    50     history yet. You can share them with other for review, testing or
    51     immutable history. You can share them with others for review, testing or
    51     improvement. Any ``ready`` changeset can either be included in the
    52     improvement. Any ``ready`` changeset can either be included in the
    52     published history (and become immutable) or be rewritten and rever make it
    53     published history (and become immutable) or be rewritten and never make it
    53     the published history.
    54     to the published history.
    54 
    55 
    55     * They are exchanged with other repository (included in pull//push).
    56     * They are exchanged with other repositories (included in pull//push).
    56     * They are mutable, extension rewriting history accept to work on them.
    57     * They are mutable, extensions rewriting history accept to work on them.
    57 
    58 
    58 :draft:
    59 :draft:
    59 
    60 
    60     Changeset in the ``draft`` state are heavy work in progress you are
    61     Changesets in the ``draft`` state are heavy work in progress you are not
    61     currently working on without willing to share with other.
    62     yet willing to share with others.
    62 
    63 
    63     * They are not exchanged with other repository. pull//push does not see them.
    64     * They are not exchanged with other repositories. pull//push do not see them.
    64     * They are mutable, extension rewriting history accept to work on them.
    65     * They are mutable, extensions rewriting history accept to work on them.
    65 
    66 
    66 
    67 
    67 State of changeset have to be consistent with each other. A ``published``
    68 States of changesets have to be consistent with each other. A ``published``
    68 changeset can only have ``published`` ancestors. A ``ready`` changeset can only
    69 changeset can only have ``published`` ancestors. A ``ready`` changeset can only
    69 have ``published`` or ready ancestor.
    70 have ``published`` or ``ready`` ancestors.
    70 
    71 
    71 
    72 
    72 Usage and Feature
    73 Usage and Feature
    73 ------------------
    74 ------------------
    74 
    75 
    75 By default all changeset in the repository are ``published``. Other state must
    76 By default all changesets in the repository are ``published``. Other states must
    76 be explicitly activated. When a state is not activated, changeset of this state
    77 be explicitly activated. When a state is not activated, changesets in this state
    77 are handled as changeset of the state before him. (``draft`` are handled as
    78 are handled as changesets of the state before it (``draft`` are handled as
    78 ``ready``, ``ready`` are handled as ``published``)
    79 ``ready``, ``ready`` are handled as ``published``).
    79 
    80 
    80 Changeset will automatically move to ``published`` state when:
    81 Changesets will automatically move to ``published`` state when:
    81 
    82 
    82 * pushed to a repo that doesn't support ``ready`` state.
    83 * pushed to a repo that doesn't support the ``ready`` state.
    83 
    84 
    84 * Tagged by a non local tag.
    85 * Tagged by a non local tag.
    85 
    86 
    86 Commands
    87 Commands
    87 ........
    88 ........
    88 
    89 
    89 The extension add and ``hg states`` command to choose which state are used by a
    90 The extension adds a ``hg states`` command to choose which states are used by a
    90 repository, see ``hg help states for details``.
    91 repository, see ``hg help states for details``.
    91 
    92 
    92 A command is also added for all active states. The command have the name of the
    93 A command is also added for each active state. The command has the name of the
    93 states and is used to manually change the state of a changeset. This is mainly
    94 state and is used to manually change the state of a changeset. This is mainly
    94 usefull to move changeset from ``draft`` to ``ready``.:: 
    95 useful to move changesets from ``draft`` to ``ready``.:: 
    95 
    96 
    96     hg ready tip
    97     hg ready tip
    97 
    98 
    98 Template
    99 Template
    99 ........
   100 ........
   100 
   101 
   101 A new template keyword ``{state}`` have been added
   102 A new template keyword ``{state}`` has been added.
   102 
   103 
   103 Revset
   104 Revset
   104 ........
   105 ........
   105 
   106 
   106 We add a new ``readyheads()`` and ``publishedheads()`` revset directive. This return the heads of each states **as if all of them was activated**.
   107 We add new ``readyheads()`` and ``publishedheads()`` revset directives. This
       
   108 returns the heads of each state **as if all of them were activated**.
   107 
   109 
   108 FAQ
   110 FAQ
   109 ---
   111 ---
   110 
   112 
   111 Why to you store activate state ouside ``.hg/hgrc``
   113 Why to you store activate state outside ``.hg/hgrc``?
   112 ....................................................
   114 .....................................................
   113 
   115 
   114 ``.hg/hgrc`` might be ignored for trust reason. we don't want the 
   116 ``.hg/hgrc`` might be ignored for trust reason. we don't want the # XXX
   115 
   117 
   116 Why is the ``dead`` state missing
   118 Why is the ``dead`` state missing?
   117 ....................................................
   119 .....................................................
   118 
   120 
   119 1. The ``dead`` state have a different behaviour that require more work to be
   121 1. The ``dead`` state has a different behaviour that requires more work to be
   120 implemented
   122 implemented.
   121 
   123 
   122 2. I believe that the usecase of ``dead changeset`` are better covered by the
   124 2. I believe that the use cases of ``dead changeset`` are better covered by the
   123 ``obsolete`` extension.
   125 ``obsolete`` extension.
   124 
   126 
   125 To Do
   127 To Do
   126 -----
   128 -----
   127 
   129 
   128 * Moving boundary backward (code existist in ``liquid`` extension done at the
   130 * Moving boundary backward (code exists in the ``liquid`` extension done at the
   129   CPH sprint)
   131   CPH sprint)
   130 
   132 
   131 * support for default value in configuration (when for init and clone)
   133 * support for default value in configuration (for init and clone)
   132 
   134 
   133 * stronger pull//push support (unknown remote head confuse the current code)
   135 * stronger pull//push support (unknown remote heads confuse the current code)
   134 
   136 
   135 * display the number of changeset that change state when activating a state.
   137 * display the number of changesets that change state when activating a state.
   136 
   138 
   137 * have a switch to select if changeset do change state on state activation.
   139 * have a switch to select if changesets do change state on state activation.
   138 
   140 
   139 * proper revset directive.
   141 * proper revset directive.
   140 
   142 
   141 
   143 
   142 
   144 
   144 Obsolete Extension
   146 Obsolete Extension
   145 ======================
   147 ======================
   146 
   148 
   147 state: in progress
   149 state: in progress
   148 
   150 
   149 This extension introduce the *obsolete* concept. It adds a new *obsolete* relation between two changeset. A relation ``<changeset B> obsolete <changeset A>`` is set to denote that ``<changeset B>`` is new version of ``<changeset A>``
   151 This extension introduces the *obsolete* concept. It adds a new *obsolete*
       
   152 relation between two changesets. A relation ``<changeset B> obsolete <changeset
       
   153 A>`` is set to denote that ``<changeset B>`` is new version of ``<changeset
       
   154 A>``.
   150 
   155 
   151 The *obsolete* relation act as a **perpendicular history** to the standard
   156 The *obsolete* relation act as a **perpendicular history** to the standard
   152 changeset history. Standard changeset history versions files. When *obsolete*
   157 changeset history. Standard changeset history versions files. The *obsolete*
   153 relation versions changeset
   158 relation versions changesets.
   154 
   159 
   155 Usage and Feature
   160 Usage and Feature
   156 ------------------
   161 ------------------
   157 
   162 
   158 obsolete changeset are hidden.
   163 obsolete changesets are hidden.
   159 
   164 
   160 Commands
   165 Commands
   161 ........
   166 ........
   162 
   167 
   163 
   168 
   164 a ``debugobsolete`` command have been added.
   169 a ``debugobsolete`` command has been added.
   165 
   170 
   166 
   171 
   167 To Do
   172 To Do
   168 -----
   173 -----
   169 
   174 
   171 
   176 
   172 * handle non-obsolete children
   177 * handle non-obsolete children
   173 
   178 
   174 * exchange the obsolete information
   179 * exchange the obsolete information
   175 
   180 
   176 * refuse to obsolete published changeset
   181 * refuse to obsolete published changesets
   177 
   182 
   178 * handle split
   183 * handle split
   179 
   184 
   180 * handle conflict
   185 * handle conflict
   181 
   186