cmdutil: remove the redundant commit during amend
authorSaurabh Singh <singhsrb@fb.com>
Fri, 01 Sep 2017 12:34:36 -0700
changeset 39573 e8a7c1a0565ab583f93caaf263999760c078281a
parent 39572 6c5cdb02f2f91fab64090cbc5a661b1a79a538cd
child 39574 a39dce4a76b87b4621eeca11265e5c9b445a8405
push id568
push usergszorc@mozilla.com
push dateThu, 14 Sep 2017 04:21:02 +0000
cmdutil: remove the redundant commit during amend There was an extra commit made during the amend operation to track the changes to the working copy. However, this logic was written a long time back and newer API's make this extra commit redundant. Therefore, I am removing the extra commit. After this change, I noticed that - Execution time of the cmdutil.amend improved by over 40%. - Execution time of "hg commit --amend" improved by over 20%. Test Plan: I ensured that the all the hg tests passed after the change. I had to fix a few tests which were aware of the extra commit made during the amend. Differential Revision: https://phab.mercurial-scm.org/D636
mercurial/cmdutil.py
tests/test-amend.t
tests/test-commit-amend.t
tests/test-commit-interactive-curses.t
tests/test-histedit-obsolete.t
tests/test-log.t
tests/test-obsmarker-template.t
tests/test-obsolete.t
tests/test-rebase-obsolete.t
tests/test-treemanifest.t
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3021,98 +3021,99 @@ def samefile(f, ctx1, ctx2):
             b = ctx2.filectx(f)
             return (not a.cmp(b)
                     and a.flags() == b.flags())
         else:
             return False
     else:
         return f not in ctx2.manifest()
 
+# TODO: remove the commitfunc parameter because it is no longer used
 def amend(ui, repo, commitfunc, old, extra, pats, opts):
     # avoid cycle context -> subrepo -> cmdutil
     from . import context
 
     # amend will reuse the existing user if not specified, but the obsolete
     # marker creation requires that the current user's name is specified.
     if obsolete.isenabled(repo, obsolete.createmarkersopt):
         ui.username() # raise exception if username not set
 
     ui.note(_('amending changeset %s\n') % old)
     base = old.p1()
 
     with repo.wlock(), repo.lock(), repo.transaction('amend'):
-        # See if we got a message from -m or -l, if not, open the editor
-        # with the message of the changeset to amend
-        message = logmessage(ui, opts)
-        # ensure logfile does not conflict with later enforcement of the
-        # message. potential logfile content has been processed by
-        # `logmessage` anyway.
-        opts.pop('logfile')
-        # First, do a regular commit to record all changes in the working
-        # directory (if there are any)
-        ui.callhooks = False
-        activebookmark = repo._bookmarks.active
-        try:
-            repo._bookmarks.active = None
-            opts['message'] = 'temporary amend commit for %s' % old
-            node = commit(ui, repo, commitfunc, pats, opts)
-        finally:
-            repo._bookmarks.active = activebookmark
-            ui.callhooks = True
-        ctx = repo[node]
-
         # Participating changesets:
         #
-        # node/ctx o - new (intermediate) commit that contains changes
-        #          |   from working dir to go into amending commit
-        #          |   (or a workingctx if there were no changes)
+        # wctx     o - workingctx that contains changes from working copy
+        #          |   to go into amending commit
         #          |
         # old      o - changeset to amend
         #          |
         # base     o - first parent of the changeset to amend
+        wctx = repo[None]
 
         # Update extra dict from amended commit (e.g. to preserve graft
         # source)
         extra.update(old.extra())
 
-        # Also update it from the intermediate commit or from the wctx
-        extra.update(ctx.extra())
+        # Also update it from the from the wctx
+        extra.update(wctx.extra())
+
+        user = opts.get('user') or old.user()
+        date = opts.get('date') or old.date()
 
         if len(old.parents()) > 1:
             # ctx.files() isn't reliable for merges, so fall back to the
             # slower repo.status() method
             files = set([fn for st in repo.status(base, old)[:3]
                          for fn in st])
         else:
             files = set(old.files())
 
-        # Second, we use either the commit we just did, or if there were no
-        # changes the parent of the working directory as the version of the
-        # files in the final amend commit
-        if node:
-            ui.note(_('copying changeset %s to %s\n') % (ctx, base))
-
-            user = ctx.user()
-            date = ctx.date()
+        # add/remove the files to the working copy if the "addremove" option
+        # was specified.
+        matcher = scmutil.match(wctx, pats, opts)
+        if (opts.get('addremove')
+            and scmutil.addremove(repo, matcher, "", opts)):
+            raise error.Abort(
+                _("failed to mark all new/missing files as added/removed"))
+
+        filestoamend = set(f for f in wctx.files() if matcher(f))
+
+        changes = (len(filestoamend) > 0)
+        if changes:
             # Recompute copies (avoid recording a -> b -> a)
-            copied = copies.pathcopies(base, ctx)
+            copied = copies.pathcopies(base, wctx, matcher)
             if old.p2:
-                copied.update(copies.pathcopies(old.p2(), ctx))
+                copied.update(copies.pathcopies(old.p2(), wctx, matcher))
 
             # Prune files which were reverted by the updates: if old
-            # introduced file X and our intermediate commit, node,
-            # renamed that file, then those two files are the same and
+            # introduced file X and the file was renamed in the working
+            # copy, then those two files are the same and
             # we can discard X from our list of files. Likewise if X
             # was deleted, it's no longer relevant
-            files.update(ctx.files())
-            files = [f for f in files if not samefile(f, ctx, base)]
+            files.update(filestoamend)
+            files = [f for f in files if not samefile(f, wctx, base)]
 
             def filectxfn(repo, ctx_, path):
                 try:
-                    fctx = ctx[path]
+                    # If the file being considered is not amongst the files
+                    # to be amended, we should return the file context from the
+                    # old changeset. This avoids issues when only some files in
+                    # the working copy are being amended but there are also
+                    # changes to other files from the old changeset.
+                    if path not in filestoamend:
+                        return old.filectx(path)
+
+                    fctx = wctx[path]
+
+                    # Return None for removed files.
+                    if not fctx.exists():
+                        return None
+
                     flags = fctx.flags()
                     mctx = context.memfilectx(repo,
                                               fctx.path(), fctx.data(),
                                               islink='l' in flags,
                                               isexec='x' in flags,
                                               copied=copied.get(path))
                     return mctx
                 except KeyError:
