mutable-history / tests / test-stabilize-order.t

  $ cat >> $HGRCPATH <<EOF
  > [defaults]
  > amend=-d "0 0"
  > [extensions]
  > hgext.rebase=
  > hgext.graphlog=
  > EOF
  $ echo "obsolete=$(echo $(dirname $TESTDIR))/hgext/obsolete.py" >> $HGRCPATH
  $ 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 unstables changesets
  $ hg gdown
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  [1] adda
  $ echo a >> a
  $ hg amend
  1 new unstables changesets
  $ glog
  @  7:f5ff10856e5a@default(draft) adda
  |
  | o  5:ab8cbb6d87ff@default(draft) addb
  | |
  | | o  3:7a7552255fb5@default(draft) addc
  | | |
  | | o  2:ef23d6ef94d6@default(draft) addb
  | |/
  | o  1:93418d2c0979@default(draft) adda
  |/
  o  0:c471ef929e6a@default(draft) addroot
  

Test stabilizing a predecessor child

  $ hg stabilize -v
  move:[5] addb
  atop:[7] adda
  hg rebase -Dr 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
  | |
  | o  2:ef23d6ef94d6@default(draft) addb
  | |
  | o  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 stabilize -v
  move:[3] addc
  atop:[8] addb
  hg rebase -Dr 7a7552255fb5 -d 6bf44048e43f
  resolving manifests
  getting b
  resolving manifests
  getting c
  c
  $ 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 stabilize -v
  no unstable 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 unstables changesets
  $ glog
  @  11:4e7cec6b4afe@default(draft) addb
  |
  | o  9:5e819fbb0d27@default(draft) addc
  | |
  | o  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 stabilize -v
  nothing to stabilize here
  (1 unstable changesets, do you want --any ?)
  [2]
  $ hg stabilize --any -v
  move:[9] addc
  atop:[11] addb
  hg rebase -Dr 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 stabilize --any -v
  no unstable changeset
  [1]
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.