Pierre-Yves David avatar Pierre-Yves David committed 629ec7f

tutorial: second replacement of hg amend by commit --amend

(the diff is huge because commit --amend have protection vs cycle)

Comments (0)

Files changed (1)

tests/test-tutorial.t

   +Banana
    Pear
    Apple
-  $ hg amend
+  $ hg commit --amend
 
 A new changeset with the right diff replace the wrong one.
 
   $ hg log -G
-  @  0cacb48f4482 (draft): adding fruit
+  @  9d0363b81950 (draft): adding fruit
   |
   o  4d5dc8187023 (draft): adding condiment
   |
   # HG changeset patch
   # User test
   # Date 0 0
-  # Node ID 0cacb48f44828d2fd31c4e45e18fde32a5b2f07b
+  # Node ID 9d0363b81950646bc6ad1ec5de8b8197ea586541
   # Parent  4d5dc81870237d492284826e21840b2ca00e26d1
   adding fruit
   
   $ hg log -G
   o  9ca060c80d74 (public): SPAM
   |
-  | @  0cacb48f4482 (draft): adding fruit
+  | @  9d0363b81950 (draft): adding fruit
   | |
   | o  4d5dc8187023 (draft): adding condiment
   |/
 My local work is now rebased on the remote one.
 
   $ hg log -G
-  @  387187ad9bd9 (draft): adding fruit
+  @  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
   > EOF
   $ hg ci -m 'transport'
   $ hg log -G
-  @  d58c77aa15d7 (draft): transport
+  @  1125e39fbf21 (draft): transport
   |
-  o  387187ad9bd9 (draft): adding fruit
+  o  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
 
   $ hg prune . # . is for working directory parent
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory now at 387187ad9bd9
+  working directory now at 41aff6a42b75
 
 The silly changeset is gone.
 
   $ hg log -G
-  @  387187ad9bd9 (draft): adding fruit
+  @  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
   $ sed -i'' -e 's/Spam/Spam Spam Spam/g' shopping
   $ hg ci -m 'SPAM SPAM'
   $ hg log -G
-  @  c48f32fb1787 (draft): SPAM SPAM
+  @  fac207dec9f5 (draft): SPAM SPAM
   |
-  o  8d39a843582d (draft): bathroom stuff
+  o  10b8aeaa8cc8 (draft): bathroom stuff
   |
-  o  387187ad9bd9 (draft): adding fruit
+  o  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
 
 You can use 'rebase -r' or 'graft -O' for that:
 
-  $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent
+  $ hg up 'p1(10b8aeaa8cc8)' # going on "bathroom stuff" parent
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg rebase --rev c48f32fb1787 --dest . # moving "SPAM SPAM" to the working directory parent
+  $ hg rebase --rev fac207dec9f5 --dest . # moving "SPAM SPAM" to the working directory parent
   merging shopping
   $ hg log -G
-  @  02e33960e937 (draft): SPAM SPAM
+  @  a224f2a4fb9f (draft): SPAM SPAM
   |
-  | o  8d39a843582d (draft): bathroom stuff
+  | o  10b8aeaa8cc8 (draft): bathroom stuff
   |/
-  o  387187ad9bd9 (draft): adding fruit
+  o  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
   # HG changeset patch
   # User test
   # Date 0 0
-  # Node ID 02e33960e937ad1bd59241ebdafd7a2494240ddf
-  # Parent  387187ad9bd9d8f9a00a9fa804a26231db547429
+  # Node ID a224f2a4fb9f9f828f608959912229d7b38b26de
+  # Parent  41aff6a42b7578ec7ec3cb2041633f1ca43cca96
   SPAM SPAM
   
   diff --git a/shopping b/shopping
 To make sure I do not push unready changeset by mistake I set the "bathroom
 stuff" changeset in the secret phase.
 
-  $ hg phase --force --secret 8d39a843582d
+  $ hg phase --force --secret 10b8aeaa8cc8
 
 we can now push our change:
 
 
 for simplicity shake we get the bathroom change in line again
 
-  $ hg rebase -r 8d39a843582d -d 02e33960e937
+  $ hg rebase -r 10b8aeaa8cc8 -d a224f2a4fb9f
   merging shopping
   $ hg phase --draft .
   $ hg log -G
-  @  a3515e5d0332 (draft): bathroom stuff
+  @  75954b8cd933 (draft): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   added 1 changesets with 1 changes to 1 files
   (run 'hg update' to get a working copy)
   $ hg log -G
-  o  a3515e5d0332 (public): bathroom stuff
+  o  75954b8cd933 (public): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   $ hg rollback
   repository tip rolled back to revision 4 (undo pull)
   $ hg log -G
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   added 1 changesets with 1 changes to 1 files
   (run 'hg update' to get a working copy)
   $ hg log -G