@@ -3122,21 +3123,24 @@ def amend(ui, repo, commitfunc, old, ext
 
             # Use version of files as in the old cset
             def filectxfn(repo, ctx_, path):
                 try:
                     return old.filectx(path)
                 except KeyError:
                     return None
 
-            user = opts.get('user') or old.user()
-            date = opts.get('date') or old.date()
+        # See if we got a message from -m or -l, if not, open the editor with
+        # the message of the changeset to amend.
+        message = logmessage(ui, opts)
+
         editform = mergeeditform(old, 'commit.amend')
         editor = getcommiteditor(editform=editform,
                                  **pycompat.strkwargs(opts))
+
         if not message:
             editor = getcommiteditor(edit=True, editform=editform)
             message = old.description()
 
         pureextra = extra.copy()
         extra['amend_source'] = old.hex()
 
         new = context.memctx(repo,
@@ -3145,17 +3149,17 @@ def amend(ui, repo, commitfunc, old, ext
                              files=files,
                              filectxfn=filectxfn,
                              user=user,
                              date=date,
                              extra=extra,
                              editor=editor)
 
         newdesc = changelog.stripdesc(new.description())
-        if ((not node)
+        if ((not changes)
             and newdesc == old.description()
             and user == old.user()
             and date == old.date()
             and pureextra == old.extra()):
             # nothing changed. continuing here would create a new node
             # anyway because of the amend_source noise.
             #
             # This not what we expect from amend.
@@ -3167,20 +3171,37 @@ def amend(ui, repo, commitfunc, old, ext
             commitphase = old.phase()
         overrides = {('phases', 'new-commit'): commitphase}
         with ui.configoverride(overrides, 'amend'):
             newid = repo.commitctx(new)
 
         # Reroute the working copy parent to the new changeset
         repo.setparents(newid, nullid)
         mapping = {old.node(): (newid,)}
-        if node:
-            mapping[node] = ()
         scmutil.cleanupnodes(repo, mapping, 'amend')
 
+        # Fixing the dirstate because localrepo.commitctx does not update
+        # it. This is rather convenient because we did not need to update
+        # the dirstate for all the files in the new commit which commitctx
+        # could have done if it updated the dirstate. Now, we can
+        # selectively update the dirstate only for the amended files.
+        dirstate = repo.dirstate
+
+        # Update the state of the files which were added and
+        # and modified in the amend to "normal" in the dirstate.
+        normalfiles = set(wctx.modified() + wctx.added()) & filestoamend
+        for f in normalfiles:
+            dirstate.normal(f)
+
+        # Update the state of files which were removed in the amend
+        # to "removed" in the dirstate.
+        removedfiles = set(wctx.removed()) & filestoamend
+        for f in removedfiles:
+            dirstate.drop(f)
+
     return newid
 
 def commiteditor(repo, ctx, subs, editform=''):
     if ctx.description():
         return ctx.description()
     return commitforceeditor(repo, ctx, subs, editform=editform,
                              unchangedmessagedetection=True)
 
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -24,17 +24,17 @@ Basic amend
   > |
   > A
   > EOS
 
   $ hg update B -q
   $ echo 2 >> B
 
   $ hg amend
-  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-af2c0941-amend.hg (glob) (obsstore-off !)
+  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (glob) (obsstore-off !)
 #if obsstore-off
   $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
   @  1 be169c7e8dbe B
   |  diff --git a/B b/B
   |  new file mode 100644
   |  --- /dev/null
   |  +++ b/B
   |  @@ -0,0 +1,1 @@
@@ -46,33 +46,24 @@ Basic amend
      --- /dev/null
      +++ b/A
      @@ -0,0 +1,1 @@
      +A
      \ No newline at end of file
   
 #else
   $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n'
-  @  3 be169c7e8dbe B
+  @  2 be169c7e8dbe B
   |  diff --git a/B b/B
   |  new file mode 100644
   |  --- /dev/null
   |  +++ b/B
   |  @@ -0,0 +1,1 @@
   |  +B2
   |
-  | x  2 edf08988b141 temporary amend commit for 112478962961
-  | |  diff --git a/B b/B
-  | |  --- a/B
-  | |  +++ b/B
-  | |  @@ -1,1 +1,1 @@
-  | |  -B
-  | |  \ No newline at end of file
-  | |  +B2
-  | |
   | x  1 112478962961 B
   |/   diff --git a/B b/B
   |    new file mode 100644
   |    --- /dev/null
   |    +++ b/B
   |    @@ -0,0 +1,1 @@
   |    +B
   |    \ No newline at end of file
@@ -95,23 +86,23 @@ Nothing changed
   [1]
 
 Matcher and metadata options
 
   $ echo 3 > C
   $ echo 4 > D
   $ hg add C D
   $ hg amend -m NEWMESSAGE -I C
-  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-c24d73fe-amend.hg (glob) (obsstore-off !)
+  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (glob) (obsstore-off !)
   $ hg log -r . -T '{node|short} {desc} {files}\n'
   c7ba14d9075b NEWMESSAGE B C
   $ echo 5 > E
   $ rm C
   $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D
-  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b26ed45c-amend.hg (glob) (obsstore-off !)
+  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (glob) (obsstore-off !)
   $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n'
   14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000.01000
 
 Amend with editor
 
   $ cat > $TESTTMP/prefix.sh <<'EOF'
   > printf 'EDITED: ' > $TESTTMP/msg
   > cat "$1" >> $TESTTMP/msg
@@ -148,17 +139,17 @@ Interactive mode
   diff --git a/F b/F
   new file mode 100644
   examine changes to 'F'? [Ynesfdaq?] y
   
   diff --git a/G b/G
   new file mode 100644
   examine changes to 'G'? [Ynesfdaq?] n
   
-  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-7ae43d04-amend.hg (glob) (obsstore-off !)
+  saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (glob) (obsstore-off !)
   $ hg log -r . -T '{files}\n'
   B D F
 
 Amend in the middle of a stack
 
   $ hg init $TESTTMP/repo2
   $ cd $TESTTMP/repo2
   $ hg debugdrawdag <<'EOS'
@@ -181,17 +172,17 @@ With allowunstable, amend could work in 
 
   $ cat >> $HGRCPATH <<EOF
   > [experimental]
   > stabilization=createmarkers, allowunstable
   > EOF
 
   $ hg amend
   $ hg log -T '{rev} {node|short} {desc}\n' -G
-  @  4 be169c7e8dbe B
+  @  3 be169c7e8dbe B
   |
   | o  2 26805aba1e60 C
   | |
   | x  1 112478962961 B
   |/
   o  0 426bada5c675 A
   
 #endif
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -35,17 +35,17 @@ Nothing to amend:
 
 Amending changeset with changes in working dir:
 (and check that --message does not trigger an editor)
 
   $ echo a >> a
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
   pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
   43f1ba15f28a tip
-  saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-f1bf3ab8-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg (glob)
   $ echo 'pretxncommit.foo = ' >> $HGRCPATH
   $ hg diff -c .
   diff -r ad120869acf0 -r 43f1ba15f28a a
   --- a/a	Thu Jan 01 00:00:00 1970 +0000
   +++ b/a	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,3 @@
    a
   +a
@@ -64,91 +64,97 @@ Amending changeset with changes in worki
   
 
 Check proper abort for empty message
 
   $ cat > editor.sh << '__EOF__'
   > #!/bin/sh
   > echo "" > "$1"
   > __EOF__
+
+Update the existing file to ensure that the dirstate is not in pending state
+(where the status of some files in the working copy is not known yet). This in
+turn ensures that when the transaction is aborted due to an empty message during
+the amend, there should be no rollback.
+  $ echo a >> a
+
   $ echo b > b
   $ hg add b
   $ hg summary
   parent: 1:43f1ba15f28a tip
    amend base1
   branch: default
-  commit: 1 added, 1 unknown
+  commit: 1 modified, 1 added, 1 unknown
   update: (current)
   phases: 2 draft
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
-  transaction abort!
-  rollback completed
   abort: empty commit message
   [255]
   $ hg summary
   parent: 1:43f1ba15f28a tip
    amend base1
   branch: default
-  commit: 1 added, 1 unknown
+  commit: 1 modified, 1 added, 1 unknown
   update: (current)
   phases: 2 draft
 
-Add new file:
+Add new file along with modified existing file:
   $ hg ci --amend -m 'amend base1 new file'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-7a3b3496-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg (glob)
 
 Remove file that was added in amended commit:
 (and test logfile option)
 (and test that logfile option do not trigger an editor)
 
   $ hg rm b
   $ echo 'amend base1 remove new file' > ../logfile
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
-  saved backup bundle to $TESTTMP/.hg/strip-backup/b8e3cb2b3882-0b55739a-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg (glob)
 
   $ hg cat b
-  b: no such file in rev 74609c7f506e
+  b: no such file in rev 47343646fa3d
   [1]
 
 No changes, just a different message:
 
   $ hg ci -v --amend -m 'no changes, new message'
-  amending changeset 74609c7f506e
-  copying changeset 74609c7f506e to ad120869acf0
+  amending changeset 47343646fa3d
+  copying changeset 47343646fa3d to ad120869acf0
   committing files:
   a
   committing manifest
   committing changelog
   1 changesets found
   uncompressed size of bundle content:
        254 (changelog)
        163 (manifests)
-       129  a
-  saved backup bundle to $TESTTMP/.hg/strip-backup/74609c7f506e-1bfde511-amend.hg (glob)
+       131  a
+  saved backup bundle to $TESTTMP/.hg/strip-backup/47343646fa3d-c2758885-amend.hg (glob)
   1 changesets found
   uncompressed size of bundle content:
        250 (changelog)
        163 (manifests)
-       129  a
+       131  a
   adding branch
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  committed changeset 1:1cd866679df8
+  committed changeset 1:401431e913a1
   $ hg diff -c .
-  diff -r ad120869acf0 -r 1cd866679df8 a
+  diff -r ad120869acf0 -r 401431e913a1 a
   --- a/a	Thu Jan 01 00:00:00 1970 +0000
   +++ b/a	Thu Jan 01 00:00:00 1970 +0000
-  @@ -1,1 +1,3 @@
+  @@ -1,1 +1,4 @@
    a
   +a
   +a
+  +a
   $ hg log
-  changeset:   1:1cd866679df8
+  changeset:   1:401431e913a1
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     no changes, new message
   
   changeset:   0:ad120869acf0
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -163,22 +169,22 @@ Disable default date on commit so when -
 Test -u/-d:
 
   $ cat > .hg/checkeditform.sh <<EOF
   > env | grep HGEDITFORM
   > true
   > EOF
   $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0'
   HGEDITFORM=commit.amend.normal
-  saved backup bundle to $TESTTMP/.hg/strip-backup/1cd866679df8-5f5bcb85-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg (glob)
   $ echo a >> a
   $ hg ci --amend -u foo -d '1 0'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/780e6f23e03d-83b10a27-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg (glob)
   $ hg log -r .
-  changeset:   1:5f357c7560ab
+  changeset:   1:a9a13940fc03
   tag:         tip
   user:        foo
   date:        Thu Jan 01 00:00:01 1970 +0000
   summary:     no changes, new message
   
 
 Open editor with old commit message if a message isn't given otherwise:
 
@@ -192,34 +198,34 @@ at first, test saving last-message.txt
 
   $ cat > .hg/hgrc << '__EOF__'
   > [hooks]
   > pretxncommit.test-saving-last-message = false
   > __EOF__
 
   $ rm -f .hg/last-message.txt
   $ hg commit --amend -v -m "message given from command line"
-  amending changeset 5f357c7560ab
-  copying changeset 5f357c7560ab to ad120869acf0
+  amending changeset a9a13940fc03
+  copying changeset a9a13940fc03 to ad120869acf0
   committing files:
   a
   committing manifest
   committing changelog
   running hook pretxncommit.test-saving-last-message: false
   transaction abort!
   rollback completed
   abort: pretxncommit.test-saving-last-message hook exited with status 1
   [255]
   $ cat .hg/last-message.txt
   message given from command line (no-eol)
 
   $ rm -f .hg/last-message.txt
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
-  amending changeset 5f357c7560ab
-  copying changeset 5f357c7560ab to ad120869acf0
+  amending changeset a9a13940fc03
+  copying changeset a9a13940fc03 to ad120869acf0
   no changes, new message
   
   
   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   HG: Leave message empty to abort commit.
   HG: --
   HG: user: foo
   HG: branch 'default'
@@ -240,18 +246,18 @@ at first, test saving last-message.txt
   $ cat > .hg/hgrc << '__EOF__'
   > [hooks]
   > pretxncommit.test-saving-last-message =
   > __EOF__
 
 then, test editing custom commit message
 
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
-  amending changeset 5f357c7560ab
-  copying changeset 5f357c7560ab to ad120869acf0
+  amending changeset a9a13940fc03
+  copying changeset a9a13940fc03 to ad120869acf0
   no changes, new message
   
   
   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   HG: Leave message empty to abort commit.
   HG: --
   HG: user: foo
   HG: branch 'default'
@@ -259,155 +265,148 @@ then, test editing custom commit message
   committing files:
   a
   committing manifest
   committing changelog
   1 changesets found
   uncompressed size of bundle content:
        249 (changelog)
        163 (manifests)
-       131  a
-  saved backup bundle to $TESTTMP/.hg/strip-backup/5f357c7560ab-e7c84ade-amend.hg (glob)
+       133  a
+  saved backup bundle to $TESTTMP/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg (glob)
   1 changesets found
   uncompressed size of bundle content:
        257 (changelog)
        163 (manifests)
-       131  a
+       133  a
   adding branch
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  committed changeset 1:7ab3bf440b54
+  committed changeset 1:64a124ba1b44
 
 Same, but with changes in working dir (different code path):
 
   $ echo a >> a
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
-  amending changeset 7ab3bf440b54
-  committing files:
-  a
-  committing manifest
-  committing changelog
-  copying changeset a0ea9b1a4c8c to ad120869acf0
+  amending changeset 64a124ba1b44
   another precious commit message
   
   
   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   HG: Leave message empty to abort commit.
   HG: --
   HG: user: foo
   HG: branch 'default'
   HG: changed a
   committing files:
   a
   committing manifest
   committing changelog
-  2 changesets found
-  uncompressed size of bundle content:
-       464 (changelog)
-       322 (manifests)
-       249  a
-  saved backup bundle to $TESTTMP/.hg/strip-backup/7ab3bf440b54-8e3b5088-amend.hg (glob)
   1 changesets found
   uncompressed size of bundle content:
        257 (changelog)
        163 (manifests)
        133  a
+  saved backup bundle to $TESTTMP/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg (glob)
+  1 changesets found
+  uncompressed size of bundle content:
+       257 (changelog)
+       163 (manifests)
+       135  a
   adding branch
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  committed changeset 1:ea22a388757c
+  committed changeset 1:7892795b8e38
 
   $ rm editor.sh
   $ hg log -r .
-  changeset:   1:ea22a388757c
+  changeset:   1:7892795b8e38
   tag:         tip
   user:        foo
   date:        Thu Jan 01 00:00:01 1970 +0000
   summary:     another precious commit message
   
 
 Moving bookmarks, preserve active bookmark:
 
   $ hg book book1
   $ hg book book2
   $ hg ci --amend -m 'move bookmarks'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/ea22a388757c-e51094db-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg (glob)
   $ hg book
-     book1                     1:6cec5aa930e2
-   * book2                     1:6cec5aa930e2
+     book1                     1:8311f17e2616
+   * book2                     1:8311f17e2616
   $ echo a >> a
   $ hg ci --amend -m 'move bookmarks'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/6cec5aa930e2-e9b06de4-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg (glob)
   $ hg book
-     book1                     1:48bb6e53a15f
-   * book2                     1:48bb6e53a15f
+     book1                     1:a3b65065808c
+   * book2                     1:a3b65065808c
 
 abort does not loose bookmarks
 
   $ cat > editor.sh << '__EOF__'
   > #!/bin/sh
   > echo "" > "$1"
   > __EOF__
   $ echo a >> a
   $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
-  transaction abort!
-  rollback completed
   abort: empty commit message
   [255]
   $ hg book
-     book1                     1:48bb6e53a15f
-   * book2                     1:48bb6e53a15f
+     book1                     1:a3b65065808c
+   * book2                     1:a3b65065808c
   $ hg revert -Caq
   $ rm editor.sh
 
   $ echo '[defaults]' >> $HGRCPATH
   $ echo "commit=-d '0 0'" >> $HGRCPATH
 
 Moving branches:
 
   $ hg branch foo
   marked working directory as branch foo
   (branches are permanent and global, did you want a bookmark?)
   $ echo a >> a
   $ hg ci -m 'branch foo'
   $ hg branch default -f
   marked working directory as branch default
   $ hg ci --amend -m 'back to default'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/8ac881fbf49d-fd962fef-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg (glob)
   $ hg branches
-  default                        2:ce12b0b57d46
+  default                        2:9c07515f2650
 
 Close branch:
 
   $ hg up -q 0
   $ echo b >> b
   $ hg branch foo
   marked working directory as branch foo
   (branches are permanent and global, did you want a bookmark?)
   $ hg ci -Am 'fork'
   adding b
   $ echo b >> b
   $ hg ci -mb
   $ hg ci --amend --close-branch -m 'closing branch foo'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-6701c392-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-54245dc7-amend.hg (glob)
 
 Same thing, different code path:
 
   $ echo b >> b
   $ hg ci -m 'reopen branch'
   reopening closed branch head 4
   $ echo b >> b
   $ hg ci --amend --close-branch
-  saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-49c0c55d-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-b900d9fa-amend.hg (glob)
   $ hg branches
-  default                        2:ce12b0b57d46
+  default                        2:9c07515f2650
 
 Refuse to amend during a merge:
 
   $ hg up -q default
   $ hg merge foo
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ hg ci --amend
@@ -416,48 +415,48 @@ Refuse to amend during a merge:
   $ hg ci -m 'merge'
 
 Follow copies/renames:
 
   $ hg mv b c
   $ hg ci -m 'b -> c'
   $ hg mv c d
   $ hg ci --amend -m 'b -> d'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-adaaa8b1-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg (glob)
   $ hg st --rev '.^' --copies d
   A d
     b
   $ hg cp d e
   $ hg ci -m 'e = d'
   $ hg cp e f
   $ hg ci --amend -m 'f = d'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-d37aa788-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/9198f73182d5-251d584a-amend.hg (glob)
   $ hg st --rev '.^' --copies f
   A f
     d
 
   $ mv f f.orig
   $ hg rm -A f
   $ hg ci -m removef
   $ hg cp a f
   $ mv f.orig f
   $ hg ci --amend -m replacef
-  saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-90259f67-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg (glob)
   $ hg st --change . --copies
   $ hg log -r . --template "{file_copies}\n"
   
 
 Move added file (issue3410):
 
   $ echo g >> g
   $ hg ci -Am g
   adding g
   $ hg mv g h
   $ hg ci --amend
-  saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-7059e0f1-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg (glob)
   $ hg st --change . --copies h
   A h
   $ hg log -r . --template "{file_copies}\n"
   
 
 Can't rollback an amend:
 
   $ hg rollback
@@ -467,40 +466,40 @@ Can't rollback an amend:
 Preserve extra dict (issue3430):
 
   $ hg branch a
   marked working directory as branch a
   (branches are permanent and global, did you want a bookmark?)
   $ echo a >> a
   $ hg ci -ma
   $ hg ci --amend -m "a'"
-  saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-2be01fd1-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg (glob)
   $ hg log -r . --template "{branch}\n"
   a
   $ hg ci --amend -m "a''"
-  saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-ed28c4cd-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg (glob)
   $ hg log -r . --template "{branch}\n"
   a
 
 Also preserve other entries in the dict that are in the old commit,
 first graft something so there's an additional entry:
 
   $ hg up 0 -q
   $ echo z > z
   $ hg ci -Am 'fork'
   adding z
   created new head
   $ hg up 11
   5 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg graft 12
   grafting 12:2647734878ef "fork" (tip)
   $ hg ci --amend -m 'graft amend'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-eedb103b-amend.hg (glob)
+  saved backup bundle to $TESTTMP/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg (glob)
   $ hg log -r . --debug | grep extra
-  extra:       amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e
+  extra:       amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60
   extra:       branch=a
   extra:       source=2647734878ef0236dda712fae9c1651cf694ea8a
 
 Preserve phase
 
   $ hg phase '.^::.'
   11: draft
   13: draft
@@ -526,93 +525,93 @@ Enable obsolete
 Amend with no files changes
 
   $ hg id -n
   13
   $ hg ci --amend -m 'babar'
   $ hg id -n
   14
   $ hg log -Gl 3 --style=compact
-  @  14[tip]:11   b650e6ee8614   1970-01-01 00:00 +0000   test
+  @  14[tip]:11   682950e85999   1970-01-01 00:00 +0000   test
   |    babar
   |
   | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
   | |    fork
   | ~
-  o  11   3334b7925910   1970-01-01 00:00 +0000   test
+  o  11   0ddb275cfad1   1970-01-01 00:00 +0000   test
   |    a''
   ~
   $ hg log -Gl 4 --hidden --style=compact
-  @  14[tip]:11   b650e6ee8614   1970-01-01 00:00 +0000   test
+  @  14[tip]:11   682950e85999   1970-01-01 00:00 +0000   test
   |    babar
   |
-  | x  13:11   68ff8ff97044   1970-01-01 00:00 +0000   test
+  | x  13:11   5167600b0f7a   1970-01-01 00:00 +0000   test
   |/     amend for phase
   |
   | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
   | |    fork
   | ~
-  o  11   3334b7925910   1970-01-01 00:00 +0000   test
+  o  11   0ddb275cfad1   1970-01-01 00:00 +0000   test
   |    a''
   ~
 
 Amend with files changes
 
 (note: the extra commit over 15 is a temporary junk I would be happy to get
 ride of)
 
   $ echo 'babar' >> a
   $ hg commit --amend
   $ hg log -Gl 6 --hidden --style=compact
-  @  16[tip]:11   9f9e9bccf56c   1970-01-01 00:00 +0000   test
+  @  15[tip]:11   a5b42b49b0d5   1970-01-01 00:00 +0000   test
   |    babar
   |
-  | x  15   90fef497c56f   1970-01-01 00:00 +0000   test
-  | |    temporary amend commit for b650e6ee8614
-  | |
-  | x  14:11   b650e6ee8614   1970-01-01 00:00 +0000   test
+  | x  14:11   682950e85999   1970-01-01 00:00 +0000   test
   |/     babar
   |
-  | x  13:11   68ff8ff97044   1970-01-01 00:00 +0000   test
+  | x  13:11   5167600b0f7a   1970-01-01 00:00 +0000   test
   |/     amend for phase
   |
   | o  12:0   2647734878ef   1970-01-01 00:00 +0000   test
   | |    fork
   | ~
-  o  11   3334b7925910   1970-01-01 00:00 +0000   test
+  o  11   0ddb275cfad1   1970-01-01 00:00 +0000   test
   |    a''
+  |
+  o  10   5fa75032e226   1970-01-01 00:00 +0000   test
+  |    g
   ~
 
 
 Test that amend does not make it easy to create obsolescence cycle
 ---------------------------------------------------------------------
 
   $ hg id -r 14 --hidden
-  b650e6ee8614 (a)
+  682950e85999 (a)
   $ hg revert -ar 14 --hidden
   reverting a
   $ hg commit --amend
   $ hg id
-  b99e5df575f7 (a) tip
+  37973c7e0b61 (a) tip
 
 Test that rewriting leaving instability behind is allowed
 ---------------------------------------------------------------------
 
   $ hg up '.^'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo 'b' >> a
   $ hg log --style compact -r 'children(.)'
-  18[tip]:11   b99e5df575f7   1970-01-01 00:00 +0000   test
+  16[tip]:11   37973c7e0b61   1970-01-01 00:00 +0000   test
     babar
   
   $ hg commit --amend
   $ hg log -r 'orphan()'
-  changeset:   18:b99e5df575f7
+  changeset:   16:37973c7e0b61
   branch:      a
-  parent:      11:3334b7925910
+  parent:      11:0ddb275cfad1
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   instability: orphan
   summary:     babar
   
 
 Amend a merge changeset (with renames and conflicts from the second parent):
 
@@ -630,20 +629,20 @@ Amend a merge changeset (with renames an
   $ hg ci -m aa
   $ hg merge -q bar
   warning: conflicts while merging cc! (edit, then use 'hg resolve --mark')
   [1]
   $ hg resolve -m cc
   (no more unresolved files)
   $ hg ci -m 'merge bar'
   $ hg log --config diff.git=1 -pr .
-  changeset:   23:163cfd7219f7
+  changeset:   20:163cfd7219f7
   tag:         tip
-  parent:      22:30d96aeaf27b
-  parent:      21:1aa437659d19
+  parent:      19:30d96aeaf27b
+  parent:      18:1aa437659d19
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     merge bar
   
   diff --git a/a b/aa
   copy from a
   copy to aa
   diff --git a/cc b/cc
@@ -663,20 +662,20 @@ Amend a merge changeset (with renames an
   aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
   $ hg debugrename zz
   zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
   $ hg debugrename cc
   cc not renamed
   $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
   HGEDITFORM=commit.amend.merge
   $ hg log --config diff.git=1 -pr .
-  changeset:   24:bca52d4ed186
+  changeset:   21:bca52d4ed186
   tag:         tip
-  parent:      22:30d96aeaf27b
-  parent:      21:1aa437659d19
+  parent:      19:30d96aeaf27b
+  parent:      18:1aa437659d19
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     merge bar (amend message)
   
   diff --git a/a b/aa
   copy from a
   copy to aa
   diff --git a/cc b/cc
@@ -696,20 +695,20 @@ Amend a merge changeset (with renames an
   aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
   $ hg debugrename zz
   zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
   $ hg debugrename cc
   cc not renamed
   $ hg mv zz z
   $ hg ci --amend -m 'merge bar (undo rename)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   26:12594a98ca3f
+  changeset:   22:12594a98ca3f
   tag:         tip
-  parent:      22:30d96aeaf27b
-  parent:      21:1aa437659d19
+  parent:      19:30d96aeaf27b
+  parent:      18:1aa437659d19
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     merge bar (undo rename)
   
   diff --git a/a b/aa
   copy from a
   copy to aa
   diff --git a/cc b/cc
@@ -732,20 +731,20 @@ Amend a merge changeset (with renames du
   $ hg add x
   $ hg ci -m x
   $ hg up -q default
   $ hg merge -q bar
   $ hg mv aa aaa
   $ echo aa >> aaa
   $ hg ci -m 'merge bar again'
   $ hg log --config diff.git=1 -pr .
-  changeset:   28:dffde028b388
+  changeset:   24:dffde028b388
   tag:         tip
-  parent:      26:12594a98ca3f
-  parent:      27:4c94d5bc65f5
+  parent:      22:12594a98ca3f
+  parent:      23:4c94d5bc65f5
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     merge bar again
   
   diff --git a/aa b/aa
   deleted file mode 100644
   --- a/aa
   +++ /dev/null
@@ -767,20 +766,20 @@ Amend a merge changeset (with renames du
   @@ -0,0 +1,1 @@
   +x
   
   $ hg debugrename aaa
   aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
   $ hg mv aaa aa
   $ hg ci --amend -m 'merge bar again (undo rename)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   30:18e3ba160489
+  changeset:   25:18e3ba160489
   tag:         tip
-  parent:      26:12594a98ca3f
-  parent:      27:4c94d5bc65f5
+  parent:      22:12594a98ca3f
+  parent:      23:4c94d5bc65f5
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     merge bar again (undo rename)
   
   diff --git a/aa b/aa
   --- a/aa
   +++ b/aa
   @@ -1,2 +1,3 @@
@@ -809,32 +808,32 @@ Amend a merge changeset (with manifest-l
   $ hg ci -m aa
   $ hg merge -q bar --config ui.interactive=True << EOF
   > c
   > EOF
   local [working copy] changed aa which other [merge rev] deleted
   use (c)hanged version, (d)elete, or leave (u)nresolved? c
   $ hg ci -m 'merge bar (with conflicts)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   33:b4c3035e2544
+  changeset:   28:b4c3035e2544
   tag:         tip
-  parent:      32:4b216ca5ba97
-  parent:      31:67db8847a540
+  parent:      27:4b216ca5ba97
+  parent:      26:67db8847a540
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     merge bar (with conflicts)
   
   
   $ hg rm aa
   $ hg ci --amend -m 'merge bar (with conflicts, amended)'
   $ hg log --config diff.git=1 -pr .
-  changeset:   35:1205ed810051
+  changeset:   29:1205ed810051
   tag:         tip
-  parent:      32:4b216ca5ba97
-  parent:      31:67db8847a540
+  parent:      27:4b216ca5ba97
+  parent:      26:67db8847a540
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     merge bar (with conflicts, amended)
   
   diff --git a/aa b/aa
   deleted file mode 100644
   --- a/aa
   +++ /dev/null
@@ -865,22 +864,22 @@ This silliness fails:
   $ hg ci --close-branch -m'open and close'
   abort: can only close branch heads
   [255]
 
 Test that amend with --secret creates new secret changeset forcibly
 ---------------------------------------------------------------------
 
   $ hg phase '.^::.'
-  35: draft
-  36: draft
+  29: draft
+  30: draft
   $ hg commit --amend --secret -m 'amend as secret' -q
   $ hg phase '.^::.'
-  35: draft
-  38: secret
+  29: draft
+  31: secret
 
 Test that amend with --edit invokes editor forcibly
 ---------------------------------------------------
 
   $ hg parents --template "{desc}\n"
   amend as secret
   $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
   $ hg parents --template "{desc}\n"
@@ -1060,30 +1059,30 @@ in the file revlog topology and the chan
   $ hg log -G --template '{rev} {desc}'
   @  2 a1-amend
   |
   | o  1 a1
   |/
   o  0 a0
   
 
-The way mercurial does amends is to create a temporary commit (rev 3) and then
-fold the new and old commits together into another commit (rev 4). During this
-process, _findlimit is called to check how far back to look for the transitive
-closure of file copy information, but due to the divergence of the filelog
-and changelog graph topologies, before _findlimit was fixed, it returned a rev
-which was not far enough back in this case.
+The way mercurial does amends is by folding the working copy and old commit
+together into another commit (rev 3). During this process, _findlimit is called
+to  check how far back to look for the transitive closure of file copy
+information, but due to the divergence of the filelog and changelog graph
+topologies, before _findlimit was fixed, it returned a rev which was not far
+enough back in this case.
   $ hg mv a1 a2
   $ hg status --copies --rev 0
   A a2
     a0
   R a0
   $ hg ci --amend -q
   $ hg log -G --template '{rev} {desc}'
-  @  4 a1-amend
+  @  3 a1-amend
   |
   | o  1 a1
   |/
   o  0 a0
   
 
 Before the fix, the copy information was lost.
   $ hg status --copies --rev 0
@@ -1156,20 +1155,20 @@ directory)
 #if execbit
 
 Test if amend preserves executable bit changes
   $ chmod +x newdirname/commonfile.py
   $ hg ci -m chmod
   $ hg ci --amend -m "chmod amended"
   $ hg ci --amend -m "chmod amended second time"
   $ hg log -p --git -r .
-  changeset:   8:b1326f52dddf
+  changeset:   7:b1326f52dddf
   branch:      newdirname
   tag:         tip
-  parent:      5:7fd235f7cb2f
+  parent:      4:7fd235f7cb2f
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     chmod amended second time
   
   diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py
   old mode 100644
   new mode 100755
   
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -201,17 +201,17 @@ Amend option works
   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
   +hello
   $ cat <<EOF >testModeCommands
   > a
   > X
   > EOF
   $ hg commit -i  -m "newly added file" -d "0 0"
-  saved backup bundle to $TESTTMP/a/.hg/strip-backup/2b0e9be4d336-28bbe4e2-amend.hg (glob)
+  saved backup bundle to $TESTTMP/a/.hg/strip-backup/2b0e9be4d336-3cf0bc8c-amend.hg (glob)
   $ hg diff -c .
   diff -r a6735021574d -r c1d239d165ae x
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
   +hello world
 
 Editing a hunk puts you back on that hunk when done editing (issue5041)
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -38,55 +38,53 @@ Test that histedit learns about obsolesc
   [1]
   $ hg st
   A b
   A c
   ? plan
   $ hg commit --amend b
   $ hg histedit --continue
   $ hg log -G
-  @  6:46abc7c4d873 b
+  @  5:46abc7c4d873 b
   |
-  o  5:49d44ab2be1b c
+  o  4:49d44ab2be1b c
   |
   o  0:cb9a9f314b8b a
   
   $ hg debugobsolete
   e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
-  3e30a45cf2f719e96ab3922dfe039cfd047956ce 0 {e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf} (*) {'user': 'test'} (glob)
   1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (*) {'user': 'test'} (glob)
   114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
 
 With some node gone missing during the edit.
 
   $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan
-  $ echo "pick `hg log -r 6 -T '{node|short}'`" >> plan
-  $ echo "edit `hg log -r 5 -T '{node|short}'`" >> plan
+  $ echo "pick `hg log -r 5 -T '{node|short}'`" >> plan
+  $ echo "edit `hg log -r 4 -T '{node|short}'`" >> plan
   $ hg histedit -r 'all()' --commands plan
   Editing (49d44ab2be1b), you may commit or record as needed now.
   (hg histedit --continue to resume)
   [1]
   $ hg st
   A b
   A d
   ? plan
   $ hg commit --amend -X . -m XXXXXX
   $ hg commit --amend -X . -m b2
   $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup
   $ hg histedit --continue
   $ hg log -G
-  @  9:273c1f3b8626 c
+  @  8:273c1f3b8626 c
   |
-  o  8:aba7da937030 b2
+  o  7:aba7da937030 b2
   |
   o  0:cb9a9f314b8b a
   
   $ hg debugobsolete
   e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
-  3e30a45cf2f719e96ab3922dfe039cfd047956ce 0 {e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf} (*) {'user': 'test'} (glob)
   1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (*) {'user': 'test'} (glob)
   114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (*) {'user': 'test'} (glob)
   76f72745eac0643d16530e56e2f86e36e40631f1 2ca853e48edbd6453a0674dc0fe28a0974c51b9c 0 (*) {'user': 'test'} (glob)
   2ca853e48edbd6453a0674dc0fe28a0974c51b9c aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (*) {'user': 'test'} (glob)
   49d44ab2be1b67a79127568a67c9c99430633b48 273c1f3b86267ed3ec684bb13af1fa4d6ba56e02 0 (*) {'user': 'test'} (glob)
   46abc7c4d8738e8563e577f7889e1b6db3da4199 aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (*) {'user': 'test'} (glob)
   $ cd ..
 
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -2295,43 +2295,43 @@ Even when the file revision is missing f
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo c > c
   $ hg ci -Am2
   adding c
   created new head
   $ hg up 'head() and not .'
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg log -G
-  o  changeset:   4:db815d6d32e6
+  o  changeset:   3:db815d6d32e6
   |  tag:         tip
   |  parent:      0:f7b1eb17ad24
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     2
   |
-  | @  changeset:   3:9bc8ce7f9356
+  | @  changeset:   2:9bc8ce7f9356
   |/   parent:      0:f7b1eb17ad24
   |    user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
   |    summary:     1
   |
   o  changeset:   0:f7b1eb17ad24
      user:        test
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     0
   
   $ hg log -f -G b
-  @  changeset:   3:9bc8ce7f9356
+  @  changeset:   2:9bc8ce7f9356
   |  parent:      0:f7b1eb17ad24
   ~  user:        test
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     1
   
   $ hg log -G b
-  @  changeset:   3:9bc8ce7f9356
+  @  changeset:   2:9bc8ce7f9356
   |  parent:      0:f7b1eb17ad24
   ~  user:        test
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     1
   
   $ cd ..
 
 Check proper report when the manifest changes but not the file issue4499
--- a/tests/test-obsmarker-template.t
+++ b/tests/test-obsmarker-template.t
@@ -40,34 +40,29 @@ Test setup
   $ cd $TESTTMP/templates-local-amend
   $ mkcommit ROOT
   $ mkcommit A0
   $ echo 42 >> A0
   $ HGUSER=test1 hg commit --amend -m "A1" --config devel.default-date="1234567890 0"
   $ HGUSER=test2 hg commit --amend -m "A2" --config devel.default-date="987654321 0"
 
   $ hg log --hidden -G
-  @  changeset:   4:d004c8f274b9
+  @  changeset:   3:d004c8f274b9
   |  tag:         tip
   |  parent:      0:ea207398892e
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     A2
   |
-  | x  changeset:   3:a468dc9b3633
+  | x  changeset:   2:a468dc9b3633
   |/   parent:      0:ea207398892e
   |    user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
   |    summary:     A1
   |
-  | x  changeset:   2:f137d23bb3e1
-  | |  user:        test
-  | |  date:        Thu Jan 01 00:00:00 1970 +0000
-  | |  summary:     temporary amend commit for 471f378eab4c
-  | |
   | x  changeset:   1:471f378eab4c
   |/   user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
   |    summary:     A0
   |
   o  changeset:   0:ea207398892e
      user:        test
      date:        Thu Jan 01 00:00:00 1970 +0000
@@ -81,156 +76,146 @@ Check templates
 Predecessors template should show current revision as it is the working copy
   $ hg tlog
   o  d004c8f274b9
   |    Predecessors: 1:471f378eab4c
   |    semi-colon: 1:471f378eab4c
   |    json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
   |    map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
   | @  471f378eab4c
-  |/     Successors: 4:d004c8f274b9
-  |      multi-line: 4:d004c8f274b9
+  |/     Successors: 3:d004c8f274b9
+  |      multi-line: 3:d004c8f274b9
   |      json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
   o  ea207398892e
   
   $ hg fatelog -q --traceback
   o  d004c8f274b9
   |
   | @  471f378eab4c
-  |/     Obsfate: rewritten as 4:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000);
+  |/     Obsfate: rewritten as 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000);
   o  ea207398892e
   
   $ hg fatelog
   o  d004c8f274b9
   |
   | @  471f378eab4c
-  |/     Obsfate: rewritten as 4:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000);
+  |/     Obsfate: rewritten as 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000);
   o  ea207398892e
   
   $ hg fatelog -v
   o  d004c8f274b9
   |
   | @  471f378eab4c
-  |/     Obsfate: rewritten as 4:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000);
+  |/     Obsfate: rewritten as 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000);
   o  ea207398892e
   
   $ hg up 'desc(A1)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Predecessors template should show current revision as it is the working copy
   $ hg tlog
   o  d004c8f274b9
-  |    Predecessors: 3:a468dc9b3633
-  |    semi-colon: 3:a468dc9b3633
+  |    Predecessors: 2:a468dc9b3633
+  |    semi-colon: 2:a468dc9b3633
   |    json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
-  |    map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
+  |    map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad
   | @  a468dc9b3633
-  |/     Successors: 4:d004c8f274b9
-  |      multi-line: 4:d004c8f274b9
+  |/     Successors: 3:d004c8f274b9
+  |      multi-line: 3:d004c8f274b9
   |      json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
   o  ea207398892e
   
   $ hg fatelog -v
   o  d004c8f274b9
   |
   | @  a468dc9b3633
-  |/     Obsfate: rewritten as 4:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
+  |/     Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
   o  ea207398892e
   
 Predecessors template should show all the predecessors as we force their display
 with --hidden
   $ hg tlog --hidden
   o  d004c8f274b9
-  |    Predecessors: 3:a468dc9b3633
-  |    semi-colon: 3:a468dc9b3633
+  |    Predecessors: 2:a468dc9b3633
+  |    semi-colon: 2:a468dc9b3633
   |    json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
-  |    map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
+  |    map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad
   | @  a468dc9b3633
   |/     Predecessors: 1:471f378eab4c
   |      semi-colon: 1:471f378eab4c
   |      json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
   |      map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
-  |      Successors: 4:d004c8f274b9
-  |      multi-line: 4:d004c8f274b9
+  |      Successors: 3:d004c8f274b9
+  |      multi-line: 3:d004c8f274b9
   |      json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
-  | x  f137d23bb3e1
-  | |
   | x  471f378eab4c
-  |/     Successors: 3:a468dc9b3633
-  |      multi-line: 3:a468dc9b3633
+  |/     Successors: 2:a468dc9b3633
+  |      multi-line: 2:a468dc9b3633
   |      json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]]
   o  ea207398892e
   
   $ hg fatelog --hidden -q
   o  d004c8f274b9
   |
   | @  a468dc9b3633
-  |/     Obsfate: rewritten as 4:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
-  | x  f137d23bb3e1
-  | |    Obsfate: pruned by test1 (at 2009-02-13 23:31 +0000);
+  |/     Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
   | x  471f378eab4c
-  |/     Obsfate: rewritten as 3:a468dc9b3633 by test1 (at 2009-02-13 23:31 +0000);
+  |/     Obsfate: rewritten as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +0000);
   o  ea207398892e
   
 
 Predecessors template shouldn't show anything as all obsolete commit are not
 visible.
   $ hg up 'desc(A2)'
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg tlog
   @  d004c8f274b9
   |
   o  ea207398892e
   
   $ hg tlog --hidden
   @  d004c8f274b9
