tests/test-tutorial.t
branchstable
changeset 2822 56733f2ddb04
parent 2768 85e5a56db776
child 2826 93588d219f2f
equal deleted inserted replaced
2821:ddbee40be518 2822:56733f2ddb04
   156   o  4d5dc8187023 (draft): adding condiment
   156   o  4d5dc8187023 (draft): adding condiment
   157   |
   157   |
   158   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   158   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   159   
   159   
   160 
   160 
   161 hopefully. I can use `hg commit --amend` to rewrite my faulty changeset!
   161 Hopefully. I can use `hg commit --amend` to rewrite my faulty changeset!
   162 
   162 
   163   $ sed -i'' -e s/Bananos/Banana/ shopping
   163   $ sed -i'' -e s/Bananos/Banana/ shopping
   164   $ hg diff
   164   $ hg diff
   165   diff --git a/shopping b/shopping
   165   diff --git a/shopping b/shopping
   166   --- a/shopping
   166   --- a/shopping
   205   +Apple
   205   +Apple
   206 
   206 
   207 Getting rid of branchy history
   207 Getting rid of branchy history
   208 ----------------------------------
   208 ----------------------------------
   209 
   209 
   210 While I was working on my list. someone made a change remotely.
   210 While I was working on my list. Someone made a change remotely.
   211 
   211 
   212   $ cd ../remote
   212   $ cd ../remote
   213   $ hg up -q
   213   $ hg up -q
   214   $ sed -i'' -e 's/Spam/Spam Spam Spam/' shopping
   214   $ sed -i'' -e 's/Spam/Spam Spam Spam/' shopping
   215   $ hg ci -m 'SPAM'
   215   $ hg ci -m 'SPAM'
   224   adding manifests
   224   adding manifests
   225   adding file changes
   225   adding file changes
   226   added 1 changesets with 1 changes to 1 files (+1 heads)
   226   added 1 changesets with 1 changes to 1 files (+1 heads)
   227   (run 'hg heads' to see heads, 'hg merge' to merge)
   227   (run 'hg heads' to see heads, 'hg merge' to merge)
   228 
   228 
   229 I now have a new heads. Note that this remote head is immutable
   229 I now have a new head. Note that this remote head is immutable.
   230 
   230 
   231   $ hg log -G
   231   $ hg log -G
   232   o  9ca060c80d74 (public): SPAM
   232   o  9ca060c80d74 (public): SPAM
   233   |
   233   |
   234   | @  9d0363b81950 (draft): adding fruit
   234   | @  9d0363b81950 (draft): adding fruit
   236   | o  4d5dc8187023 (draft): adding condiment
   236   | o  4d5dc8187023 (draft): adding condiment
   237   |/
   237   |/
   238   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   238   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   239   
   239   
   240 
   240 
   241 instead of merging my head with the new one. I'm going to rebase my work
   241 Instead of merging my head with the new one. I'm going to rebase my work
   242 
   242 
   243   $ hg diff
   243   $ hg diff
   244   $ hg rebase --dest 9ca060c80d74 --source 4d5dc8187023
   244   $ hg rebase --dest 9ca060c80d74 --source 4d5dc8187023
   245   rebasing 1:4d5dc8187023 "adding condiment"
   245   rebasing 1:4d5dc8187023 "adding condiment"
   246   merging shopping
   246   merging shopping
   261   
   261   
   262 
   262 
   263 Removing changesets
   263 Removing changesets
   264 ------------------------
   264 ------------------------
   265 
   265 
   266 I add new item to my list
   266 I add new items to my list.
   267 
   267 
   268   $ cat >> shopping << EOF
   268   $ cat >> shopping << EOF
   269   > car
   269   > car
   270   > bus
   270   > bus
   271   > plane
   271   > plane
   282   o  9ca060c80d74 (public): SPAM
   282   o  9ca060c80d74 (public): SPAM
   283   |
   283   |
   284   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   284   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   285   
   285   
   286 
   286 
   287 I have a new commit but I realize that don't want it. (transport shop list does
   287 I have a new commit but I realize that don't want it. (Transport shop list does
   288 not fit well in my standard shopping list)
   288 not fit well in my standard shopping list)
   289 
   289 
   290   $ hg prune . # "." is for working directory parent
   290   $ hg prune . # "." is for working directory parent
   291   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   291   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   292   working directory now at 41aff6a42b75
   292   working directory now at 41aff6a42b75
   511 -----------------------
   511 -----------------------
   512 Collaboration
   512 Collaboration
   513 -----------------------
   513 -----------------------
   514 
   514 
   515 
   515 
   516 sharing mutable changesets
   516 Sharing mutable changesets
   517 ----------------------------
   517 ----------------------------
   518 
   518 
   519 To share mutable changesets with others, just check that the repo you interact
   519 To share mutable changesets with others, just check that the repo you interact
   520 with is "not publishing". Otherwise you will get the previously observe
   520 with is "not publishing". Otherwise you will get the previously observe
   521 behavior where exchanged changeset are automatically published.
   521 behavior where exchanged changeset are automatically published.
   522 
   522 
   523   $ cd ../remote
   523   $ cd ../remote
   524   $ hg -R ../local/ showconfig phases
   524   $ hg -R ../local/ showconfig phases
   525   [1]
   525   [1]
   526 
   526 
   527 the localrepo does not have any specific configuration for `phases.publish`. It
   527 The localrepo does not have any specific configuration for `phases.publish`. It
   528 is ``true`` by default.
   528 is ``true`` by default.
   529 
   529 
   530   $ hg pull local
   530   $ hg pull local
   531   pulling from $TESTTMP/local (glob)
   531   pulling from $TESTTMP/local (glob)
   532   searching for changes
   532   searching for changes
   548   @  9ca060c80d74 (public): SPAM
   548   @  9ca060c80d74 (public): SPAM
   549   |
   549   |
   550   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   550   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   551   
   551   
   552 
   552 
   553 
       
   554 
       
   555 We do not want to publish the "bathroom changeset". Let's rollback the last transaction.
   553 We do not want to publish the "bathroom changeset". Let's rollback the last transaction.
   556 
   554 
   557 .. Warning: Rollback is actually a dangerous kind of internal command that is deprecated and should not be exposed to user. Please forget you read about it until someone fix this tutorial.
   555 .. Warning: Rollback is actually a dangerous kind of internal command that is deprecated and should not be exposed to user. Please forget you read about it until someone fix this tutorial.
   558 
   556 
   559   $ hg rollback
   557   $ hg rollback
   568   @  9ca060c80d74 (public): SPAM
   566   @  9ca060c80d74 (public): SPAM
   569   |
   567   |
   570   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   568   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   571   
   569   
   572 
   570 
   573 Let's make the local repo "non publishing"
   571 Let's make the local repo "non publishing".
   574 
   572 
   575   $ echo '[phases]' >> ../local/.hg/hgrc
   573   $ echo '[phases]' >> ../local/.hg/hgrc
   576   $ echo 'publish=false' >> ../local/.hg/hgrc
   574   $ echo 'publish=false' >> ../local/.hg/hgrc
   577   $ echo '[phases]' >> .hg/hgrc
   575   $ echo '[phases]' >> .hg/hgrc
   578   $ echo 'publish=false' >> .hg/hgrc
   576   $ echo 'publish=false' >> .hg/hgrc
   639   o  9ca060c80d74 (public): SPAM
   637   o  9ca060c80d74 (public): SPAM
   640   |
   638   |
   641   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   639   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   642   
   640   
   643 
   641 
   644 
       
   645 When we pull from remote again we get an unstable state!
   642 When we pull from remote again we get an unstable state!
   646 
   643 
   647   $ hg pull remote
   644   $ hg pull remote
   648   pulling from $TESTTMP/remote (glob)
   645   pulling from $TESTTMP/remote (glob)
   649   searching for changes
   646   searching for changes
   690   abort: push includes unstable changeset: bf1b0d202029!
   687   abort: push includes unstable changeset: bf1b0d202029!
   691   (use 'hg evolve' to get a stable history or --force to ignore warnings)
   688   (use 'hg evolve' to get a stable history or --force to ignore warnings)
   692   [255]
   689   [255]
   693  
   690  
   694 
   691 
   695 
       
   696 
       
   697 To resolve this unstable state, you need to rebase bf1b0d202029 onto
   692 To resolve this unstable state, you need to rebase bf1b0d202029 onto
   698 a44c85f957d3. The `hg evolve` command will do this for you.
   693 a44c85f957d3. The `hg evolve` command will do this for you.
   699 
   694 
   700 It has a --dry-run option to only suggest the next move.
   695 It has a --dry-run option to only suggest the next move.
   701 
   696 
   728   o  9ca060c80d74 (public): SPAM
   723   o  9ca060c80d74 (public): SPAM
   729   |
   724   |
   730   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   725   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   731   
   726   
   732 
   727 
   733 
   728 We can push this evolution to remote.
   734 We can push this evolution to remote
       
   735 
   729 
   736   $ hg push remote
   730   $ hg push remote
   737   pushing to $TESTTMP/remote (glob)
   731   pushing to $TESTTMP/remote (glob)
   738   searching for changes
   732   searching for changes
   739   adding changesets
   733   adding changesets
   741   adding file changes
   735   adding file changes
   742   added 2 changesets with 2 changes to 1 files (+1 heads)
   736   added 2 changesets with 2 changes to 1 files (+1 heads)
   743   3 new obsolescence markers
   737   3 new obsolescence markers
   744   obsoleted 2 changesets
   738   obsoleted 2 changesets
   745 
   739 
   746 remote get a warning that current working directory is based on an obsolete changeset
   740 Remote get a warning that current working directory is based on an obsolete
       
   741 changeset.
   747 
   742 
   748   $ cd ../remote
   743   $ cd ../remote
   749   $ hg pull local # we up again to trigger the warning. it was displayed during the push
   744   $ hg pull local # we up again to trigger the warning. it was displayed during the push
   750   pulling from $TESTTMP/local (glob)
   745   pulling from $TESTTMP/local (glob)
   751   searching for changes
   746   searching for changes
   752   no changes found
   747   no changes found
   753   working directory parent is obsolete! (bf1b0d202029)
   748   working directory parent is obsolete! (bf1b0d202029)
   754   (use 'hg evolve' to update to its successor: ee942144f952)
   749   (use 'hg evolve' to update to its successor: ee942144f952)
   755 
   750 
   756 now let's see where we are, and update to the successor
   751 Now let's see where we are, and update to the successor.
   757 
   752 
   758   $ hg parents
   753   $ hg parents
   759   bf1b0d202029 (draft): animals
   754   bf1b0d202029 (draft): animals
   760   working directory parent is obsolete! (bf1b0d202029)
   755   working directory parent is obsolete! (bf1b0d202029)
   761   (use 'hg evolve' to update to its successor: ee942144f952)
   756   (use 'hg evolve' to update to its successor: ee942144f952)
   765   working directory is now at ee942144f952
   760   working directory is now at ee942144f952
   766 
   761 
   767 Relocating unstable change after prune
   762 Relocating unstable change after prune
   768 ----------------------------------------------
   763 ----------------------------------------------
   769 
   764 
   770 The remote guy keep working
   765 The remote guy keeps working.
   771 
   766 
   772   $ sed -i'' -e 's/Spam/Spam Spam Spam Spam/g' shopping
   767   $ sed -i'' -e 's/Spam/Spam Spam Spam Spam/g' shopping
   773   $ hg commit -m "SPAM SPAM SPAM"
   768   $ hg commit -m "SPAM SPAM SPAM"
   774 
   769 
   775 I'm pulling its work locally.
   770 I'm pulling its work locally.
   809   1 changesets pruned
   804   1 changesets pruned
   810   1 new unstable changesets
   805   1 new unstable changesets
   811 
   806 
   812 
   807 
   813 The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset
   808 The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset
   814 is neither dead or obsolete.  My repository is in an unstable state again.
   809 is neither dead or obsolete. My repository is in an unstable state again.
   815 
   810 
   816   $ hg log -G
   811   $ hg log -G
   817   o  99f039c5ec9e (draft): SPAM SPAM SPAM
   812   o  99f039c5ec9e (draft): SPAM SPAM SPAM
   818   |
   813   |
   819   x  ee942144f952 (draft): animals
   814   x  ee942144f952 (draft): animals
   828   |
   823   |
   829   o  9ca060c80d74 (public): SPAM
   824   o  9ca060c80d74 (public): SPAM
   830   |
   825   |
   831   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   826   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   832   
   827   
   833 
       
   834   $ hg log -r 'unstable()'
   828   $ hg log -r 'unstable()'
   835   99f039c5ec9e (draft): SPAM SPAM SPAM
   829   99f039c5ec9e (draft): SPAM SPAM SPAM
   836 
   830 
   837   $ hg evolve
   831   $ hg evolve
   838   move:[17] SPAM SPAM SPAM
   832   move:[17] SPAM SPAM SPAM
   853   |
   847   |
   854   o  9ca060c80d74 (public): SPAM
   848   o  9ca060c80d74 (public): SPAM
   855   |
   849   |
   856   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   850   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   857   
   851   
   858 
       
   859 
       
   860 Handling Divergent amend
   852 Handling Divergent amend
   861 ----------------------------------------------
   853 ----------------------------------------------
   862 
   854 
   863 We can detect that multiple diverging amendments have been made.
   855 We can detect that multiple diverging amendments have been made.
   864 The `evolve` command can solve this situation. But all corner case are not
   856 The `evolve` command can solve this situation. But all corner case are not