changeset 34143:b5d7e7d5c573 stable

tests: add test for issue5678 In addition to a test case for the direct problem described in the bug report, this also adds a test case showing how obsmarkers can also get lost when not using generaldelta. Differential Revision: https://phab.mercurial-scm.org/D714
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Sep 2017 11:16:47 -0700
parents 987a85c42b08
children 91f0677dc920
files tests/test-rebase-scenario-global.t tests/test-strip.t
diffstat 2 files changed, 56 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-rebase-scenario-global.t	Mon Sep 11 00:42:24 2017 +0200
+++ b/tests/test-rebase-scenario-global.t	Thu Sep 14 11:16:47 2017 -0700
@@ -375,6 +375,40 @@
 
   $ cd ..
 
+Check that temporary bundle doesn't lose phase when not using generaldelta
+
+  $ hg --config format.usegeneraldelta=no init issue5678
+  $ cd issue5678
+  $ grep generaldelta .hg/requires
+  [1]
+  $ echo a > a
+  $ hg ci -Aqm a
+  $ echo b > b
+  $ hg ci -Aqm b
+  $ hg co -q '.^'
+  $ echo c > c
+  $ hg ci -Aqm c
+  $ hg phase --public
+  $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n'
+  @  2:d36c public c
+  |
+  | o  1:d2ae draft b
+  |/
+  o  0:cb9a public a
+  
+  $ hg rebase -s 1 -d 2
+  rebasing 1:d2ae7f538514 "b"
+  saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/d2ae7f538514-2953539b-rebase.hg (glob)
+BROKEN: d36c should remain public
+  $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n'
+  o  2:c882 draft b
+  |
+  @  1:d36c draft c
+  |
+  o  0:cb9a public a
+  
+  $ cd ..
+
 Test for revset
 
 We need a bit different graph
--- a/tests/test-strip.t	Mon Sep 11 00:42:24 2017 +0200
+++ b/tests/test-strip.t	Thu Sep 14 11:16:47 2017 -0700
@@ -1097,3 +1097,25 @@
   112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
   08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
   26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
+  $ cd ..
+
+Test that obsmarkers are restored even when not using generaldelta
+
+  $ hg --config format.usegeneraldelta=no init issue5678
+  $ cd issue5678
+  $ cat >> .hg/hgrc <<EOF
+  > [experimental]
+  > evolution=all
+  > EOF
+  $ echo a > a
+  $ hg ci -Aqm a
+  $ hg ci --amend -m a2
+  $ hg debugobsolete
+  cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
+  $ hg strip .
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg (glob)
+  $ hg unbundle -q .hg/strip-backup/*
+BROKEN: obsmarker got lost
+  $ hg debugobsolete
+  $ cd ..