diff tests/test-topic-dest.t @ 1892:b1fadc089b82

update: change default update destination to take topic in account When within a branch update to ngtip(branch). When within a topic update to the top topic.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 13 Mar 2016 12:29:43 +0000
parents 077c40f206d1
children 27ea12c05e99
line wrap: on
line diff
--- a/tests/test-topic-dest.t	Sun Mar 13 13:07:54 2016 +0000
+++ b/tests/test-topic-dest.t	Sun Mar 13 12:29:43 2016 +0000
@@ -255,3 +255,181 @@
   |
   o  0 () c_alpha
   
+
+Default destination for update
+===============================
+
+initial setup
+
+  $ hg up elephant
+  switching to topic elephant
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo arthur >> jungle
+  $ hg ci -m arthur
+  created new head
+  $ echo pompadour >> jungle
+  $ hg ci -m pompadour
+  created new head
+  $ hg up 'roots(all())'
+  0 files updated, 0 files merged, 6 files removed, 0 files unresolved
+  $ hg log -G
+  o  15 (elephant) pompadour
+  |
+  o  14 (elephant) arthur
+  |
+  | o    13 (monkey) merge with default
+  | |\
+  o---+  12 (elephant) babar
+   / /
+  | o  11 () c_zeta
+  | |
+  o |  10 (monkey) Huc
+  | |
+  o |  8 (monkey) zephir
+  |/
+  o  6 () c_epsilon
+  |
+  o  3 () c_delta
+  |
+  o  2 () c_gamma
+  |
+  o  1 () c_beta
+  |
+  @  0 () c_alpha
+  
+
+testing default destination on a branch
+
+  $ hg up
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  o  15 (elephant) pompadour
+  |
+  o  14 (elephant) arthur
+  |
+  | o    13 (monkey) merge with default
+  | |\
+  o---+  12 (elephant) babar
+   / /
+  | @  11 () c_zeta
+  | |
+  o |  10 (monkey) Huc
+  | |
+  o |  8 (monkey) zephir
+  |/
+  o  6 () c_epsilon
+  |
+  o  3 () c_delta
+  |
+  o  2 () c_gamma
+  |
+  o  1 () c_beta
+  |
+  o  0 () c_alpha
+  
+
+extra setup for topic
+(making sure tip is not the topic)
+
+  $ hg up 'desc(c_zeta)'
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 'eta' >> 'eta'
+  $ hg add 'eta'
+  $ hg commit -m 'c_eta'
+  $ hg log -G
+  @  16 () c_eta
+  |
+  | o  15 (elephant) pompadour
+  | |
+  | o  14 (elephant) arthur
+  | |
+  +---o  13 (monkey) merge with default
+  | | |
+  | o |  12 (elephant) babar
+  |/ /
+  o |  11 () c_zeta
+  | |
+  | o  10 (monkey) Huc
+  | |
+  | o  8 (monkey) zephir
+  |/
+  o  6 () c_epsilon
+  |
+  o  3 () c_delta
+  |
+  o  2 () c_gamma
+  |
+  o  1 () c_beta
+  |
+  o  0 () c_alpha
+  
+
+Testing default destination for topic
+
+  $ hg up 'roots(topic(elephant))'
+  switching to topic elephant
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  o  16 () c_eta
+  |
+  | @  15 (elephant) pompadour
+  | |
+  | o  14 (elephant) arthur
+  | |
+  +---o  13 (monkey) merge with default
+  | | |
+  | o |  12 (elephant) babar
+  |/ /
+  o |  11 () c_zeta
+  | |
+  | o  10 (monkey) Huc
+  | |
+  | o  8 (monkey) zephir
+  |/
+  o  6 () c_epsilon
+  |
+  o  3 () c_delta
+  |
+  o  2 () c_gamma
+  |
+  o  1 () c_beta
+  |
+  o  0 () c_alpha
+  
+
+Testing default destination for topic
+
+  $ hg up 'p1(roots(topic(elephant)))'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg topic elephant
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  o  16 () c_eta
+  |
+  | @  15 (elephant) pompadour
+  | |
+  | o  14 (elephant) arthur
+  | |
+  +---o  13 (monkey) merge with default
+  | | |
+  | o |  12 (elephant) babar
+  |/ /
+  o |  11 () c_zeta
+  | |
+  | o  10 (monkey) Huc
+  | |
+  | o  8 (monkey) zephir
+  |/
+  o  6 () c_epsilon
+  |
+  o  3 () c_delta
+  |
+  o  2 () c_gamma
+  |
+  o  1 () c_beta
+  |
+  o  0 () c_alpha
+