changeset 6102:01bc197f31d3

tests: cover a remaining case of obsolete wdir parent evolution This patch adds a test case where a cset is split over multiple topological branches.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Fri, 03 Sep 2021 23:13:13 +0530
parents 431bf23df350
children f138aea6e26b
files hgext3rd/evolve/evolvecmd.py tests/test-evolve-wdir.t
diffstat 2 files changed, 45 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Thu Jul 29 00:12:10 2021 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Sep 03 23:13:13 2021 +0530
@@ -1828,7 +1828,6 @@
             if splitsucc:
                 ctx = repo[splitsucc]
             else:
-                # XXX: yet to add test coverage for this block
                 if util.safehasattr(error, 'CanceledError'):
                     err = error.CanceledError
                 else:
--- a/tests/test-evolve-wdir.t	Thu Jul 29 00:12:10 2021 +0530
+++ b/tests/test-evolve-wdir.t	Fri Sep 03 23:13:13 2021 +0530
@@ -121,7 +121,7 @@
   o  0:9f0188af4c58 (draft): c_A
   
 
-D. Obsolete wdp with multiple successor (split rewriting)
+D. Obsolete wdp with multiple successors (split rewriting)
 ----------------------------------------------------------
 
 when split csets are on a single topological branch
@@ -189,3 +189,47 @@
   update:[9] c_XYZ
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   working directory is now at b7ec9e61ccbf
+
+when split csets are on multiple topological branches
+  $ hg rebase -r 'max(desc(c_XYZ))' -d 'desc(u_B)'
+  rebasing 9:b7ec9e61ccbf tip "c_XYZ"
+  $ hg glog
+  @  10:cadaa9246c55 (draft): c_XYZ
+  |
+  | o  8:b99a391251cc (draft): c_XYZ
+  | |
+  | o  7:1eb7dbbcecbd (draft): c_XYZ
+  | |
+  o |  5:767c654afe84 (draft): u_B
+  |/
+  o  0:9f0188af4c58 (draft): c_A
+  
+  $ hg up -r 'min(desc(c_XYZ))' --hidden
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  updated to hidden changeset c8b6cf6ce628
+  (hidden revision 'c8b6cf6ce628' was split as: 1eb7dbbcecbd, b99a391251cc and 1 more)
+  working directory parent is obsolete! (c8b6cf6ce628)
+  (use 'hg evolve' to update to its tipmost successor: 1eb7dbbcecbd, b99a391251cc and 1 more)
+
+  $ hg evolve --config ui.interactive=True << EOF
+  > q
+  > EOF
+  changeset c8b6cf6ce628 split over multiple topological branches, choose an evolve destination:
+  1: [b99a391251cc] c_XYZ
+  2: [cadaa9246c55] c_XYZ
+  q: quit the prompt
+  enter the index of the revision you want to select: q
+  abort: user quit
+  [250]
+
+  $ hg evolve --config ui.interactive=True << EOF
+  > 1
+  > EOF
+  changeset c8b6cf6ce628 split over multiple topological branches, choose an evolve destination:
+  1: [b99a391251cc] c_XYZ
+  2: [cadaa9246c55] c_XYZ
+  q: quit the prompt
+  enter the index of the revision you want to select: 1
+  update:[8] c_XYZ
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  working directory is now at b99a391251cc