inhibit: add test to ensure that --hidden is working with inhibit
authorLaurent Charignon <lcharignon@fb.com>
Thu, 14 May 2015 11:32:04 -0700
changeset 1343 41628bd60ee6
parent 1341 e8e3dbddc198
child 1344 376d3df9f47b
inhibit: add test to ensure that --hidden is working with inhibit There was a concern with the transaction hook in inhibit and its potentially devastating effect when used with --hidden. The transaction hook in inhibit hides all the visible & obsolete commits when the transaction ends using the visible() and the obsolete() revset. --hidden does not change the visible() revset so it is fine. If this changes in the future and --hidden actually ends up impacting the visible() revset, this test will catch it and prevent inhibit from putting inhibition markers on all of the obsolete changesets.
tests/test-inhibit.t
--- a/tests/test-inhibit.t	Tue May 19 00:47:00 2015 -0500
+++ b/tests/test-inhibit.t	Thu May 14 11:32:04 2015 -0700
@@ -549,6 +549,89 @@
   @  14:d66ccb8c5871 add cL foo
   |
 
+Check that --hidden used with inhibit does not hide every obsolete commit
+We show the log before and after a log -G --hidden, they should be the same
+  $ hg log -G
+  o  16:a438c045eb37 add cN
+  |
+  o  15:2d66e189f5b5 add cM
+  |
+  @  14:d66ccb8c5871 add cL
+  |
+  | o  9:55c73a90e4b4 add cJ
+  | |
+  o |  7:18214586bf78 add cJ
+  |/
+  o  6:cf5c4f4554ce add cH
+  |
+  o  5:5419eb264a33 add cG
+  |
+  o  4:98065434e5c6 add cE
+  |
+  o  0:54ccbc537fc2 add cA
+  
+  $ hg log -G --hidden
+  x  19:104eed5354c7 add cN
+  |
+  x  18:210589181b14 add cM
+  |
+  | x  17:b3c3274523f9 temporary amend commit for 2d66e189f5b5
+  | |
+  | | o  16:a438c045eb37 add cN
+  | |/
+  | o  15:2d66e189f5b5 add cM
+  |/
+  @  14:d66ccb8c5871 add cL
+  |
+  | x  13:2f7b7704d714 add cL
+  | |
+  | x  12:fe1634cbe235 add cK
+  | |
+  | | x  11:53a94305e133 add cL
+  | | |
+  | | x  10:ad78ff7d621f add cK
+  | | |
+  | | | o  9:55c73a90e4b4 add cJ
+  | | | |
+  +-------x  8:e84f73d9ad36 temporary amend commit for 18214586bf78
+  | | | |
+  o-----+  7:18214586bf78 add cJ
+   / / /
+  | | o  6:cf5c4f4554ce add cH
+  | | |
+  | | o  5:5419eb264a33 add cG
+  | | |
+  | | o  4:98065434e5c6 add cE
+  | |/
+  x |  3:2db36d8066ff add cD
+  | |
+  x |  2:7df62a38b9bf add cC
+  | |
+  x |  1:02bcbc3f6e56 add cB
+  |/
+  o  0:54ccbc537fc2 add cA
+  
+
+  $ hg log -G
+  o  16:a438c045eb37 add cN
+  |
+  o  15:2d66e189f5b5 add cM
+  |
+  @  14:d66ccb8c5871 add cL
+  |
+  | o  9:55c73a90e4b4 add cJ
+  | |
+  o |  7:18214586bf78 add cJ
+  |/
+  o  6:cf5c4f4554ce add cH
+  |
+  o  5:5419eb264a33 add cG
+  |
+  o  4:98065434e5c6 add cE
+  |
+  o  0:54ccbc537fc2 add cA
+  
+ 
 check that pruning and inhibited node does not confuse anything
 
   $ hg up --hidden 210589181b14