Commits

Pierre-Yves David committed d702f0d

obsolete: remove debugsuccessors

This was kinda duplicate of core "debugobsolete"

  • Participants
  • Parent commits 5fa287e
  • Branches default

Comments (0)

Files changed (11)

docs/evolve-faq.rst

 
 You can also use a debug command
 
-    $ hg debugsuccessors
+    $ hg debugobsolete
       5eb72dbe0cb4 e8db4aa611f6
       c4cbebac3751 4f1c269eab68
 

hgext/obsolete.py

             newer.add(())
     return sorted(newer)
 
-
-# XXX kill me
-cmdtable = {}
-command = cmdutil.command(cmdtable)
-@command('debugsuccessors', [], '')
-def cmddebugsuccessors(ui, repo):
-    """dump obsolete changesets and their successors
-
-    Each line matches an existing marker, the first identifier is the
-    obsolete changeset identifier, followed by it successors.
-    """
-    lock = repo.lock()
-    try:
-        allsuccessors = repo.obsstore.precursors
-        for old in sorted(allsuccessors):
-            successors = [sorted(m[1]) for m in allsuccessors[old]]
-            for i, group in enumerate(sorted(successors)):
-                ui.write('%s' % short(old))
-                for new in group:
-                    ui.write(' %s' % short(new))
-                ui.write('\n')
-    finally:
-        lock.release()
-
-
 @eh.reposetup
 def _repoobsutilsetup(ui, repo):
     if not repo.local():
         rels.setdefault( subnode, set()).add(bin(objhex))
     return rels
 
+cmdtable = {}
+command = cmdutil.command(cmdtable)
 @command('debugconvertobsolete', [], '')
 def cmddebugconvertobsolete(ui, repo):
     """import markers from an .hg/obsolete-relations file"""

tests/test-amend.t

   marked working directory as branch foo
   (branches are permanent and global, did you want a bookmark?)
   $ hg amend
-  $ hg debugsuccessors
-  07f494440405 a34b93d251e4
-  bd19cbe78fbf a34b93d251e4
+  $ hg debugobsolete
+  07f4944404050f47db2e5c5071e0e84e7a27bba9 a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob)
+  bd19cbe78fbfbd87eb33420c63986fe5f3154f2c a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob)
   $ hg branch
   foo
   $ hg branches
   $ hg amend --change 2
   abort: no updates found
   [255]
-  $ hg debugsuccessors
-  07f494440405 a34b93d251e4
-  bd19cbe78fbf a34b93d251e4
+  $ hg debugobsolete
+  07f4944404050f47db2e5c5071e0e84e7a27bba9 a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob)
+  bd19cbe78fbfbd87eb33420c63986fe5f3154f2c a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob)
   $ hg phase 2
   2: draft
   $ glog
   $ hg amend --change 2
   abort: no updates found
   [255]
-  $ hg debugsuccessors
-  07f494440405 a34b93d251e4
-  7384bbcba36f 000000000000
-  bd19cbe78fbf a34b93d251e4
+  $ hg debugobsolete
+  07f4944404050f47db2e5c5071e0e84e7a27bba9 a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob)
+  bd19cbe78fbfbd87eb33420c63986fe5f3154f2c a34b93d251e49c93d5685ebacad785c73a7e8605 0 {'date': '* *', 'user': 'test'} (glob)
+  7384bbcba36fde1a789cd00f9cd6f9b919ab5910 0000000000000000000000000000000000000000 0 {'date': '* *', 'user': 'test'} (glob)
   $ glog
   @  6@foo(draft) amends a34b93d251e49c93d5685ebacad785c73a7e8605
   |

tests/test-evolve.t

   |/
   @  0:e55e0562ee93@default(draft) base
   
-  $ hg debugsuccessors
-  524e478d4811 f8111a076f09
-  568a468b60fc 23409eba69a0
-  7b36850622b2 f8111a076f09
-  e416e48b2742 23409eba69a0
+  $ hg debugobsolete
+  7b36850622b2fd159fa30a4fb2a1edd2043b4a14 f8111a076f0975cbecb336e2bd3411be22b673fb 0 {'date': '* *', 'user': 'test'} (glob)
+  524e478d4811d405c8771e4c441de4483bdf8b33 f8111a076f0975cbecb336e2bd3411be22b673fb 0 {'date': '* *', 'user': 'test'} (glob)
+  e416e48b27428695d00c2a2cc4a0b9619482e63f 23409eba69a0986e90cd42252852c1e6da97af5b 0 {'date': '* *', 'user': 'test'} (glob)
+  568a468b60fc99a42d5d4ddbe181caff1eef308d 23409eba69a0986e90cd42252852c1e6da97af5b 0 {'date': '* *', 'user': 'test'} (glob)
   $ hg stabilize
   move:[4] another feature
   atop:[6] a nifty feature
   |/
   o  0:8685c6d34325@default(draft) add 0
   
