docs/from-mq.rst
changeset 2020 143c8e4dc22d
parent 1654 d1c5d80b2ace
child 3599 5a796d753427
equal deleted inserted replaced
2019:996a562b6c9f 2020:143c8e4dc22d
       
     1 .. Copyright 2011 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
       
     2 ..                Logilab SA        <contact@logilab.fr>
       
     3 
       
     4 -----------------------------------
       
     5 From MQ To Evolve, The Refugee Book
       
     6 -----------------------------------
       
     7 
       
     8 Cheat sheet
       
     9 -----------
       
    10 
       
    11 ==============================  ============================================
       
    12 mq command                       new equivalent
       
    13 ==============================  ============================================
       
    14 qseries                         ``log``
       
    15 qnew                            ``commit``
       
    16 qrefresh                        ``amend``
       
    17 qrefresh --exclude              ``uncommit``
       
    18 qpop                            ``update`` or ``gdown``
       
    19 qpush                           ``update`` or ``gup`` sometimes ``evolve``
       
    20 qrm                             ``prune``
       
    21 qfold                           ``fold``
       
    22 qdiff                           ``odiff``
       
    23 qrecord                         ``record``
       
    24 
       
    25 qfinish                         --
       
    26 qimport                         --
       
    27 ==============================  ============================================
       
    28 
       
    29 
       
    30 Replacement details
       
    31 -------------------
       
    32 
       
    33 hg qseries
       
    34 ``````````
       
    35 
       
    36 All your work in progress is now in real changesets all the time.
       
    37 
       
    38 You can use the standard log command to display them. You can use the
       
    39 phase revset to display unfinished work only, and use templates to have
       
    40 the same kind of compact that the output of qseries has.
       
    41 
       
    42 This will result in something like::
       
    43 
       
    44   [alias]
       
    45   wip = log -r 'not public()' --template='{rev}:{node|short} {desc|firstline}\n'
       
    46 
       
    47 hg qnew
       
    48 ```````
       
    49 
       
    50 With evolve you handle standard changesets without an additional overlay.
       
    51 
       
    52 Standard changeset are created using hg commit as usual::
       
    53 
       
    54   $ hg commit
       
    55 
       
    56 If you want to keep the "WIP is not pushed" behavior, you want to
       
    57 set your changeset in the secret phase using the phase command.
       
    58 
       
    59 Note that you only need it for the first commit you want to be secret. Later
       
    60 commits will inherit their parent's phase.
       
    61 
       
    62 If you always want your new commit to be in the secret phase, your should
       
    63 consider updating your configuration:
       
    64 
       
    65   [phases]
       
    66   new-commit=secret
       
    67 
       
    68 hg qref
       
    69 ```````
       
    70 
       
    71 A new command from evolution will allow you to rewrite the changeset you are
       
    72 currently on. Just call:
       
    73 
       
    74   $ hg amend
       
    75 
       
    76 This command takes the same options as commit, plus the switch '-e' (--edit)
       
    77 to edit the commit message in an editor.
       
    78 
       
    79 
       
    80 .. -c is very confusig
       
    81 ..
       
    82 .. The amend command also has a -c switch which allows you to make an
       
    83 .. explicit amending commit before rewriting a changeset.::
       
    84 ..
       
    85 ..   $ hg record -m 'feature A'
       
    86 ..   # oups, I forgot some stuff
       
    87 ..   $ hg record babar.py
       
    88 ..   $ hg amend -c .^ # .^ refer to "working directory parent, here 'feature A'
       
    89 
       
    90 .. note: refresh is an alias for amend
       
    91 
       
    92 hg qref --exclude
       
    93 `````````````````
       
    94 
       
    95 To remove changes from your current commit use::
       
    96 
       
    97   $ hg uncommit not-ready.txt
       
    98 
       
    99 
       
   100 hg qpop
       
   101 ```````
       
   102 
       
   103 The following command emulates the behavior of hg qpop:
       
   104 
       
   105   $ hg gdown
       
   106 
       
   107 If you need to go back to an arbitrary commit you can use:
       
   108 
       
   109   $ hg update
       
   110 
       
   111 .. note:: gdown and update allow movement with working directory
       
   112           changes applied, and gracefully merge them.
       
   113 
       
   114 hg qpush
       
   115 ````````
       
   116 
       
   117 When you rewrite changesets, descendants of rewritten changesets are marked as
       
   118 "unstable". You need to rewrite them on top of the new version of their
       
   119 ancestor.
       
   120 
       
   121 The evolution extension adds a command to rewrite "unstable"
       
   122 changesets:::
       
   123 
       
   124   $ hg evolve
       
   125 
       
   126 You can also decide to do it manually using::
       
   127 
       
   128   $ hg graft -O <old-version>
       
   129 
       
   130 or::
       
   131 
       
   132   $ hg rebase -r <revset for old version> -d .
       
   133 
       
   134 note: using graft allows you to pick the changeset you want next as the --move
       
   135 option of qpush do.
       
   136 
       
   137 
       
   138 hg qrm
       
   139 ``````
       
   140 
       
   141 evolution introduce a new command to mark a changeset as "not wanted anymore".::
       
   142 
       
   143   $ hg prune <revset>
       
   144 
       
   145 hg qfold
       
   146 ````````
       
   147 
       
   148 
       
   149 ::
       
   150 
       
   151   $ hg fold first::last
       
   152 
       
   153 hg qdiff
       
   154 ````````
       
   155 
       
   156 ``pdiff`` is an alias for `hg diff -r .^` It works like qdiff, but outside MQ.
       
   157 
       
   158 
       
   159 
       
   160 hg qfinish and hg qimport
       
   161 `````````````````````````
       
   162 
       
   163 These are not necessary anymore. If you want to control the
       
   164 mutability of changesets, see the phase feature.
       
   165 
       
   166 
       
   167 
       
   168 hg qcommit
       
   169 ``````````
       
   170 
       
   171 If you really need to send patches through versioned mq patches, you should
       
   172 look at the qsync extension.