-  |    Predecessors: 3:a468dc9b3633
-  |    semi-colon: 3:a468dc9b3633
+  |    Predecessors: 2:a468dc9b3633
+  |    semi-colon: 2:a468dc9b3633
   |    json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
-  |    map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
+  |    map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad
   | x  a468dc9b3633
   |/     Predecessors: 1:471f378eab4c
   |      semi-colon: 1:471f378eab4c
   |      json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
   |      map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
-  |      Successors: 4:d004c8f274b9
-  |      multi-line: 4:d004c8f274b9
+  |      Successors: 3:d004c8f274b9
+  |      multi-line: 3:d004c8f274b9
   |      json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]]
-  | x  f137d23bb3e1
-  | |
   | x  471f378eab4c
-  |/     Successors: 3:a468dc9b3633
-  |      multi-line: 3:a468dc9b3633
+  |/     Successors: 2:a468dc9b3633
+  |      multi-line: 2:a468dc9b3633
   |      json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]]
   o  ea207398892e
   
   $ hg fatelog -v
   @  d004c8f274b9
   |
   o  ea207398892e
   
 
   $ hg fatelog -v --hidden
   @  d004c8f274b9
   |
   | x  a468dc9b3633
-  |/     Obsfate: rewritten as 4:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
-  | x  f137d23bb3e1
-  | |    Obsfate: pruned by test1 (at 2009-02-13 23:31 +0000);
+  |/     Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000);
   | x  471f378eab4c
