docs/tutorials/tutorial.t
changeset 654 c56109c9aebf
parent 547 c4abb0218e84
child 764 4a74288c671c
equal deleted inserted replaced
653:116c6f76d24b 654:c56109c9aebf
    40   > [ui]
    40   > [ui]
    41   > user = Princess Flore
    41   > user = Princess Flore
    42   > EOF
    42   > EOF
    43 
    43 
    44 
    44 
    45 This tutorial use the following configuration for Mercurial:
    45 This tutorial uses the following configuration for Mercurial:
    46 
    46 
    47 A compact log template with phase data:
    47 A compact log template with phase data:
    48 
    48 
    49   $ hg showconfig ui
    49   $ hg showconfig ui
    50   ui.slash=True
    50   ui.slash=True
   144    Oil
   144    Oil
   145   +Bananos
   145   +Bananos
   146   +Pear
   146   +Pear
   147   +Apple
   147   +Apple
   148 
   148 
   149 The faulty changeset is in the "draft" phase because he was not exchanged with
   149 The faulty changeset is in the "draft" phase because it has not been exchanged with
   150 the outside. The first one have been exchanged and is an immutable public
   150 the outside. The first one has been exchanged and is "public" (immutable).
   151 changeset.
       
   152 
   151 
   153   $ hg glog
   152   $ hg glog
   154   @  d85de4546133 (draft): adding fruit
   153   @  d85de4546133 (draft): adding fruit
   155   |
   154   |
   156   o  4d5dc8187023 (draft): adding condiment
   155   o  4d5dc8187023 (draft): adding condiment
   201    Oil
   200    Oil
   202   +Banana
   201   +Banana
   203   +Pear
   202   +Pear
   204   +Apple
   203   +Apple
   205 
   204 
   206 Getting Ride of branchy history
   205 Getting rid of branchy history
   207 ----------------------------------
   206 ----------------------------------
   208 
   207 
   209 While I was working on my list. someone help made a change remotly.
   208 While I was working on my list. someone help made a change remotly.
   210 
   209 
   211   $ cd ../remote
   210   $ cd ../remote
   255   o  9ca060c80d74 (public): SPAM
   254   o  9ca060c80d74 (public): SPAM
   256   |
   255   |
   257   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   256   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   258   
   257   
   259 
   258 
   260 Removing changeset
   259 Removing changesets
   261 ------------------------
   260 ------------------------
   262 
   261 
   263 I add new item to my list
   262 I add new item to my list
   264 
   263 
   265   $ cat >> shopping << EOF
   264   $ cat >> shopping << EOF
   298   o  9ca060c80d74 (public): SPAM
   297   o  9ca060c80d74 (public): SPAM
   299   |
   298   |
   300   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   299   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   301   
   300   
   302 
   301 
   303 Reordering changeset
   302 Reordering changesets
   304 ------------------------
   303 ------------------------
   305 
   304 
   306 
   305 
   307 We create two changesets.
   306 We create two changesets.
   308 
   307 
   332   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   331   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   333   
   332   
   334 
   333 
   335 .. note: don't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are immutable.
   334 .. note: don't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are immutable.
   336 
   335 
   337 I now want to push to remote all my change but the bathroom one that i'm not
   336 I now want to push to remote all my changes except the bathroom one, which I'm not
   338 totally happy with yet. To be able to push "SPAM SPAM" I need a version of "SPAM SPAM" not children of
   337 totally happy with yet. To be able to push "SPAM SPAM" I need a version of "SPAM SPAM" which is not a child of
   339 "bathroom stuff"
   338 "bathroom stuff"
   340 
   339 
   341 You can use 'rebase -r' or 'graft -O' for that:
   340 You can use 'rebase -r' or 'graft -O' for that:
   342 
   341 
   343   $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent
   342   $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent
   359   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   358   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   360   
   359   
   361 
   360 
   362 We have a new SPAM SPAM version without the bathroom stuff
   361 We have a new SPAM SPAM version without the bathroom stuff
   363 
   362 
   364   $ grep Spam shopping  # enouth spam
   363   $ grep Spam shopping  # enough spam
   365   Spam Spam Spam Spam Spam Spam Spam Spam Spam
   364   Spam Spam Spam Spam Spam Spam Spam Spam Spam
   366   $ grep Toothbrush shopping # no Toothbrush
   365   $ grep Toothbrush shopping # no Toothbrush
   367   [1]
   366   [1]
   368   $ hg export .
   367   $ hg export .
   369   # HG changeset patch
   368   # HG changeset patch
   440 
   439 
   441 
   440 
   442 sharing mutable changeset
   441 sharing mutable changeset
   443 ----------------------------
   442 ----------------------------
   444 
   443 
   445 To share mutable changeset with other just check that the repo you interact
   444 To share mutable changeset with others, just check that the repo you interact
   446 with is "not publishing". Otherwise you will get the previously observe
   445 with is "not publishing". Otherwise you will get the previously observe
   447 behavior where exchanged changeset are automatically published.
   446 behavior where exchanged changeset are automatically published.
   448 
   447 
   449   $ cd ../remote
   448   $ cd ../remote
   450   $ hg -R ../local/ showconfig phases
   449   $ hg -R ../local/ showconfig phases
   575   added 1 changesets with 1 changes to 1 files (+1 heads)
   574   added 1 changesets with 1 changes to 1 files (+1 heads)
   576   (run 'hg heads .' to see heads, 'hg merge' to merge)
   575   (run 'hg heads .' to see heads, 'hg merge' to merge)
   577   1 new unstables changesets
   576   1 new unstables changesets
   578 
   577 
   579 
   578 
   580 The new changeset "animal" is based one an old changeset of "bathroom". You can
   579 The new changeset "animal" is based on an old changeset of "bathroom". You can
   581 see both version showing up in the log.
   580 see both version showing up in the log.
   582 
   581 
   583   $ hg log -G
   582   $ hg log -G
   584   o  9ac5d0e790a2 (draft): animals
   583   o  9ac5d0e790a2 (draft): animals
   585   |
   584   |
   597   |
   596   |
   598   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   597   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   599   
   598   
   600 
   599 
   601 The older version 8a79ae8b029e never ceased to exist in the local repo. It was
   600 The older version 8a79ae8b029e never ceased to exist in the local repo. It was
   602 jsut hidden and excluded from pull and push.
   601 just hidden and excluded from pull and push.
   603 
   602 
   604 .. note:: In hgview there is a nice doted relation highlighting ffa278c50818 as a new version of 8a79ae8b029e. this is not yet ported to graphlog.
   603 .. note:: In hgview there is a nice dotted relation highlighting ffa278c50818 as a new version of 8a79ae8b029e. This is not yet ported to ``hg log -G``.
   605 
   604 
   606 Their is **unstable** changeset in this history now. Mercurial will refuse to
   605 There is now an **unstable** changeset in this history. Mercurial will refuse to
   607 share it with the outside:
   606 share it with the outside:
   608 
   607 
   609   $ hg push other
   608   $ hg push other
   610   pushing to $TESTTMP/other
   609   pushing to $TESTTMP/other
   611   searching for changes
   610   searching for changes
   615  
   614  
   616 
   615 
   617 
   616 
   618 
   617 
   619 To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto
   618 To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto
   620 ffa278c50818 the "hg stabilize" command will make this for you.
   619 ffa278c50818. The "hg stabilize" command will do this for you.
   621 
   620 
   622 It has a --dry-run option to only suggest the next move.
   621 It has a --dry-run option to only suggest the next move.
   623 
   622 
   624   $ hg stabilize --dry-run
   623   $ hg stabilize --dry-run
   625   move:[15] animals
   624   move:[15] animals
   767 
   766 
   768 
   767 
   769 Handling Conflicting amend
   768 Handling Conflicting amend
   770 ----------------------------------------------
   769 ----------------------------------------------
   771 
   770 
   772 We can detect that multiple diverging//conflicting amend have been made. There
   771 We can detect that multiple diverging/conflicting amendments have been made. There
   773 will be a "evol-merge" command to merge conflicting amend
   772 will be a "evol-merge" command to merge conflicting amendments.
   774 
   773 
   775 This command is not ready yet.
   774 This command is not ready yet.