-  $ hg debugsuccessors
-  0e84df4912da 0b9e50c35132
-  db038628b9e5 acb28cd497b7
+  $ hg debugobsolete
+  0e84df4912da4c7cad22a3b4fcfd58ddfb7c8ae9 0b9e50c35132ff548ec0065caea6a87e1ebcef32 0 {'date': '* *', 'user': 'test'} (glob)
+  db038628b9e56f51a454c0da0c508df247b41748 acb28cd497b7f8767e01ef70f68697a959573c2d 0 {'date': '* *', 'user': 'test'} (glob)
 
 Test graft --continue
 
   |/
   o  0:8685c6d34325@default(draft) add 0
   
-  $ hg debugsuccessors
-  0e84df4912da 0b9e50c35132
-  a5bfd90a2f29 920e58bb443b
-  db038628b9e5 acb28cd497b7
+  $ hg debugobsolete
+  0e84df4912da4c7cad22a3b4fcfd58ddfb7c8ae9 0b9e50c35132ff548ec0065caea6a87e1ebcef32 0 {'date': '* *', 'user': 'test'} (glob)
+  db038628b9e56f51a454c0da0c508df247b41748 acb28cd497b7f8767e01ef70f68697a959573c2d 0 {'date': '* *', 'user': 'test'} (glob)
+  a5bfd90a2f29c7ccb8f917ff4e5013a9053d0a04 920e58bb443b73eea9d6d65570b4241051ea3229 0 {'date': '* *', 'user': 'test'} (glob)
 
   $ cd ..
 

tests/test-obsolete-rebase.t

   |/
   o  0:07f494440405@default(draft) adda
   
-  $ hg debugsuccessors
+  $ hg debugobsolete
   $ hg --config extensions.hgext.mq= strip tip
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9c5494949763-backup.hg
   |/
   o  0:07f494440405@default(draft) adda
   
-  $ hg debugsuccessors
-  98e4a024635e 9c5494949763
+  $ hg debugobsolete
+  98e4a024635e8c50928144c9277a4388d26bd786 9c54949497631abfb5a255d96746bbd3a42ed2ba 0 {'date': '* *', 'user': 'test'} (glob)
 
 Test rebase with deleted empty revision
 
   |/
   o  0:07f494440405@default(draft) adda
   
-  $ hg debugsuccessors
-  4e322f7ce8e3 000000000000
-  98e4a024635e 9c5494949763
+  $ hg debugobsolete
+  98e4a024635e8c50928144c9277a4388d26bd786 9c54949497631abfb5a255d96746bbd3a42ed2ba 0 {'date': '* *', 'user': 'test'} (glob)
+  4e322f7ce8e3e4203950eac9ece27bf7e45ffa6c 0000000000000000000000000000000000000000 0 {'date': '* *', 'user': 'test'} (glob)
 
 Test rebase --collapse
 
   |/
   o  0:07f494440405@default(draft) adda
   
-  $ hg debugsuccessors
-  03f31481307a a7773ffa7edc
-  076e9b2ffbe1 a7773ffa7edc
-  4e322f7ce8e3 000000000000
-  98e4a024635e 9c5494949763
+  $ hg debugobsolete
+  98e4a024635e8c50928144c9277a4388d26bd786 9c54949497631abfb5a255d96746bbd3a42ed2ba 0 {'date': '* *', 'user': 'test'} (glob)
+  4e322f7ce8e3e4203950eac9ece27bf7e45ffa6c 0000000000000000000000000000000000000000 0 {'date': '* *', 'user': 'test'} (glob)
+  076e9b2ffbe11c7bcb9ee97f5c0c8b88a1a10b93 a7773ffa7edcfac27b5dcdb2d5c1036e15a49861 0 {'date': '* *', 'user': 'test'} (glob)
+  03f31481307aaf5275d07ec28c1c59931759ccd2 a7773ffa7edcfac27b5dcdb2d5c1036e15a49861 0 {'date': '* *', 'user': 'test'} (glob)
 
 Test rebase --abort
 
-  $ hg debugsuccessors > ../successors.old
+  $ hg debugobsolete > ../successors.old
   $ hg up 0
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo d > d
   $ hg rebase --abort
   saved backup bundle to $TESTTMP/repo/.hg/strip-backup/03f165c84ea8-backup.hg
   rebase aborted