-  |/     Obsfate: rewritten as 3:a468dc9b3633 by test1 (at 2009-02-13 23:31 +0000);
+  |/     Obsfate: rewritten as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +0000);
   o  ea207398892e
   
   $ hg fatelogjson --hidden
   @  d004c8f274b9
   |
   | x  a468dc9b3633
   |/     Obsfate: [{"markers": [["a468dc9b36338b14fdb7825f55ce3df4e71517ad", ["d004c8f274b9ec480a47a93c10dac5eee63adb78"], 0, [["user", "test2"]], [987654321.0, 0], null]], "successors": ["d004c8f274b9ec480a47a93c10dac5eee63adb78"]}]
-  | x  f137d23bb3e1
-  | |    Obsfate: [{"markers": [["f137d23bb3e11dc1daeb6264fac9cb2433782e15", [], 0, [["user", "test1"]], [1234567890.0, 0], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]], "successors": []}]
   | x  471f378eab4c
   |/     Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"], 0, [["user", "test1"]], [1234567890.0, 0], null]], "successors": ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]}]
   o  ea207398892e
   
 Test templates with splitted commit
 ===================================
 
   $ hg init $TESTTMP/templates-local-split
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -1024,28 +1024,28 @@ This test issue 3805
   $ hg ci --amend
   $ cd ../other-issue3805
   $ hg log -G
   @  1:29f0c6921ddd (draft) [tip ] A
   |
   o  0:d20a80d4def3 (draft) [ ] base
   
   $ hg log -G -R ../repo-issue3805