-  o  a3515e5d0332 (draft): bathroom stuff
+  o  75954b8cd933 (draft): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 
 Remotely someone add a new changeset on top of the mutable "bathroom" on.
 
-  $ hg up a3515e5d0332 -q
+  $ hg up 75954b8cd933 -q
   $ cat >> shopping << EOF
   > Giraffe
   > Rhino
 But at the same time, locally, this same "bathroom changeset" was updated.
 
   $ cd ../local
-  $ hg up a3515e5d0332 -q
+  $ hg up 75954b8cd933 -q
   $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping
   $ hg commit --amend
   $ hg log -G
-  @  36b5ba414186 (draft): bathroom stuff
+  @  a44c85f957d3 (draft): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 see both version showing up in the log.
 
   $ hg log -G
-  o  0b061760b677 (draft): animals
+  o  bf1b0d202029 (draft): animals
   |
-  | @  36b5ba414186 (draft): bathroom stuff
+  | @  a44c85f957d3 (draft): bathroom stuff
   | |
-  x |  a3515e5d0332 (draft): bathroom stuff
+  x |  75954b8cd933 (draft): bathroom stuff
   |/
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   
 
-The older version a3515e5d0332 never ceased to exist in the local repo. It was
+The older version 75954b8cd933 never ceased to exist in the local repo. It was
 jsut hidden and excluded from pull and push.
 
-.. note:: In hgview there is a nice doted relation highlighting 36b5ba414186 as a new version of a3515e5d0332. this is not yet ported to graphlog.
+.. note:: In hgview there is a nice doted relation highlighting a44c85f957d3 as a new version of 75954b8cd933. this is not yet ported to graphlog.
 
 Their is **unstable** changeset in this history now. Mercurial will refuse to
 share it with the outside:
   $ hg push other
   pushing to $TESTTMP/other
   searching for changes
-  abort: push includes unstable changeset: 0b061760b677!
+  abort: push includes unstable changeset: bf1b0d202029!
   (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
  
 
 
 
-To resolve this unstable state, you need to rebase 0b061760b677 onto
-36b5ba414186 the "hg evolve" command will make this for you.
+To resolve this unstable state, you need to rebase bf1b0d202029 onto
+a44c85f957d3 the "hg evolve" command will make this for you.
 
 It has a --dry-run option to only suggest the next move.
 
   $ hg evolve --dry-run
   move:[15] animals
   atop:[14] bathroom stuff
-  hg rebase -r 0b061760b677 -d 36b5ba414186
+  hg rebase -r bf1b0d202029 -d a44c85f957d3
 
 Let's do it
 
 The old version of bathroom is hidden again.
 
   $ hg log -G
-  @  fd0d2651e61c (draft): animals
+  @  ee942144f952 (draft): animals
   |
-  o  36b5ba414186 (draft): bathroom stuff
+  o  a44c85f957d3 (draft): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   no changes found
   Working directory parent is obsolete
 
-  $ hg up fd0d2651e61c
+  $ hg up ee942144f952
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Relocating unstable change after prune
   added 1 changesets with 1 changes to 1 files
   (run 'hg update' to get a working copy)
   $ hg log -G
-  o  56c68f64a3a0 (draft): SPAM SPAM SPAM
+  o  99f039c5ec9e (draft): SPAM SPAM SPAM
   |
-  @  fd0d2651e61c (draft): animals
+  @  ee942144f952 (draft): animals
   |
-  o  36b5ba414186 (draft): bathroom stuff
+  o  a44c85f957d3 (draft): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 
 In the mean time I noticed you can't buy animals in a super market and I prune the animal changeset:
 
-  $ hg prune fd0d2651e61c
+  $ hg prune ee942144f952
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory now at 36b5ba414186
+  working directory now at a44c85f957d3
   1 new unstable changesets
 
 
 is neither dead or obsolete.  My repository is in an unstable state again.
 
   $ hg log -G
-  o  56c68f64a3a0 (draft): SPAM SPAM SPAM
+  o  99f039c5ec9e (draft): SPAM SPAM SPAM
   |
-  x  fd0d2651e61c (draft): animals
+  x  ee942144f952 (draft): animals
   |
-  @  36b5ba414186 (draft): bathroom stuff
+  @  a44c85f957d3 (draft): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   
 
   $ hg log -r 'unstable()'
-  56c68f64a3a0 (draft): SPAM SPAM SPAM
+  99f039c5ec9e (draft): SPAM SPAM SPAM
 
   $ hg evolve
   move:[17] SPAM SPAM SPAM
   merging shopping
 
   $ hg log -G
-  @  6dd8ca9dbcdc (draft): SPAM SPAM SPAM
+  @  40aa40daeefb (draft): SPAM SPAM SPAM
   |
-  o  36b5ba414186 (draft): bathroom stuff
+  o  a44c85f957d3 (draft): bathroom stuff
   |
-  o  02e33960e937 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.