-  $ hg debugsuccessors > ../successors.new
+  $ hg debugobsolete > ../successors.new
   $ diff -u ../successors.old ../successors.new
 
 Test rebase --continue
   |/
   o  0:07f494440405@default(draft) adda
   
-  $ hg debugsuccessors > ../successors.new
+  $ hg debugobsolete > ../successors.new
   $ diff -u ../successors.old ../successors.new
   --- ../successors.old* (glob)
   +++ ../successors.new* (glob)
-  @@ -1,4 +1,6 @@
-   03f31481307a a7773ffa7edc
-   076e9b2ffbe1 a7773ffa7edc
-  +4b9d80f48523 1951ead97108
-   4e322f7ce8e3 000000000000
-   98e4a024635e 9c5494949763
-  +a31943eabc43 03f165c84ea8
+  @@ -2,3 +2,5 @@
+   4e322f7ce8e3e4203950eac9ece27bf7e45ffa6c 0000000000000000000000000000000000000000 0 {'date': '* *', 'user': 'test'} (glob)
+   076e9b2ffbe11c7bcb9ee97f5c0c8b88a1a10b93 a7773ffa7edcfac27b5dcdb2d5c1036e15a49861 0 {'date': '* *', 'user': 'test'} (glob)
+   03f31481307aaf5275d07ec28c1c59931759ccd2 a7773ffa7edcfac27b5dcdb2d5c1036e15a49861 0 {'date': '* *', 'user': 'test'} (glob)
+  +4b9d80f48523e296f4402cc8e37236b768dfb981 1951ead9710803dbf117e95901954d5ed717f80b 0 {'date': '* *', 'user': 'test'} (glob)
+  +a31943eabc4327df16f9eca71bf7779c32f815f7 03f165c84ea8889fc35a64a392caa7a0084dd212 0 {'date': '* *', 'user': 'test'} (glob)
   [1]

tests/test-obsolete.t

   0d3f46688ccc6e756c7e96cf64c391c411309597
   $ hg debugobsolete 4538525df7e2b9f09423636c61ef63a4cb872a2d 0d3f46688ccc6e756c7e96cf64c391c411309597
   $ hg debugobsolete
-  4538525df7e2b9f09423636c61ef63a4cb872a2d 0d3f46688ccc6e756c7e96cf64c391c411309597 0 {'date': '', 'user': 'test'}
+  4538525df7e2b9f09423636c61ef63a4cb872a2d 0d3f46688ccc6e756c7e96cf64c391c411309597 0 {'date': '', 'user': 'test'} (glob)
 
 
 Test hidden() revset
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add a
   
-  $ hg debugsuccessors
-  0b1b6dd009c0 3734a65252e6
-  0d3f46688ccc 2033b4e49474
-  0d3f46688ccc 725c380fe99b
-  159dfc9fa5d3 9468a5f5d8b2
-  1f0dee641bb7 83b5778897ad
-  4538525df7e2 0d3f46688ccc
-  83b5778897ad
-  909a0fb57e5d 159dfc9fa5d3
-  9468a5f5d8b2 6db5e282cb91
-  95de7fc6918d 909a0fb57e5d
-  a7a6f2b5d8a5 95de7fc6918d
+  $ hg debugobsolete
+  4538525df7e2b9f09423636c61ef63a4cb872a2d 0d3f46688ccc6e756c7e96cf64c391c411309597 0 {'date': '', 'user': 'test'} (glob)
+  0d3f46688ccc6e756c7e96cf64c391c411309597 725c380fe99b5e76613493f0903e8d11ddc70d54 0 {'date': '', 'user': 'test'} (glob)
+  a7a6f2b5d8a54b81bc7aa2fba2934ad6d700a79e 95de7fc6918dea4c9c8d5382f50649794b474c4a 0 {'date': '', 'user': 'test'} (glob)
+  95de7fc6918dea4c9c8d5382f50649794b474c4a 909a0fb57e5d909f353d89e394ffd7e0890fec88 0 {'date': '', 'user': 'test'} (glob)
+  909a0fb57e5d909f353d89e394ffd7e0890fec88 159dfc9fa5d334d7e03a0aecfc7f7ab4c3431fea 0 {'date': '', 'user': 'test'} (glob)
+  1f0dee641bb7258c56bd60e93edfa2405381c41e 83b5778897adafb967ef2f75be3aaa4fce49a4cc 0 {'date': '', 'user': 'test'} (glob)
+  83b5778897adafb967ef2f75be3aaa4fce49a4cc 0 {'date': '', 'user': 'test'} (glob)
+  159dfc9fa5d334d7e03a0aecfc7f7ab4c3431fea 9468a5f5d8b2c5d91e17474e95ae4791e9718fdf 0 {'date': '* *', 'user': 'test'} (glob)
+  0d3f46688ccc6e756c7e96cf64c391c411309597 2033b4e494742365851fac84d276640cbf52833e 0 {'date': '* *', 'user': 'test'} (glob)
+  9468a5f5d8b2c5d91e17474e95ae4791e9718fdf 6db5e282cb91df5c43ff1f1287c119ff83230d42 0 {'date': '', 'user': 'test'} (glob)
+  0b1b6dd009c037985363e2290a0b579819f659db 3734a65252e69ddcced85901647a4f335d40de1e 0 {'date': '* *', 'user': 'test'} (glob)
 
 Check conflict detection
 