-  @  3:323a9c3ddd91 (draft) [tip ] A
+  @  2:323a9c3ddd91 (draft) [tip ] A
   |
   o  0:d20a80d4def3 (draft) [ ] base
   
   $ hg incoming
   comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
   searching for changes
-  3:323a9c3ddd91 (draft) [tip ] A
+  2:323a9c3ddd91 (draft) [tip ] A
   $ hg incoming --bundle ../issue3805.hg
   comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
   searching for changes
-  3:323a9c3ddd91 (draft) [tip ] A
+  2:323a9c3ddd91 (draft) [tip ] A
   $ hg outgoing
   comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
   searching for changes
   1:29f0c6921ddd (draft) [tip ] A
 
 #if serve
 
   $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
@@ -1073,39 +1073,39 @@ This test issue 3814
   $ cd repo-issue3805
   $ hg push -r 323a9c3ddd91 ../repo-issue3814
   pushing to ../repo-issue3814
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 2 changesets with 2 changes to 2 files
-  2 new obsolescence markers
+  1 new obsolescence markers
   $ hg out ../repo-issue3814
   comparing with ../repo-issue3814
   searching for changes
   no changes found
   [1]
 
 Test that a local tag blocks a changeset from being hidden
 
   $ hg tag -l visible -r 1 --hidden
   $ hg log -G
