tests/test-stabilize-order.t
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 21 Nov 2012 11:03:39 +0100
branchcompat-hg2.3
changeset 615 148bf61583f4
parent 546 415540dee2bd
child 699 dba3ed9f2c4f
permissions -rw-r--r--
merge

  $ cat >> $HGRCPATH <<EOF
  > [defaults]
  > amend=-d "0 0"
  > [extensions]
  > hgext.rebase=
  > hgext.graphlog=
  > EOF
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH

  $ glog() {
  >   hg glog --template '{rev}:{node|short}@{branch}({phase}) {desc|firstline}\n' "$@"
  > }

  $ hg init repo
  $ cd repo
  $ echo root > root
  $ hg ci -Am addroot
  adding root
  $ echo a > a
  $ hg ci -Am adda
  adding a
  $ echo b > b
  $ hg ci -Am addb
  adding b
  $ echo c > c
  $ hg ci -Am addc
  adding c
  $ glog
  @  3:7a7552255fb5@default(draft) addc
  |
  o  2:ef23d6ef94d6@default(draft) addb
  |
  o  1:93418d2c0979@default(draft) adda
  |
  o  0:c471ef929e6a@default(draft) addroot
  
  $ hg gdown
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  [2] addb
  $ echo b >> b
  $ hg amend
  1 new unstable changesets
  $ hg gdown
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  [1] adda
  $ echo a >> a
  $ hg amend
  1 new unstable changesets
  $ glog
  @  7:f5ff10856e5a@default(draft) adda
  |
  | o  5:ab8cbb6d87ff@default(draft) addb
  | |
  | | o  3:7a7552255fb5@default(draft) addc
  | | |
  | | x  2:ef23d6ef94d6@default(draft) addb
  | |/
  | x  1:93418d2c0979@default(draft) adda
  |/
  o  0:c471ef929e6a@default(draft) addroot
  

Test stabilizing a predecessor child

  $ hg evolve -v
  move:[5] addb
  atop:[7] adda
  hg rebase -r ab8cbb6d87ff -d f5ff10856e5a
  resolving manifests
  getting b
  b
  $ glog
  @  8:6bf44048e43f@default(draft) addb
  |
  o  7:f5ff10856e5a@default(draft) adda
  |
  | o  3:7a7552255fb5@default(draft) addc
  | |
  | x  2:ef23d6ef94d6@default(draft) addb
  | |
  | x  1:93418d2c0979@default(draft) adda
  |/
  o  0:c471ef929e6a@default(draft) addroot
  

Test stabilizing a descendant predecessors child

  $ hg up 7
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ hg debugobsolete > successors.old
  $ hg evolve -v
  move:[3] addc
  atop:[8] addb
  hg rebase -r 7a7552255fb5 -d 6bf44048e43f
  resolving manifests
  getting b
  resolving manifests
  getting c
  c
  $ hg debugobsolete > successors.new
  $ diff -u successors.old successors.new
  --- successors.old* (glob)
  +++ successors.new* (glob)
  @@ -3,3 +3,4 @@
   3a4a591493f80708e46f2bf6d3b4debfad8ff91e f5ff10856e5ab3c8dc420b9c11460e6832a3b78c 0 {'date': '* *', 'user': 'test'} (glob)
   93418d2c0979643ad446f621195e78720edb05b4 f5ff10856e5ab3c8dc420b9c11460e6832a3b78c 0 {'date': '* *', 'user': 'test'} (glob)
   ab8cbb6d87ff3ab5526735a051cba6b63f3d6775 6bf44048e43f830accbf7d2bd7bc252ad7a3b99c 0 {'date': '* *', 'user': 'test'} (glob)
  +7a7552255fb5f8bd745e46fba6f0ca633a4dd716 5e819fbb0d278117c0a83b7f6f6486689732cfb2 0 {'date': '* *', 'user': 'test'} (glob)
  [1]
  $ glog
  @  9:5e819fbb0d27@default(draft) addc
  |
  o  8:6bf44048e43f@default(draft) addb
  |
  o  7:f5ff10856e5a@default(draft) adda
  |
  o  0:c471ef929e6a@default(draft) addroot
  
  $ hg evolve -v
  no troubled changeset
  [1]

Test behaviour with --any

  $ hg up 8
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ echo b >> b
  $ hg amend
  1 new unstable changesets
  $ glog
  @  11:4e7cec6b4afe@default(draft) addb
  |
  | o  9:5e819fbb0d27@default(draft) addc
  | |
  | x  8:6bf44048e43f@default(draft) addb
  |/
  o  7:f5ff10856e5a@default(draft) adda
  |
  o  0:c471ef929e6a@default(draft) addroot
  
  $ hg up 9
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg evolve -v
  nothing to evolve here
  (1 troubled changesets, do you want --any ?)
  [2]
  $ hg evolve --any -v
  move:[9] addc
  atop:[11] addb
  hg rebase -r 5e819fbb0d27 -d 4e7cec6b4afe
  resolving manifests
  removing c
  getting b
  resolving manifests
  getting c
  c
  $ glog
  @  12:24f95816bb21@default(draft) addc
  |
  o  11:4e7cec6b4afe@default(draft) addb
  |
  o  7:f5ff10856e5a@default(draft) adda
  |
  o  0:c471ef929e6a@default(draft) addroot
  
  $ hg evolve --any -v
  no troubled changeset
  [1]