tests/test-oldconvert.t

      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add a
   
-  $ hg debugsuccessors
-  7c3bad9141dc d67cd0334eee
+  $ hg debugobsolete
+  7c3bad9141dcb46ff89abf5f61856facd56e476c d67cd0334eeecfded222fed9009f0db4beb57585 0 {'date': '* *', 'user': 'test'} (glob)
   $ hg debugconvertobsolete
   nothing to do
   0 obsolete marker converted
   [255]
   $ hg debugconvertobsolete --traceback
   3 obsolete marker converted
-  $ hg debugsuccessors
-  2c3784e102bb
-  3e03d82708d4 3218406b50ed
-  5c722672795c
-  7c3bad9141dc d67cd0334eee
+  $ hg debugobsolete
+  7c3bad9141dcb46ff89abf5f61856facd56e476c d67cd0334eeecfded222fed9009f0db4beb57585 0 {'date': '* *', 'user': 'test'} (glob)
+  3e03d82708d4da97a92158558dd13386d8f09ad5 3218406b50ed13480765e7c260669620f37fba6e 0 {'date': '* *', 'user': 'Pierre-Yves David <pierre-yves.david@ens-lyon.org>'} (glob)
+  5c722672795c3a2cb94d0cc9a821c394c1475f87 0 {'date': '* *', 'user': 'Pierre-Yves David <pierre-yves.david@logilab.fr>'} (glob)
+  2c3784e102bb34ccc93862af5bd6d609ee30c577 0 {'date': '* *', 'user': 'Pierre-Yves David <pierre-yves.david@logilab.fr>'} (glob)

tests/test-stabilize-order.t

 
   $ hg up 7
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg debugsuccessors > successors.old
+  $ hg debugobsolete > successors.old
   $ hg stabilize -v
   move:[3] addc
   atop:[8] addb
   resolving manifests
   getting c
   c
-  $ hg debugsuccessors > successors.new
+  $ hg debugobsolete > successors.new
   $ diff -u successors.old successors.new
   --- successors.old* (glob)
   +++ successors.new* (glob)
-  @@ -1,5 +1,6 @@
-   3a4a591493f8 f5ff10856e5a
-   3ca0ded0dc50 ab8cbb6d87ff
-  +7a7552255fb5 5e819fbb0d27
-   93418d2c0979 f5ff10856e5a
-   ab8cbb6d87ff 6bf44048e43f
-   ef23d6ef94d6 ab8cbb6d87ff
+  @@ -3,3 +3,4 @@
+   93418d2c0979643ad446f621195e78720edb05b4 f5ff10856e5ab3c8dc420b9c11460e6832a3b78c 0 {'date': '* *', 'user': 'test'} (glob)
+   3a4a591493f80708e46f2bf6d3b4debfad8ff91e 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

tests/test-stabilize-result.t

   |/
   o  0:07f494440405@default(draft) bk:[] adda
   
-  $ hg debugsuccessors
-  102a90ea7b4a 1447e1c4828d
-  41ad4fe8c795 1447e1c4828d
-  cce2c55b8965 000000000000
+  $ hg debugobsolete
+  41ad4fe8c79565a06c89f032ef0937b3cbd68a04 1447e1c4828d2347df8f858aa041305fa4cf7db1 0 {'date': '* *', 'user': 'test'} (glob)
+  102a90ea7b4a3361e4082ed620918c261189a36a 1447e1c4828d2347df8f858aa041305fa4cf7db1 0 {'date': '* *', 'user': 'test'} (glob)
+  cce2c55b896511e0b6e04173c9450ba822ebc740 0000000000000000000000000000000000000000 0 {'date': '* *', 'user': 'test'} (glob)

tests/test-tutorial.t

