doc/simple-tuto.t
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 20 Sep 2011 18:17:08 +0200
changeset 93 1b962aaf0c7d
child 95 5dcece86aeb0
permissions -rw-r--r--
docs: Small tutorial
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
93
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
Mutable History and collaboration
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
=====================================================================
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     3
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
History mutation
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
=====================
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     8
.. Albert Beugras
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
.. René de Robert
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    11
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
Here is small introduction of 
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    14
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    15
Single Developer Usage
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    16
======================
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    17
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    18
This tutorial shows how to use evolution to replace the basics of *mq*.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    19
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    20
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    21
Amending a changeset
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    22
---------------------
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    23
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    24
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    25
First there is some setup phase you will understand later.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    26
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    27
there is a local repository and a remote one.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    29
Please close your eyes.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    30
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    31
  $ hg init local
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    32
  $ cat >> local/.hg/hgrc << EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    33
  > [paths]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    34
  > remote = ../remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    35
  > [ui]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
  > user = Albert Beugras
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
  > [diff]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    38
  > git = 1
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    39
  > [alias]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    40
  > amend = amend -d '0 0'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    41
  > tlog = log --template "{node|short}: '{desc}'\n"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    42
  > ttlog = log --template "{node|short}: '{desc}' ({state})\n"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    43
  > tglog = log -G --template "{node|short}: '{desc}' {branches}\n"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    44
  > [extensions]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    45
  > hgext.graphlog=
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    46
  > hgext.rebase=
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    47
  > EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    48
  $ echo "states=$(echo $(dirname $TESTDIR))/hgext/states.py" >> local/.hg/hgrc
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    49
  $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> local/.hg/hgrc
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    50
  $ echo "evolution=$(echo $(dirname $TESTDIR))/hgext/evolution.py" >> local/.hg/hgrc
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    51
  $ hg init remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    52
  $ cat >> remote/.hg/hgrc << EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    53
  > [paths]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    54
  > local = ../local
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    55
  > [ui]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    56
  > user = René de Robert
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    57
  > [diff]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    58
  > git = 1
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    59
  > [alias]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    60
  > amend = amend -d '0 0'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    61
  > tlog = log --template "{node|short}: '{desc}' {branches}\n"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    62
  > ttlog = log --template "{node|short}: '{desc}' {state}\n"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    63
  > tglog = log -G --template "{node|short}: '{desc}' {branches}\n"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    64
  > [extensions]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    65
  > hgext.graphlog=
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    66
  > hgext.rebase=
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    67
  > EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    68
  $ echo "states=$(echo $(dirname $TESTDIR))/hgext/states.py" >> remote/.hg/hgrc
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    69
  $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> remote/.hg/hgrc
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    70
  $ echo "evolution=$(echo $(dirname $TESTDIR))/hgext/evolution.py" >> remote/.hg/hgrc
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    71
  $ cd local
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    72
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    73
You can reopen you eyes.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    74
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    75
Now we make a first version of our shopping list.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    76
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    77
  $ cat  >> shopping << EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    78
  > Spam
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    79
  > Whizzo butter
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    80
  > Albatross
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    81
  > Rat (rather a lot)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    82
  > Jugged fish
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    83
  > Blancmange
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    84
  > Salmon mousse
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    85
  > EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    86
  $ hg commit -A -m "Monthy Python Shopping list"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    87
  adding shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    88
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    89
We share this first version with the outside.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    90
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    91
  $ hg push remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    92
  pushing to $TESTTMP/remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    93
  searching for changes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    94
  adding changesets
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    95
  adding manifests
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    96
  adding file changes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    97
  added 1 changesets with 1 changes to 1 files
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    98
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    99
Later I add additional item to my list
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   100
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   101
  $ cat >> shopping << EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   102
  > Egg
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   103
  > Suggar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   104
  > Vinegar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   105
  > Oil
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   106
  > EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   107
  $ hg commit -m "adding condiment"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   108
  $ cat >> shopping << EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   109
  > Bananos
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   110
  > Pear
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   111
  > Apple
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   112
  > EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   113
  $ hg commit -m "adding fruit"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   114
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   115
I now have the following history:
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   116
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   117
  $ hg tlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   118
  d85de4546133: 'adding fruit'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   119
  4d5dc8187023: 'adding condiment'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   120
  7e82d3f3c2cb: 'Monthy Python Shopping list'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   121
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   122
But, I just notice, I made a typo in Banana.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   123
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   124
  $ hg export tip
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   125
  # HG changeset patch
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   126
  # User test
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   127
  # Date 0 0
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   128
  # Node ID d85de4546133030c82d257bbcdd9b1b416d0c31c
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   129
  # Parent  4d5dc81870237d492284826e21840b2ca00e26d1
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   130
  adding fruit
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   131
  
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   132
  diff --git a/shopping b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   133
  --- a/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   134
  +++ b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   135
  @@ -9,3 +9,6 @@
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   136
   Suggar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   137
   Vinegar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   138
   Oil
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   139
  +Bananos
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   140
  +Pear
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   141
  +Apple
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   142
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   143
hopefully. I can use hg amend to rewrite my faulty changeset!
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   144
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   145
  $ sed -i'' s/Bananos/Banana/ shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   146
  $ hg diff
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   147
  diff --git a/shopping b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   148
  --- a/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   149
  +++ b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   150
  @@ -9,6 +9,6 @@
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   151
   Suggar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   152
   Vinegar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   153
   Oil
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   154
  -Bananos
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   155
  +Banana
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   156
   Pear
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   157
   Apple
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   158
  $ hg amend
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   159
  abort: can not rewrite immutable changeset d85de4546133
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   160
  [255]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   161
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   162
By default all changeset are considered "published" and can't be rewrittent.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   163
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   164
 $ hg ttlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   165
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   166
You need to enable a mutable state in your repo the "ready" one
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   167
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   168
  $ hg states ready # XXX --clever
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   169
  $ hg ttlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   170
  d85de4546133: 'adding fruit' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   171
  4d5dc8187023: 'adding condiment' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   172
  7e82d3f3c2cb: 'Monthy Python Shopping list' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   173
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   174
Notice that changeset you already shared with the outside have been keep
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   175
published.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   176
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   177
The changeset we want to rewrite is now in a mutable state.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   178
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   179
  $ hg amend
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   180
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   181
A new changeset with the right diff replace the wrong one.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   182
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   183
  $ hg tlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   184
  0cacb48f4482: 'adding fruit'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   185
  4d5dc8187023: 'adding condiment'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   186
  7e82d3f3c2cb: 'Monthy Python Shopping list'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   187
  $ hg export tip
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   188
  # HG changeset patch
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   189
  # User test
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   190
  # Date 0 0
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   191
  # Node ID 0cacb48f44828d2fd31c4e45e18fde32a5b2f07b
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   192
  # Parent  4d5dc81870237d492284826e21840b2ca00e26d1
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   193
  adding fruit
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   194
  
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   195
  diff --git a/shopping b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   196
  --- a/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   197
  +++ b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   198
  @@ -9,3 +9,6 @@
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   199
   Suggar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   200
   Vinegar
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   201
   Oil
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   202
  +Banana
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   203
  +Pear
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   204
  +Apple
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   205
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   206
Getting Ride of branchy history
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   207
----------------------------------
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   208
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   209
While I was working on my list. someone help made a change remotly.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   210
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   211
close your eyes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   212
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   213
  $ cd ../remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   214
  $ hg up -q
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   215
  $ sed -i'' 's/Spam/Spam Spam Spam/' shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   216
  $ hg ci -m 'SPAM'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   217
  $ cd ../local
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   218
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   219
open your eyes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   220
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   221
  $ hg pull remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   222
  pulling from $TESTTMP/remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   223
  searching for changes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   224
  adding changesets
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   225
  adding manifests
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   226
  adding file changes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   227
  added 1 changesets with 1 changes to 1 files (+1 heads)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   228
  (run 'hg heads .' to see heads, 'hg merge' to merge)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   229
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   230
I now have a new heads. Note that the remote head is immutable
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   231
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   232
  $ hg ttlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   233
  9ca060c80d74: 'SPAM' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   234
  0cacb48f4482: 'adding fruit' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   235
  4d5dc8187023: 'adding condiment' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   236
  7e82d3f3c2cb: 'Monthy Python Shopping list' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   237
  $ hg tglog -r "::(9ca060c80d74 + 0cacb48f4482)"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   238
  o  9ca060c80d74: 'SPAM'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   239
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   240
  | @  0cacb48f4482: 'adding fruit'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   241
  | |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   242
  | o  4d5dc8187023: 'adding condiment'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   243
  |/
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   244
  o  7e82d3f3c2cb: 'Monthy Python Shopping list'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   245
  
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   246
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   247
instead of merging my head with the new one. I'm going to rebase my work
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   248
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   249
  $ hg diff
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   250
  $ hg rebase -d 9ca060c80d74 -s 4d5dc8187023
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   251
  merging shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   252
  merging shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   253
  merging shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   254
  merging shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   255
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   256
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   257
My local work is now rebase on the remote one.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   258
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   259
  $ hg kill e7a71e229632 ad97bbd3e37d # XXX fix me instead
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   260
  $ hg ttlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   261
  387187ad9bd9: 'adding fruit' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   262
  dfd3a2d7691e: 'adding condiment' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   263
  9ca060c80d74: 'SPAM' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   264
  7e82d3f3c2cb: 'Monthy Python Shopping list' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   265
  $ hg tglog -r '::.'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   266
  @  387187ad9bd9: 'adding fruit'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   267
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   268
  o  dfd3a2d7691e: 'adding condiment'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   269
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   270
  o  9ca060c80d74: 'SPAM'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   271
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   272
  o  7e82d3f3c2cb: 'Monthy Python Shopping list'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   273
  
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   274
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   275
Removing changeset
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   276
========================
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   277
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   278
I add new item to my list
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   279
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   280
  $ cat >> shopping << EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   281
  > car
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   282
  > bus
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   283
  > plane
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   284
  > boat
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   285
  > EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   286
  $ hg ci -m 'transport'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   287
  $ hg ttlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   288
  d58c77aa15d7: 'transport' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   289
  387187ad9bd9: 'adding fruit' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   290
  dfd3a2d7691e: 'adding condiment' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   291
  9ca060c80d74: 'SPAM' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   292
  7e82d3f3c2cb: 'Monthy Python Shopping list' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   293
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   294
I have a new commit but I realize that don't want it. (transport shop list does
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   295
not fit well in my standard shopping list)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   296
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   297
  $ hg kill . # . is for working directory parent.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   298
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   299
  working directory now at 387187ad9bd9
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   300
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   301
The silly changeset is gone.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   302
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   303
  $ hg ttlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   304
  387187ad9bd9: 'adding fruit' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   305
  dfd3a2d7691e: 'adding condiment' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   306
  9ca060c80d74: 'SPAM' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   307
  7e82d3f3c2cb: 'Monthy Python Shopping list' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   308
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   309
Reordering changeset
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   310
========================
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   311
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   312
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   313
We create two changeset.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   314
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   315
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   316
  $ cat >> shopping << EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   317
  > Toothbrush
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   318
  > Towel
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   319
  > ... More bathroom stuff to come
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   320
  > EOF
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   321
  $ hg ci -m 'bathroom stuff' -q # XXX remove the -q
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   322
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   323
  $ sed -i'' 's/Spam/Spam Spam Spam/g' shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   324
  $ hg ci -m 'SPAM SPAM'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   325
  $ hg ttlog
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   326
  d19fa1996cc7: 'SPAM SPAM' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   327
  e64eb196cfd1: 'bathroom stuff' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   328
  387187ad9bd9: 'adding fruit' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   329
  dfd3a2d7691e: 'adding condiment' (ready)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   330
  9ca060c80d74: 'SPAM' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   331
  7e82d3f3c2cb: 'Monthy Python Shopping list' (published)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   332
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   333
.. note: don't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   334
immutable.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   335
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   336
I now want to push to remote all my change but the bathroom one that i'm not totally happy with yet.
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   337
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   338
To be able to push "SPAM SPAM" I need a version of "SPAM SPAM" not children of "bathroom stuff"
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   339
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   340
You can use rebase or relocate for that:
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   341
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   342
  $ hg relocate 'p1(e64eb196cfd1)' --traceback
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   343
  merging shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   344
  $ hg tglog -r '::(. + e64eb196cfd1)'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   345
  @  e96fa9b78e3d: 'SPAM SPAM'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   346
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   347
  | o  e64eb196cfd1: 'bathroom stuff'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   348
  |/
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   349
  o  387187ad9bd9: 'adding fruit'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   350
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   351
  o  dfd3a2d7691e: 'adding condiment'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   352
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   353
  o  9ca060c80d74: 'SPAM'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   354
  |
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   355
  o  7e82d3f3c2cb: 'Monthy Python Shopping list'
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   356
  
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   357
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   358
We have a new SPAM SPAM version without the bathroom stuff
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   359
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   360
  $ grep Spam shopping  # enouth spamm
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   361
  Spam Spam Spam Spam Spam Spam Spam Spam Spam
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   362
  $ grep Toothbrush shopping # no Toothbrush
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   363
  [1]
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   364
  $ hg export .
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   365
  # HG changeset patch
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   366
  # User test
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   367
  # Date 0 0
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   368
  # Node ID e96fa9b78e3d2e21b604d4e05582bb1906a9bc59
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   369
  # Parent  387187ad9bd9d8f9a00a9fa804a26231db547429
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   370
  SPAM SPAM
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   371
  
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   372
  diff --git a/shopping b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   373
  --- a/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   374
  +++ b/shopping
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   375
  @@ -1,4 +1,4 @@
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   376
  -Spam Spam Spam
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   377
  +Spam Spam Spam Spam Spam Spam Spam Spam Spam
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   378
   Whizzo butter
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   379
   Albatross
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   380
   Rat (rather a lot)
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   381
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   382
we can now push our change:
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   383
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   384
  $ hg push -r . remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   385
  pushing to $TESTTMP/remote
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   386
  searching for changes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   387
  adding changesets
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   388
  adding manifests
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   389
  adding file changes
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   390
  added 3 changesets with 3 changes to 1 files
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   391
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   392
collaboration
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   393
====================
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   394
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   395
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   396
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   397
We create a central repo (because most workflow include this central repo
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   398
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   399
  $ cd ..
1b962aaf0c7d docs: Small tutorial
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   400
  $ hg init central