doc/evolve-tutorial.rst
changeset 152 54c67d7f9eed
child 156 3c4826fb374a
equal deleted inserted replaced
151:e73944b6be8f 152:54c67d7f9eed
       
     1 ========================================
       
     2 Introduction to the evolution extension
       
     3 ========================================
       
     4 
       
     5 An history rewriting extension
       
     6 
       
     7 * Using the obsolete marker concept
       
     8 
       
     9 * Inspired from mq
       
    10 
       
    11 it is simple to enable::
       
    12 
       
    13     $ hg clone http://hg-dev.octopoid.net/hgwebdir.cgi/mutable-history/
       
    14     $ mutable-history/enable.sh > ~/.hgrc
       
    15 
       
    16 
       
    17 
       
    18 Quick Guide
       
    19 =====================================================================
       
    20 
       
    21 
       
    22 
       
    23 Add a changeset: ``commit``
       
    24 ------------------------------------------------------------
       
    25 
       
    26 Just use commit as usual.
       
    27 
       
    28 Rewrite a changeset: ``amend``
       
    29 ------------------------------------------------------------
       
    30 
       
    31 A new command ``hg amend`` is added by the extension. it write a new changeset
       
    32 combining working-directory parent changes and working directory parent changes.
       
    33 
       
    34 To understand what the result of amend will be I do use the two following
       
    35 aliases  [#]_::
       
    36 
       
    37     # diff what amend will look likes
       
    38     pdiff=diff --rev .^
       
    39 
       
    40     # status what amend will look likes
       
    41     pstatus=status --rev .^
       
    42 
       
    43 It take various options to choose the user, the date and the branch of the
       
    44 result. see ``hg help amend for detail``
       
    45 
       
    46 This command can be invoqued on any mutable changeset even changeset with
       
    47 children !
       
    48 
       
    49 
       
    50 .. note:: the amend command is very similar to mq's ``qrefresh``, a ``refresh``
       
    51           alias for amend is also available. But note that contrary to
       
    52           ``qrefresh``, ``amend`` does not exclude changes on file not specified
       
    53           on the command line.
       
    54 
       
    55           XXX add idank example
       
    56 
       
    57 
       
    58 .. [#] (added by enable.sh)
       
    59 
       
    60 
       
    61 
       
    62 Move a changeset: ``graft``
       
    63 ------------------------------------------------------------
       
    64 
       
    65 the graft command introduced in 2.0 allows to "copy changes from other branches
       
    66 onto the current branch"
       
    67 
       
    68 The graft command have been altered to be able to create an obsolete marker from
       
    69 the copy result to the copy source, acting like changeset movement operation.
       
    70 This is achieved using a new flag `-O` (or `old-obsolete`) [#]_.
       
    71 
       
    72 
       
    73 XXX example
       
    74 
       
    75 .. warning:: when using graft --continue after conflict resolution you **MUST**
       
    76              pass `-O` or `-o` flag again because they are not saved for now
       
    77 
       
    78 
       
    79 .. [#] add this `-O` to graft instead of a dedicated command is probably
       
    80        abusive. But this was very convenient for experimental purpose.
       
    81        This will likely change in non experimental release.
       
    82 
       
    83 Delete a changeset: ``kill``
       
    84 ------------------------------------------------------------
       
    85 
       
    86 A new ``kill`` command allow to remove a changeset.
       
    87 
       
    88 Just use ``hg kill <some-rev>``.
       
    89 
       
    90 Moving within the history: ``up`` ``gdown`` and ``gup``
       
    91 ------------------------------------------------------------
       
    92 
       
    93 While working on mutable part of the history you often need to move between
       
    94 mutable commit.
       
    95 
       
    96 You just need to use standard update to work with evolve. For convenience, you
       
    97 can use ``hg gup`` to move to children commit or ``hg gdown`` to move to working
       
    98 directory parent commit.
       
    99 
       
   100 .. note:: those command only exist for the convenience of getting qpush and qpop
       
   101           feeling back.
       
   102 
       
   103           They are 
       
   104 
       
   105 collapse changesets: ``amend``
       
   106 ------------------------------------------------------------
       
   107 
       
   108 you can use amend -c to collapse multiple changeset in a single one.
       
   109 
       
   110 Move multiple changesets: ``rebase``
       
   111 ------------------------------------------------------------
       
   112 
       
   113 You can still use rebase to move whole part of the changeset graph at once.
       
   114 
       
   115 .. warning:: Beware that rebasing obsolete changeset will result in new
       
   116              conflicting version.
       
   117 
       
   118 Stabilize history: ``stabilize``
       
   119 ------------------------------------------------------------
       
   120 
       
   121 When you rewrite changeset with children without rewriting those children you
       
   122 create *unstable* changeset and *suspended obsolete* changeset
       
   123 
       
   124 .. warning:: ``hg stabilize`` have no --continue to use after conflict
       
   125              resolution
       
   126 
       
   127 .. warning:: stabilization does not handle deletion yet.
       
   128 
       
   129 .. warning:: obsolete currently rely on secret changeset to not exchange
       
   130              obsolete and unstable changeset.
       
   131 
       
   132              XXX details issue here
       
   133 
       
   134 
       
   135 Fix my history afterward: ``kill -n``
       
   136 ------------------------------------------------------------
       
   137 
       
   138 sometime you need to create obsolete marker by hand. This may happen when
       
   139 upstream applied some of you patches for example.
       
   140 
       
   141 you can use ``hg kill --new <new-changeset> <old-changeset>`` to add obsolete
       
   142 marker.
       
   143 
       
   144 export to mq: ``synchronize``
       
   145 ------------------------------------------------------------
       
   146 
       
   147 Another extension allows to export 
       
   148 
       
   149 view change to your file
       
   150 ------------------------------------------------------------
       
   151 
       
   152 Another extension allows to export 
       
   153 
       
   154 view diff from the last amend
       
   155 ------------------------------------------------------------
       
   156 
       
   157 an odiff alias have been added by enable.sh
       
   158 
       
   159 :: 
       
   160     [alias]
       
   161     odiff = diff --rev 'limit(obsparents(.),1)' --rev .
       
   162 
       
   163 view obsolete marker
       
   164 ------------------------------------------------------------
       
   165 
       
   166 hgview is the only viewer that support this feature. you need an experimental
       
   167 version available here:
       
   168 
       
   169     $ hg clone http://hg-dev.octopoid.net/hgwebdir.cgi/hgview/
       
   170 
       
   171 Important Note
       
   172 =====================================================================
       
   173 
       
   174 view change to your file
       
   175 ------------------------------------------------------------
       
   176 
       
   177 extinct changeset are hidden using the *hidden* feature of mercurial.
       
   178 
       
   179 only hg log and hgview support it. hg glog or other visual viewer don't.
       
   180 
       
   181 
       
   182 
       
   183 
       
   184 
       
   185 
       
   186 
       
   187 
       
   188 
       
   189