-  @  3:323a9c3ddd91 (draft) [tip ] A
+  @  2:323a9c3ddd91 (draft) [tip ] A
   |
   | x  1:29f0c6921ddd (draft *obsolete*) [visible ] A
   |/
   o  0:d20a80d4def3 (draft) [ ] base
   
 Test that removing a local tag does not cause some commands to fail
 
   $ hg tag -l -r tip tiptag
   $ hg tags
-  tiptag                             3:323a9c3ddd91
-  tip                                3:323a9c3ddd91
+  tiptag                             2:323a9c3ddd91
+  tip                                2:323a9c3ddd91
   visible                            1:29f0c6921ddd
   $ hg --config extensions.strip= strip -r tip --no-backup
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg tags
   visible                            1:29f0c6921ddd
   tip                                1:29f0c6921ddd
 
 Test bundle overlay onto hidden revision
@@ -1137,34 +1137,32 @@ Test bundle overlay onto hidden revision
   adding file changes
   added 2 changesets with 2 changes to 1 files
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ../other-bundleoverlay
   $ echo "B+" >> foo
   $ hg ci --amend -m "B+"
   $ hg log -G --hidden
-  @  3:b7d587542d40 (draft) [tip ] B+
+  @  2:b7d587542d40 (draft) [tip ] B+
   |