-../docs/tutorials/tutorial.t
+
+Initial setup
+-------------
+
+This Mercurial configuration example is used for testing.
+.. Various setup
+
+  $ cat >> $HGRCPATH << EOF
+  > [ui]
+  > logtemplate ="{node|short} ({phase}): {desc}\n"
+  > [diff]
+  > git = 1
+  > [alias]
+  > # "-d '0 0'" means that the new commit will be at January 1st 1970.
+  > # This is used for stable hash during test
+  > amend = amend -d '0 0'
+  > [extensions]
+  > hgext.graphlog=
+  > EOF
+
+  $ hg init local
+  $ cat >> local/.hg/hgrc << EOF
+  > [paths]
+  > remote = ../remote
+  > other = ../other
+  > [ui]
+  > user = Babar the King
+  > EOF
+
+  $ hg init remote
+  $ cat >> remote/.hg/hgrc << EOF
+  > [paths]
+  > local = ../local
+  > [ui]
+  > user = Celestine the Queen
+  > EOF
+
+  $ hg init other
+  $ cat >> other/.hg/hgrc << EOF
+  > [ui]
+  > user = Princess Flore
+  > EOF
+
+
+This tutorial use the following configuration for Mercurial:
+
+A compact log template with phase data:
+
+  $ hg showconfig ui
+  ui.slash=True
+  ui.logtemplate="{node|short} ({phase}): {desc}\n"
+
+Improved git format diff:
+
+  $ hg showconfig diff
+  diff.git=1
+
+And the graphlog extension
+  $ hg showconfig extensions
+  extensions.hgext.graphlog=
+
+And of course, we anabled the experimental extensions for mutable history:
+
+  $ $(dirname $TESTDIR)/enable.sh >> $HGRCPATH 2> /dev/null
+
+
+-----------------------
+Single Developer Usage
+-----------------------
+
+This tutorial shows how to use evolution to rewrite history locally.
+
+
+Fixing mistake with `hg amend`
+--------------------------------
+
+We are versionning a shopping list
+
+  $ cd local
+  $ cat  >> shopping << EOF
+  > Spam
+  > Whizzo butter
+  > Albatross
+  > Rat (rather a lot)
+  > Jugged fish
+  > Blancmange
+  > Salmon mousse
+  > EOF
+  $ hg commit -A -m "Monthy Python Shopping list"
+  adding shopping
+
+Its first version is shared with the outside.
+
+  $ hg push remote
+  pushing to $TESTTMP/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+Later I add additional item to my list
+
+  $ cat >> shopping << EOF
+  > Egg
+  > Suggar
+  > Vinegar
+  > Oil
+  > EOF
+  $ hg commit -m "adding condiment"
+  $ cat >> shopping << EOF
+  > Bananos
+  > Pear
+  > Apple
+  > EOF
+  $ hg commit -m "adding fruit"
+
+This history is very linear
+
+  $ hg glog
+  @  d85de4546133 (draft): adding fruit
+  |
+  o  4d5dc8187023 (draft): adding condiment
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+But a typo was made in Babanas!
+
+  $ hg export tip
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID d85de4546133030c82d257bbcdd9b1b416d0c31c
+  # Parent  4d5dc81870237d492284826e21840b2ca00e26d1
+  adding fruit
+  
+  diff --git a/shopping b/shopping
+  --- a/shopping
+  +++ b/shopping
+  @@ -9,3 +9,6 @@
+   Suggar
+   Vinegar
+   Oil
+  +Bananos
+  +Pear
+  +Apple
+
+The faulty changeset is in the "draft" phase because he was not exchanged with
+the outside. The first one have been exchanged and is an immutable public
+changeset.
+
+  $ hg glog
+  @  d85de4546133 (draft): adding fruit
+  |
+  o  4d5dc8187023 (draft): adding condiment
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+hopefully. I can use hg amend to rewrite my faulty changeset!
+
+  $ sed -i'' -e s/Bananos/Banana/ shopping
+  $ hg diff
+  diff --git a/shopping b/shopping
+  --- a/shopping
+  +++ b/shopping
+  @@ -9,6 +9,6 @@
+   Suggar
+   Vinegar
+   Oil
+  -Bananos
+  +Banana
+   Pear
+   Apple
+  $ hg amend
+
+A new changeset with the right diff replace the wrong one.
+
+  $ hg glog
+  @  0cacb48f4482 (draft): adding fruit
+  |
+  o  4d5dc8187023 (draft): adding condiment
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+  $ hg export tip
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID 0cacb48f44828d2fd31c4e45e18fde32a5b2f07b
+  # Parent  4d5dc81870237d492284826e21840b2ca00e26d1
+  adding fruit
+  
+  diff --git a/shopping b/shopping
+  --- a/shopping
+  +++ b/shopping
+  @@ -9,3 +9,6 @@
+   Suggar
+   Vinegar
+   Oil
+  +Banana
+  +Pear
+  +Apple
+
+Getting Ride of branchy history
+----------------------------------
+
+While I was working on my list. someone help made a change remotly.
+
+  $ cd ../remote
+  $ hg up -q
+  $ sed -i'' -e 's/Spam/Spam Spam Spam/' shopping
+  $ hg ci -m 'SPAM'
+  $ cd ../local
+
+I'll get this remote changeset when pulling
+
+  $ hg pull remote
+  pulling from $TESTTMP/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads .' to see heads, 'hg merge' to merge)
+
+I now have a new heads. Note that this remote head is immutable
+
+  $ hg log -G
+  o  9ca060c80d74 (public): SPAM
+  |
+  | @  0cacb48f4482 (draft): adding fruit
+  | |
+  | o  4d5dc8187023 (draft): adding condiment
+  |/
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+instead of merging my head with the new one. I'm going to rebase my work
+
+  $ hg diff
+  $ hg rebase -d 9ca060c80d74 -s 4d5dc8187023
+  merging shopping
+  merging shopping
+
+
+My local work is now rebased on the remote one.
+
+  $ hg log -G
+  @  387187ad9bd9 (draft): adding fruit
+  |
+  o  dfd3a2d7691e (draft): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+Removing changeset
+------------------------
+
+I add new item to my list
+
+  $ cat >> shopping << EOF
+  > car
+  > bus
+  > plane
+  > boat
+  > EOF
+  $ hg ci -m 'transport'
+  $ hg log -G
+  @  d58c77aa15d7 (draft): transport
+  |
+  o  387187ad9bd9 (draft): adding fruit
+  |
+  o  dfd3a2d7691e (draft): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+I have a new commit but I realize that don't want it. (transport shop list does
+not fit well in my standard shopping list)
+
+  $ hg prune . # . is for working directory parent
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory now at 387187ad9bd9
+
+The silly changeset is gone.
+
+  $ hg log -G
+  @  387187ad9bd9 (draft): adding fruit
+  |
+  o  dfd3a2d7691e (draft): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+Reordering changeset
+------------------------
+
+
+We create two changesets.
+
+
+  $ cat >> shopping << EOF
+  > Shampoo
+  > Toothbrush
+  > ... More bathroom stuff to come
+  > Towel
+  > Soap
+  > EOF
+  $ hg ci -m 'bathroom stuff' -q # XXX remove the -q
+
+  $ sed -i'' -e 's/Spam/Spam Spam Spam/g' shopping
+  $ hg ci -m 'SPAM SPAM'
+  $ hg log -G
+  @  c48f32fb1787 (draft): SPAM SPAM
+  |
+  o  8d39a843582d (draft): bathroom stuff
+  |
+  o  387187ad9bd9 (draft): adding fruit
+  |
+  o  dfd3a2d7691e (draft): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+.. note: don't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are immutable.
+
+I now want to push to remote all my change but the bathroom one that i'm not
+totally happy with yet. To be able to push "SPAM SPAM" I need a version of "SPAM SPAM" not children of
+"bathroom stuff"
+
+You can use 'rebase -r' or 'graft -O' for that:
+
+  $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg graft -O c48f32fb1787 # moving "SPAM SPAM" to the working directory parent
+  grafting revision 10
+  merging shopping
+  $ hg log -G
+  @  a2fccc2e7b08 (draft): SPAM SPAM
+  |
+  | o  8d39a843582d (draft): bathroom stuff
+  |/
+  o  387187ad9bd9 (draft): adding fruit
+  |
+  o  dfd3a2d7691e (draft): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+We have a new SPAM SPAM version without the bathroom stuff
+
+  $ grep Spam shopping  # enouth spam
+  Spam Spam Spam Spam Spam Spam Spam Spam Spam
+  $ grep Toothbrush shopping # no Toothbrush
+  [1]
+  $ hg export .
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID a2fccc2e7b08bbce6af7255b989453f7089e4cf0
+  # Parent  387187ad9bd9d8f9a00a9fa804a26231db547429
+  SPAM SPAM
+  
+  diff --git a/shopping b/shopping
+  --- a/shopping
+  +++ b/shopping
+  @@ -1,4 +1,4 @@
+  -Spam Spam Spam
+  +Spam Spam Spam Spam Spam Spam Spam Spam Spam
+   Whizzo butter
+   Albatross
+   Rat (rather a lot)
+
+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
+
+we can now push our change:
+
+  $ hg push remote
+  pushing to $TESTTMP/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+
+for simplicity shake we get the bathroom change in line again
+
+  $ hg rebase -Dr 8d39a843582d -d a2fccc2e7b08
+  merging shopping
+  $ hg phase --draft .
+  $ hg log -G
+  @  8a79ae8b029e (draft): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+
+
+Splitting change
+------------------
+
+To be done (currently achieve with "two commit + debugobsolete")
+
+Collapsing change
+------------------
+
+To be done (currently achieve with "revert + debugobsolete" or "rebase --collapse")
+
+
+
+
+
+
+-----------------------
+Collaboration
+-----------------------
+
+
+sharing mutable changeset
+----------------------------
+
+To share mutable changeset with other just check that the repo you interact
+with is "not publishing". Otherwise you will get the previously observe
+behavior where exchanged changeset are automatically published.
+
+  $ cd ../remote
+  $ hg -R ../local/ showconfig phases
+
+the localrepo does not have any specific configuration for `phases.publish`. It
+is ``true`` by default.
+
+  $ hg pull local
+  pulling from $TESTTMP/local
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg log -G
+  o  8a79ae8b029e (public): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  @  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+
+
+We do not want to publish the "bathroom changeset". Let's rollback the last transaction
+
+  $ hg rollback
+  repository tip rolled back to revision 4 (undo pull)
+  $ hg log -G
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  @  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+Let's make the local repo "non publishing"
+
+  $ echo '[phases]' >> ../local/.hg/hgrc
+  $ echo 'publish=false' >> ../local/.hg/hgrc
+  $ echo '[phases]' >> .hg/hgrc
+  $ echo 'publish=false' >> .hg/hgrc
+  $ hg showconfig phases
+  phases.publish=false
+  $ hg -R ../local/ showconfig phases
+  phases.publish=false
+
+
+I can now exchange mutable changeset between "remote" and "local" repository.
+
+  $ hg pull local
+  pulling from $TESTTMP/local
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg log -G
+  o  8a79ae8b029e (draft): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  @  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+Rebasing unstable change after pull
+----------------------------------------------
+
+Remotely someone add a new changeset on top of the mutable "bathroom" on.
+
+  $ hg up 8a79ae8b029e -q
+  $ cat >> shopping << EOF
+  > Giraffe
+  > Rhino
+  > Lion
+  > Bear
+  > EOF
+  $ hg ci -m 'animals'
+
+But at the same time, locally, this same "bathroom changeset" was updated.
+
+  $ cd ../local
+  $ hg up 8a79ae8b029e -q
+  $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping
+  $ hg amend
+  $ hg log -G
+  @  ffa278c50818 (draft): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+
+When we pull from remote again we get an unstable state!
+
+
+  $ hg pull remote
+  pulling from $TESTTMP/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads .' to see heads, 'hg merge' to merge)
+  1 new unstables changesets
+
+
+The new changeset "animal" is based one an old changeset of "bathroom". You can
+see both version showing up in the log.
+
+  $ hg log -G
+  o  9ac5d0e790a2 (draft): animals
+  |
+  | @  ffa278c50818 (draft): bathroom stuff
+  | |
+  x |  8a79ae8b029e (draft): bathroom stuff
+  |/
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+The older version 8a79ae8b029e 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 ffa278c50818 as a new version of 8a79ae8b029e. 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 an unstable changeset: 9ac5d0e790a2!
+  (use 'hg stabilize' to get a stable history or --force to ignore warnings)
+  [255]
+ 
+
+
+
+To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto
+ffa278c50818 the "hg stabilize" command will make this for you.
+
+It has a --dry-run option to only suggest the next move.
+
+  $ hg stabilize --dry-run
+  move:[15] animals
+  atop:[14] bathroom stuff
+  hg rebase -Dr 9ac5d0e790a2 -d ffa278c50818
+
+Let's do it
+
+  $ hg rebase -Dr 9ac5d0e790a2 -d ffa278c50818
+  merging shopping
+
+The old version of bathroom is hidden again.
+
+  $ hg log -G
+  @  437efbcaf700 (draft): animals
+  |
+  o  ffa278c50818 (draft): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+
+We can push this evolution to remote
+
+  $ hg push remote
+  pushing to $TESTTMP/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files (+1 heads)
+
+remote get a warning that current working directory is based on an obsolete changeset
+
+  $ cd ../remote
+  $ hg pull local # we up again to trigger the warning. it was displayed during the push
+  pulling from $TESTTMP/local
+  searching for changes
+  no changes found
+  Working directory parent is obsolete
+
+  $ hg up 437efbcaf700
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Relocating unstable change after prune
+----------------------------------------------
+
+The remote guy keep working
+
+  $ sed -i'' -e 's/Spam/Spam Spam Spam Spam/g' shopping
+  $ hg commit -m "SPAM SPAM SPAM"
+
+I'm pulling its work locally.
+
+  $ cd ../local
+  $ hg pull remote
+  pulling from $TESTTMP/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg log -G
+  o  ae45c0c3092a (draft): SPAM SPAM SPAM
+  |
+  @  437efbcaf700 (draft): animals
+  |
+  o  ffa278c50818 (draft): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+In the mean time I noticed you can't buy animals in a super market and I prune the animal changeset:
+
+  $ hg prune 437efbcaf700
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory now at ffa278c50818
+  1 new unstables changesets
+
+
+The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset
+is neither dead or obsolete.  My repository is in an unstable state again.
+
+  $ hg log -G
+  o  ae45c0c3092a (draft): SPAM SPAM SPAM
+  |
+  x  437efbcaf700 (draft): animals
+  |
+  @  ffa278c50818 (draft): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+  $ hg log -r 'unstable()'
+  ae45c0c3092a (draft): SPAM SPAM SPAM
+
+# XXX make prune stabilization works
+#  $ hg stabilize --any
+#  merging shopping
+
+  $ hg graft -O ae45c0c3092a
+  grafting revision 17
+  merging shopping
+
+  $ hg log -G
+  @  20de1fb1cec5 (draft): SPAM SPAM SPAM
+  |
+  o  ffa278c50818 (draft): bathroom stuff
+  |
+  o  a2fccc2e7b08 (public): SPAM SPAM
+  |
+  o  387187ad9bd9 (public): adding fruit
+  |
+  o  dfd3a2d7691e (public): adding condiment
+  |
+  o  9ca060c80d74 (public): SPAM
+  |
+  o  7e82d3f3c2cb (public): Monthy Python Shopping list
+  
+
+
+Handling Conflicting amend
+----------------------------------------------
+
+We can detect that multiple diverging//conflicting amend have been made. There
+will be a "evol-merge" command to merge conflicting amend
+
+This command is not ready yet.

tests/test-uncommit.t

    * touncommit-bm             4:e8db4aa611f6
      touncommit-bm-inactive    4:e8db4aa611f6
      unrelated                 2:f63b90038565
-  $ hg debugsuccessors
-  5eb72dbe0cb4 e8db4aa611f6
+  $ hg debugobsolete
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 e8db4aa611f6d5706374288e6898e498f5c44098 0 {'date': '* *', 'user': 'test'} (glob)
 
 Test phase is preserved, no local changes
 
   |
   o  0:07f494440405@default(stable/draft) adda
   
-  $ hg debugsuccessors
-  5eb72dbe0cb4 c706fe2c12f8
-  5eb72dbe0cb4 e8db4aa611f6
+  $ hg debugobsolete
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 e8db4aa611f6d5706374288e6898e498f5c44098 0 {'date': '* *', 'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c706fe2c12f83ba5010cb60ea6af3bd1f0c2d6d3 0 {'date': '* *', 'user': 'test'} (glob)
 
 Test --all
 
   $ hg st --copies --change .
   A e
 
-  $ hg debugsuccessors
-  5eb72dbe0cb4 c4cbebac3751
-  5eb72dbe0cb4 c706fe2c12f8
-  5eb72dbe0cb4 e8db4aa611f6
+  $ hg debugobsolete
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 e8db4aa611f6d5706374288e6898e498f5c44098 0 {'date': '* *', 'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c706fe2c12f83ba5010cb60ea6af3bd1f0c2d6d3 0 {'date': '* *', 'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c4cbebac3751269bdf12d1466deabcc78521d272 0 {'date': '* *', 'user': 'test'} (glob)
 
 Display a warning if nothing left
 
   $ hg uncommit e
   new changeset is empty
   (use "hg kill ." to remove it)
-  $ hg debugsuccessors
-  5eb72dbe0cb4 c4cbebac3751
-  5eb72dbe0cb4 c706fe2c12f8
-  5eb72dbe0cb4 e8db4aa611f6
-  c4cbebac3751 4f1c269eab68
+  $ hg debugobsolete
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 e8db4aa611f6d5706374288e6898e498f5c44098 0 {'date': '* *', 'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c706fe2c12f83ba5010cb60ea6af3bd1f0c2d6d3 0 {'date': '* *', 'user': 'test'} (glob)
+  5eb72dbe0cb409d094e3b4ae8eaa30071c1b8730 c4cbebac3751269bdf12d1466deabcc78521d272 0 {'date': '* *', 'user': 'test'} (glob)
+  c4cbebac3751269bdf12d1466deabcc78521d272 4f1c269eab68720f54e88ce3c1dc02b2858b6b89 0 {'date': '* *', 'user': 'test'} (glob)
 
 Test instability warning