-  | x  2:eb95e9297e18 (draft *obsolete*) [ ] temporary amend commit for 44526ebb0f98
-  | |
   | x  1:44526ebb0f98 (draft *obsolete*) [ ] B
   |/
   o  0:4b34ecfb0d56 (draft) [ ] A
   
 
   $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
   comparing with ../repo-bundleoverlay
   searching for changes
   1:44526ebb0f98 (draft) [ ] B
   2:c186d7714947 (draft) [tip ] C
   $ hg log -G -R ../bundleoverlay.hg
-  o  4:c186d7714947 (draft) [tip ] C
+  o  3:c186d7714947 (draft) [tip ] C
   |
-  | @  3:b7d587542d40 (draft) [ ] B+
+  | @  2:b7d587542d40 (draft) [ ] B+
   |/
   o  0:4b34ecfb0d56 (draft) [ ] A
   
 
 #if serve
 
 Test issue 4506
 
@@ -1229,17 +1227,17 @@ Test heads computation on pending index 
   $ hg init repo-issue-nativerevs-pending-changes
   $ cd repo-issue-nativerevs-pending-changes
   $ mkcommit a
   $ mkcommit b
   $ hg up ".^"
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo aa > a
   $ hg amendtransient
-  [1, 3]
+  [1, 2]
 
 Test cache consistency for the visible filter
 1) We want to make sure that the cached filtered revs are invalidated when
 bookmarks change
   $ cd ..
   $ cat >$TESTTMP/test_extension.py  << EOF
   > from __future__ import absolute_import, print_function
   > import weakref
@@ -1270,17 +1268,17 @@ bookmarks change
   a already tracked!
   $ mkcommit b
   $ hg id
   13bedc178fce tip
   $ echo "hello" > b
   $ hg commit --amend -m "message"
   $ hg book bookb -r 13bedc178fce --hidden
   $ hg log -r 13bedc178fce
-  5:13bedc178fce (draft *obsolete*) [ bookb] add b
+  4:13bedc178fce (draft *obsolete*) [ bookb] add b
   $ hg book -d bookb
   $ hg log -r 13bedc178fce
   abort: hidden revision '13bedc178fce'!
   (use --hidden to access hidden revisions)
   [255]
 
 Empty out the test extension, as it isn't compatible with later parts
 of the test.
@@ -1301,71 +1299,63 @@ Test ability to pull changeset with loca
   $ hg ci -m '1'
   $ echo foo > f2
   $ hg add f2
   $ hg ci -m '2'
 
   $ echo bar > f2
   $ hg commit --amend --config experimetnal.stabilization=createmarkers
   $ hg log -G
-  @  4:b0551702f918 (draft) [tip ] 2
+  @  3:b0551702f918 (draft) [tip ] 2
   |
   o  1:e016b03fd86f (draft) [ ] 1
   |
   o  0:a78f55e5508c (draft) [ ] 0
   
   $ hg log -G --hidden
-  @  4:b0551702f918 (draft) [tip ] 2
+  @  3:b0551702f918 (draft) [tip ] 2
   |
-  | x  3:f27abbcc1f77 (draft *obsolete*) [ ] temporary amend commit for e008cf283490
-  | |
   | x  2:e008cf283490 (draft *obsolete*) [ ] 2
   |/
   o  1:e016b03fd86f (draft) [ ] 1
   |
   o  0:a78f55e5508c (draft) [ ] 0
   
 
   $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no
-  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-39c978dc-backup.hg (glob)
+  saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-ede36964-backup.hg (glob)
   $ hg debugobsolete
   e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
-  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
   $ hg log -G
   @  2:b0551702f918 (draft) [tip ] 2
   |
   o  1:e016b03fd86f (draft) [ ] 1
   |
   o  0:a78f55e5508c (draft) [ ] 0
   
   $ hg log -G --hidden
   @  2:b0551702f918 (draft) [tip ] 2
   |
   o  1:e016b03fd86f (draft) [ ] 1
   |
   o  0:a78f55e5508c (draft) [ ] 0
   
   $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg
   Stream params: {Compression: BZ}
-  changegroup -- {nbchanges: 2, version: 02}
+  changegroup -- {nbchanges: 1, version: 02}
       e008cf2834908e5d6b0f792a9d4b0e2272260fb8
-      f27abbcc1f77fb409cf9160482fe619541e2d605
-  obsmarkers -- {}
-      version: 1 (70 bytes)
-      f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   phase-heads -- {}
-      f27abbcc1f77fb409cf9160482fe619541e2d605 draft
+      e008cf2834908e5d6b0f792a9d4b0e2272260fb8 draft
 
   $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg
-  pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg
+  pulling from .hg/strip-backup/e008cf283490-ede36964-backup.hg
   searching for changes
   no changes found
   $ hg debugobsolete
   e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
-  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
   $ hg log -G
   @  2:b0551702f918 (draft) [tip ] 2
   |
   o  1:e016b03fd86f (draft) [ ] 1
   |
   o  0:a78f55e5508c (draft) [ ] 0
   
   $ hg log -G --hidden
@@ -1389,32 +1379,30 @@ Testing that strip remove markers:
   @  0:a78f55e5508c (draft) [tip ] 0
   
   $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
   Stream params: {Compression: BZ}
   changegroup -- {nbchanges: 2, version: 02}
       e016b03fd86fcccc54817d120b90b751aaf367d6
       b0551702f918510f01ae838ab03a463054c67b46
   obsmarkers -- {}
-      version: 1 (139 bytes)
+      version: 1 (70 bytes)
       e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
-      f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
   phase-heads -- {}
       b0551702f918510f01ae838ab03a463054c67b46 draft
 
   $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
   adding changesets
   adding manifests
   adding file changes
   added 2 changesets with 2 changes to 2 files
-  2 new obsolescence markers
+  1 new obsolescence markers
   (run 'hg update' to get a working copy)
   $ hg debugobsolete | sort
   e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob)
-  f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob)
   $ hg log -G
   o  2:b0551702f918 (draft) [tip ] 2
   |
   o  1:e016b03fd86f (draft) [ ] 1
   |
   @  0:a78f55e5508c (draft) [ ] 0
   
   $ hg log -G --hidden
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -621,21 +621,21 @@ Test hidden changesets in the rebase set
   $ hg add L
   $ hg commit -m "L"
   $ hg up '.^'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo "M" > M
   $ hg add M
   $ hg commit --amend -m "M"
   $ hg log -G
-  @  20:bfaedf8eb73b M
+  @  18:bfaedf8eb73b M
   |
-  | o  18:97219452e4bd L
+  | o  17:97219452e4bd L
   | |
-  | x  17:fc37a630c901 K
+  | x  16:fc37a630c901 K
   |/
   | o  15:5ae8a643467b J
   | |
   | x  14:9ad579b4a5de I
   |/
   | o  12:acd174b7ab39 I
   | |
   | o  11:6c11a6218c97 H
@@ -655,18 +655,18 @@ Test hidden changesets in the rebase set
   x |  3:32af7686d403 D
   | |
   o |  2:5fddd98957c8 C
   | |
   o |  1:42ccdea3bb16 B
   |/
   o  0:cd010b8cd998 A
   
-  $ hg rebase -s 14 -d 18 --config experimental.rebaseskipobsolete=True
-  note: not rebasing 14:9ad579b4a5de "I", already in destination as 17:fc37a630c901 "K"
+  $ hg rebase -s 14 -d 17 --config experimental.rebaseskipobsolete=True
+  note: not rebasing 14:9ad579b4a5de "I", already in destination as 16:fc37a630c901 "K"
   rebasing 15:5ae8a643467b "J"
 
   $ cd ..
 
 Skip obsolete changeset even with multiple hops
 -----------------------------------------------
 
 setup
@@ -792,48 +792,48 @@ If a rebase is going to create divergenc
   $ hg add bar
   $ hg commit --amend -m "10'"
   $ hg up 10 --hidden
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ echo "bar" > foo
   $ hg add foo
   $ hg commit -m "bar foo"
   $ hg log -G
-  @  15:73568ab6879d bar foo
+  @  14:73568ab6879d bar foo
   |
-  | o  14:77d874d096a2 10'
+  | o  13:77d874d096a2 10'
   | |
   | | o  12:3eb461388009 john doe
   | |/
   x |  10:121d9e3bc4c6 P
   |/
   o  9:4be60e099a77 C
   |
   o  6:9c48361117de D
   |
   o  2:261e70097290 B2
   |
   o  0:4a2df7238c3b A
   
   $ hg summary
-  parent: 15:73568ab6879d tip (orphan)
+  parent: 14:73568ab6879d tip (orphan)
    bar foo
   branch: default
   commit: (clean)
   update: 2 new changesets, 3 branch heads (merge)
   phases: 8 draft
   orphan: 1 changesets
   $ hg rebase -s 10 -d 12
   abort: this rebase will cause divergences from: 121d9e3bc4c6
   (to force the rebase please set experimental.allowdivergence=True)
   [255]
   $ hg log -G
-  @  15:73568ab6879d bar foo
+  @  14:73568ab6879d bar foo
   |
-  | o  14:77d874d096a2 10'
+  | o  13:77d874d096a2 10'
   | |
   | | o  12:3eb461388009 john doe
   | |/
   x |  10:121d9e3bc4c6 P
   |/
   o  9:4be60e099a77 C
   |
   o  6:9c48361117de D
@@ -841,85 +841,85 @@ If a rebase is going to create divergenc
   o  2:261e70097290 B2
   |
   o  0:4a2df7238c3b A
   
 With experimental.allowdivergence=True, rebase can create divergence
 
   $ hg rebase -s 10 -d 12 --config experimental.allowdivergence=True
   rebasing 10:121d9e3bc4c6 "P"
-  rebasing 15:73568ab6879d "bar foo" (tip)
+  rebasing 14:73568ab6879d "bar foo" (tip)
   $ hg summary
-  parent: 17:61bd55f69bc4 tip
+  parent: 16:61bd55f69bc4 tip
    bar foo
   branch: default
   commit: (clean)
   update: 1 new changesets, 2 branch heads (merge)
   phases: 8 draft
   content-divergent: 2 changesets
 
 rebase --continue + skipped rev because their successors are in destination
 we make a change in trunk and work on conflicting changes to make rebase abort.
 
-  $ hg log -G -r 17::
-  @  17:61bd55f69bc4 bar foo
+  $ hg log -G -r 16::
+  @  16:61bd55f69bc4 bar foo
   |
   ~
 
 Create the two changes in trunk
   $ printf "a" > willconflict
   $ hg add willconflict
   $ hg commit -m "willconflict first version"
 
   $ printf "dummy" > C
   $ hg commit -m "dummy change successor"
 
 Create the changes that we will rebase
-  $ hg update -C 17 -q
+  $ hg update -C 16 -q
   $ printf "b" > willconflict
   $ hg add willconflict
   $ hg commit -m "willconflict second version"
   created new head
   $ printf "dummy" > K
   $ hg add K
   $ hg commit -m "dummy change"
   $ printf "dummy" > L
   $ hg add L
   $ hg commit -m "dummy change"
-  $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 19 -T '{node}'` --config experimental.stabilization=all
+  $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 18 -T '{node}'` --config experimental.stabilization=all
   obsoleted 1 changesets
 
-  $ hg log -G -r 17::
-  @  22:7bdc8a87673d dummy change
+  $ hg log -G -r 16::
+  @  21:7bdc8a87673d dummy change
   |
-  x  21:8b31da3c4919 dummy change
+  x  20:8b31da3c4919 dummy change
   |
-  o  20:b82fb57ea638 willconflict second version
+  o  19:b82fb57ea638 willconflict second version
   |
-  | o  19:601db7a18f51 dummy change successor
+  | o  18:601db7a18f51 dummy change successor
   | |
-  | o  18:357ddf1602d5 willconflict first version
+  | o  17:357ddf1602d5 willconflict first version
   |/
-  o  17:61bd55f69bc4 bar foo
+  o  16:61bd55f69bc4 bar foo
   |
   ~
-  $ hg rebase -r ".^^ + .^ + ." -d 19
-  rebasing 20:b82fb57ea638 "willconflict second version"
+  $ hg rebase -r ".^^ + .^ + ." -d 18
+  rebasing 19:b82fb57ea638 "willconflict second version"
   merging willconflict
   warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see hg resolve, then hg rebase --continue)
   [1]
 
   $ hg resolve --mark willconflict
   (no more unresolved files)
   continue: hg rebase --continue
   $ hg rebase --continue
-  rebasing 20:b82fb57ea638 "willconflict second version"
-  note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor"
-  rebasing 22:7bdc8a87673d "dummy change" (tip)
+  rebasing 19:b82fb57ea638 "willconflict second version"
+  note: not rebasing 20:8b31da3c4919 "dummy change", already in destination as 18:601db7a18f51 "dummy change successor"
+  rebasing 21:7bdc8a87673d "dummy change" (tip)
   $ cd ..
 
 Rebase merge where successor of one parent is equal to destination (issue5198)
 
   $ hg init p1-succ-is-dest
   $ cd p1-succ-is-dest
 
   $ hg debugdrawdag <<EOF
--- a/tests/test-treemanifest.t
+++ b/tests/test-treemanifest.t
@@ -857,13 +857,13 @@ other branch
   added 1 changesets with 1 changes to 1 files (+1 heads)
   (run 'hg heads' to see heads, 'hg merge' to merge)
 
 Committing a empty commit does not duplicate root treemanifest
   $ echo z >> z
   $ hg commit -Aqm 'pre-empty commit'
   $ hg rm z
   $ hg commit --amend -m 'empty commit'
-  saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-de37743b-amend.hg (glob)
+  saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg (glob)
   $ hg log -r 'tip + tip^' -T '{manifest}\n'
   1:678d3574b88c
   1:678d3574b88c
   $ hg --config extensions.strip= strip -r . -q