tests/test-inhibit.t
branchmercurial-3.4
changeset 1607 3c7f98753e37
parent 1599 dcf145d0ce21
child 1608 e359d33856c3
equal deleted inserted replaced
1599:dcf145d0ce21 1607:3c7f98753e37
     1   $ cat >> $HGRCPATH <<EOF
       
     2   > [ui]
       
     3   > logtemplate = {rev}:{node|short} {desc}\n
       
     4   > [experimental]
       
     5   > prunestrip=True
       
     6   > evolution=createmarkers
       
     7   > [extensions]
       
     8   > rebase=
       
     9   > strip=
       
    10   > EOF
       
    11   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
       
    12   $ echo "directaccess=$(echo $(dirname $TESTDIR))/hgext/directaccess.py" >> $HGRCPATH
       
    13   $ echo "inhibit=$(echo $(dirname $TESTDIR))/hgext/inhibit.py" >> $HGRCPATH
       
    14   $ mkcommit() {
       
    15   >    echo "$1" > "$1"
       
    16   >    hg add "$1"
       
    17   >    hg ci -m "add $1"
       
    18   > }
       
    19 
       
    20   $ hg init inhibit
       
    21   $ cd inhibit
       
    22   $ mkcommit cA
       
    23   $ mkcommit cB
       
    24   $ mkcommit cC
       
    25   $ mkcommit cD
       
    26   $ hg up 'desc(cA)'
       
    27   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
    28   $ mkcommit cE
       
    29   created new head
       
    30   $ mkcommit cG
       
    31   $ mkcommit cH
       
    32   $ mkcommit cJ
       
    33   $ hg log -G
       
    34   @  7:18214586bf78 add cJ
       
    35   |
       
    36   o  6:cf5c4f4554ce add cH
       
    37   |
       
    38   o  5:5419eb264a33 add cG
       
    39   |
       
    40   o  4:98065434e5c6 add cE
       
    41   |
       
    42   | o  3:2db36d8066ff add cD
       
    43   | |
       
    44   | o  2:7df62a38b9bf add cC
       
    45   | |
       
    46   | o  1:02bcbc3f6e56 add cB
       
    47   |/
       
    48   o  0:54ccbc537fc2 add cA
       
    49   
       
    50 
       
    51 plain prune
       
    52 
       
    53   $ hg strip 1::
       
    54   3 changesets pruned
       
    55   $ hg log -G
       
    56   @  7:18214586bf78 add cJ
       
    57   |
       
    58   o  6:cf5c4f4554ce add cH
       
    59   |
       
    60   o  5:5419eb264a33 add cG
       
    61   |
       
    62   o  4:98065434e5c6 add cE
       
    63   |
       
    64   o  0:54ccbc537fc2 add cA
       
    65   
       
    66   $ hg debugobsinhibit --hidden 1::
       
    67   $ hg log -G
       
    68   @  7:18214586bf78 add cJ
       
    69   |
       
    70   o  6:cf5c4f4554ce add cH
       
    71   |
       
    72   o  5:5419eb264a33 add cG
       
    73   |
       
    74   o  4:98065434e5c6 add cE
       
    75   |
       
    76   | o  3:2db36d8066ff add cD
       
    77   | |
       
    78   | o  2:7df62a38b9bf add cC
       
    79   | |
       
    80   | o  1:02bcbc3f6e56 add cB
       
    81   |/
       
    82   o  0:54ccbc537fc2 add cA
       
    83   
       
    84   $ hg strip --hidden 1::
       
    85   3 changesets pruned
       
    86   $ hg log -G
       
    87   @  7:18214586bf78 add cJ
       
    88   |
       
    89   o  6:cf5c4f4554ce add cH
       
    90   |
       
    91   o  5:5419eb264a33 add cG
       
    92   |
       
    93   o  4:98065434e5c6 add cE
       
    94   |
       
    95   o  0:54ccbc537fc2 add cA
       
    96   
       
    97 
       
    98 after amend
       
    99 
       
   100   $ echo babar > cJ
       
   101   $ hg commit --amend
       
   102   $ hg log -G
       
   103   @  9:55c73a90e4b4 add cJ
       
   104   |
       
   105   o  6:cf5c4f4554ce add cH
       
   106   |
       
   107   o  5:5419eb264a33 add cG
       
   108   |
       
   109   o  4:98065434e5c6 add cE
       
   110   |
       
   111   o  0:54ccbc537fc2 add cA
       
   112   
       
   113   $ hg debugobsinhibit --hidden 18214586bf78
       
   114   $ hg log -G
       
   115   @  9:55c73a90e4b4 add cJ
       
   116   |
       
   117   | o  7:18214586bf78 add cJ
       
   118   |/
       
   119   o  6:cf5c4f4554ce add cH
       
   120   |
       
   121   o  5:5419eb264a33 add cG
       
   122   |
       
   123   o  4:98065434e5c6 add cE
       
   124   |
       
   125   o  0:54ccbc537fc2 add cA
       
   126   
       
   127 
       
   128 and no divergence
       
   129 
       
   130   $ hg summary
       
   131   parent: 9:55c73a90e4b4 tip
       
   132    add cJ
       
   133   branch: default
       
   134   commit: (clean)
       
   135   update: 1 new changesets, 2 branch heads (merge)
       
   136   phases: 6 draft
       
   137 
       
   138 check public revision got cleared
       
   139 (when adding the second inhibitor, the first one is removed because it is public)
       
   140 
       
   141   $ wc -m .hg/store/obsinhibit | sed -e 's/^[ \t]*//'
       
   142   20 .hg/store/obsinhibit
       
   143   $ hg strip 7
       
   144   1 changesets pruned
       
   145   $ hg debugobsinhibit --hidden 18214586bf78
       
   146   $ wc -m .hg/store/obsinhibit | sed -e 's/^[ \t]*//'
       
   147   20 .hg/store/obsinhibit
       
   148   $ hg log -G
       
   149   @  9:55c73a90e4b4 add cJ
       
   150   |
       
   151   | o  7:18214586bf78 add cJ
       
   152   |/
       
   153   o  6:cf5c4f4554ce add cH
       
   154   |
       
   155   o  5:5419eb264a33 add cG
       
   156   |
       
   157   o  4:98065434e5c6 add cE
       
   158   |
       
   159   o  0:54ccbc537fc2 add cA
       
   160   
       
   161   $ hg phase --public 7
       
   162   $ hg strip 9
       
   163   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   164   working directory now at cf5c4f4554ce
       
   165   1 changesets pruned
       
   166   $ hg log -G
       
   167   o  7:18214586bf78 add cJ
       
   168   |
       
   169   @  6:cf5c4f4554ce add cH
       
   170   |
       
   171   o  5:5419eb264a33 add cG
       
   172   |
       
   173   o  4:98065434e5c6 add cE
       
   174   |
       
   175   o  0:54ccbc537fc2 add cA
       
   176   
       
   177   $ hg debugobsinhibit --hidden 55c73a90e4b4
       
   178   $ wc -m .hg/store/obsinhibit | sed -e 's/^[ \t]*//'
       
   179   20 .hg/store/obsinhibit
       
   180   $ hg log -G
       
   181   o  9:55c73a90e4b4 add cJ
       
   182   |
       
   183   | o  7:18214586bf78 add cJ
       
   184   |/
       
   185   @  6:cf5c4f4554ce add cH
       
   186   |
       
   187   o  5:5419eb264a33 add cG
       
   188   |
       
   189   o  4:98065434e5c6 add cE
       
   190   |
       
   191   o  0:54ccbc537fc2 add cA
       
   192   
       
   193 Update should inhibit all related unstable commits
       
   194 
       
   195   $ hg update 2 --hidden
       
   196   2 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
   197   $ hg log -G
       
   198   o  9:55c73a90e4b4 add cJ
       
   199   |
       
   200   | o  7:18214586bf78 add cJ
       
   201   |/
       
   202   o  6:cf5c4f4554ce add cH
       
   203   |
       
   204   o  5:5419eb264a33 add cG
       
   205   |
       
   206   o  4:98065434e5c6 add cE
       
   207   |
       
   208   | @  2:7df62a38b9bf add cC
       
   209   | |
       
   210   | o  1:02bcbc3f6e56 add cB
       
   211   |/
       
   212   o  0:54ccbc537fc2 add cA
       
   213   
       
   214 
       
   215   $ hg update 9
       
   216   4 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   217   $ hg log -G
       
   218   @  9:55c73a90e4b4 add cJ
       
   219   |
       
   220   | o  7:18214586bf78 add cJ
       
   221   |/
       
   222   o  6:cf5c4f4554ce add cH
       
   223   |
       
   224   o  5:5419eb264a33 add cG
       
   225   |
       
   226   o  4:98065434e5c6 add cE
       
   227   |
       
   228   | o  2:7df62a38b9bf add cC
       
   229   | |
       
   230   | o  1:02bcbc3f6e56 add cB
       
   231   |/
       
   232   o  0:54ccbc537fc2 add cA
       
   233   
       
   234   $ hg strip --hidden 1::
       
   235   3 changesets pruned
       
   236   $ hg log -G
       
   237   @  9:55c73a90e4b4 add cJ
       
   238   |
       
   239   | o  7:18214586bf78 add cJ
       
   240   |/
       
   241   o  6:cf5c4f4554ce add cH
       
   242   |
       
   243   o  5:5419eb264a33 add cG
       
   244   |
       
   245   o  4:98065434e5c6 add cE
       
   246   |
       
   247   o  0:54ccbc537fc2 add cA
       
   248   
       
   249 
       
   250 Bookmark should inhibit all related unstable commits
       
   251   $ hg bookmark -r 2 book1  --hidden
       
   252   $ hg log -G
       
   253   @  9:55c73a90e4b4 add cJ
       
   254   |
       
   255   | o  7:18214586bf78 add cJ
       
   256   |/
       
   257   o  6:cf5c4f4554ce add cH
       
   258   |
       
   259   o  5:5419eb264a33 add cG
       
   260   |
       
   261   o  4:98065434e5c6 add cE
       
   262   |
       
   263   | o  2:7df62a38b9bf add cC
       
   264   | |
       
   265   | o  1:02bcbc3f6e56 add cB
       
   266   |/
       
   267   o  0:54ccbc537fc2 add cA
       
   268   
       
   269 
       
   270 Removing a bookmark with bookmark -D should prune the changes underneath
       
   271 that are not reachable from another bookmark or head
       
   272 
       
   273   $ hg bookmark -r 1 book2
       
   274   $ hg bookmark -D book1  --config experimental.evolution=createmarkers #--config to make sure prune is not registered as a command.
       
   275   bookmark 'book1' deleted
       
   276   1 changesets pruned
       
   277   $ hg log -G
       
   278   @  9:55c73a90e4b4 add cJ
       
   279   |
       
   280   | o  7:18214586bf78 add cJ
       
   281   |/
       
   282   o  6:cf5c4f4554ce add cH
       
   283   |
       
   284   o  5:5419eb264a33 add cG
       
   285   |
       
   286   o  4:98065434e5c6 add cE
       
   287   |
       
   288   | o  1:02bcbc3f6e56 add cB
       
   289   |/
       
   290   o  0:54ccbc537fc2 add cA
       
   291   
       
   292   $ hg bookmark -D book2
       
   293   bookmark 'book2' deleted
       
   294   1 changesets pruned
       
   295   $ hg log -G
       
   296   @  9:55c73a90e4b4 add cJ
       
   297   |
       
   298   | o  7:18214586bf78 add cJ
       
   299   |/
       
   300   o  6:cf5c4f4554ce add cH
       
   301   |
       
   302   o  5:5419eb264a33 add cG
       
   303   |
       
   304   o  4:98065434e5c6 add cE
       
   305   |
       
   306   o  0:54ccbc537fc2 add cA
       
   307   
       
   308 Test that direct access make changesets visible
       
   309 
       
   310   $ hg export 2db36d8066ff 02bcbc3f6e56
       
   311   # HG changeset patch
       
   312   # User test
       
   313   # Date 0 0
       
   314   #      Thu Jan 01 00:00:00 1970 +0000
       
   315   # Node ID 2db36d8066ff50e8be3d3e6c2da1ebc0a8381d82
       
   316   # Parent  7df62a38b9bf9daf968de235043ba88a8ef43393
       
   317   add cD
       
   318   
       
   319   diff -r 7df62a38b9bf -r 2db36d8066ff cD
       
   320   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   321   +++ b/cD	Thu Jan 01 00:00:00 1970 +0000
       
   322   @@ -0,0 +1,1 @@
       
   323   +cD
       
   324   # HG changeset patch
       
   325   # User test
       
   326   # Date 0 0
       
   327   #      Thu Jan 01 00:00:00 1970 +0000
       
   328   # Node ID 02bcbc3f6e56fb2928efec2c6e24472720bf5511
       
   329   # Parent  54ccbc537fc2d6845a5d61337c1cfb80d1d2815e
       
   330   add cB
       
   331   
       
   332   diff -r 54ccbc537fc2 -r 02bcbc3f6e56 cB
       
   333   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   334   +++ b/cB	Thu Jan 01 00:00:00 1970 +0000
       
   335   @@ -0,0 +1,1 @@
       
   336   +cB
       
   337 
       
   338 But only with hash
       
   339 
       
   340   $ hg export 2db36d8066ff::
       
   341   # HG changeset patch
       
   342   # User test
       
   343   # Date 0 0
       
   344   #      Thu Jan 01 00:00:00 1970 +0000
       
   345   # Node ID 2db36d8066ff50e8be3d3e6c2da1ebc0a8381d82
       
   346   # Parent  7df62a38b9bf9daf968de235043ba88a8ef43393
       
   347   add cD
       
   348   
       
   349   diff -r 7df62a38b9bf -r 2db36d8066ff cD
       
   350   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   351   +++ b/cD	Thu Jan 01 00:00:00 1970 +0000
       
   352   @@ -0,0 +1,1 @@
       
   353   +cD
       
   354 
       
   355   $ hg export 1 3
       
   356   abort: hidden revision '1'!
       
   357   (use --hidden to access hidden revisions)
       
   358   [255]
       
   359 
       
   360 
       
   361 Test directaccess in a larger revset
       
   362 
       
   363   $ hg log -r '. + .^ + 2db36d8066ff' -T '{node|short}\n'
       
   364   55c73a90e4b4
       
   365   cf5c4f4554ce
       
   366   2db36d8066ff
       
   367 
       
   368 With severals hidden sha, rebase of one hidden stack onto another one:
       
   369   $ hg update -C 0
       
   370   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
       
   371   $ mkcommit cK
       
   372   created new head
       
   373   $ mkcommit cL
       
   374   $ hg update -C 9
       
   375   4 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   376   $ hg log -G
       
   377   o  11:53a94305e133 add cL
       
   378   |
       
   379   o  10:ad78ff7d621f add cK
       
   380   |
       
   381   | @  9:55c73a90e4b4 add cJ
       
   382   | |
       
   383   | | o  7:18214586bf78 add cJ
       
   384   | |/
       
   385   | o  6:cf5c4f4554ce add cH
       
   386   | |
       
   387   | o  5:5419eb264a33 add cG
       
   388   | |
       
   389   | o  4:98065434e5c6 add cE
       
   390   |/
       
   391   o  0:54ccbc537fc2 add cA
       
   392   
       
   393   $ hg strip --hidden 10:
       
   394   2 changesets pruned
       
   395   $ hg log -G
       
   396   @  9:55c73a90e4b4 add cJ
       
   397   |
       
   398   | o  7:18214586bf78 add cJ
       
   399   |/
       
   400   o  6:cf5c4f4554ce add cH
       
   401   |
       
   402   o  5:5419eb264a33 add cG
       
   403   |
       
   404   o  4:98065434e5c6 add cE
       
   405   |
       
   406   o  0:54ccbc537fc2 add cA
       
   407   
       
   408   $ hg rebase -s 10 -d 3 
       
   409   abort: hidden revision '3'!
       
   410   (use --hidden to access hidden revisions)
       
   411   [255]
       
   412   $ hg rebase -r ad78ff7d621f -r 53a94305e133 -d  2db36d8066ff
       
   413   Warning: accessing hidden changesets 2db36d8066ff for write operation
       
   414   Warning: accessing hidden changesets ad78ff7d621f,53a94305e133 for write operation
       
   415   rebasing 10:ad78ff7d621f "add cK"
       
   416   rebasing 11:53a94305e133 "add cL"
       
   417   $ hg log -G
       
   418   o  13:2f7b7704d714 add cL
       
   419   |
       
   420   o  12:fe1634cbe235 add cK
       
   421   |
       
   422   | @  9:55c73a90e4b4 add cJ
       
   423   | |
       
   424   | | o  7:18214586bf78 add cJ
       
   425   | |/
       
   426   | o  6:cf5c4f4554ce add cH
       
   427   | |
       
   428   | o  5:5419eb264a33 add cG
       
   429   | |
       
   430   | o  4:98065434e5c6 add cE
       
   431   | |
       
   432   o |  3:2db36d8066ff add cD
       
   433   | |
       
   434   o |  2:7df62a38b9bf add cC
       
   435   | |
       
   436   o |  1:02bcbc3f6e56 add cB
       
   437   |/
       
   438   o  0:54ccbc537fc2 add cA
       
   439   
       
   440 Check that amending in the middle of a stack does not show obsolete revs
       
   441 Since we are doing operation in the middle of the stack we cannot just
       
   442 have createmarkers as we are creating instability
       
   443 
       
   444   $ cat >> $HGRCPATH <<EOF
       
   445   > [experimental]
       
   446   > evolution=all
       
   447   > EOF
       
   448 
       
   449   $ hg strip --hidden 1::
       
   450   5 changesets pruned
       
   451   $ hg log -G
       
   452   @  9:55c73a90e4b4 add cJ
       
   453   |
       
   454   | o  7:18214586bf78 add cJ
       
   455   |/
       
   456   o  6:cf5c4f4554ce add cH
       
   457   |
       
   458   o  5:5419eb264a33 add cG
       
   459   |
       
   460   o  4:98065434e5c6 add cE
       
   461   |
       
   462   o  0:54ccbc537fc2 add cA
       
   463   
       
   464   $ hg up 7
       
   465   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   466   $ mkcommit cL
       
   467   $ mkcommit cM
       
   468   $ mkcommit cN
       
   469   $ hg log -G
       
   470   @  16:a438c045eb37 add cN
       
   471   |
       
   472   o  15:2d66e189f5b5 add cM
       
   473   |
       
   474   o  14:d66ccb8c5871 add cL
       
   475   |
       
   476   | o  9:55c73a90e4b4 add cJ
       
   477   | |
       
   478   o |  7:18214586bf78 add cJ
       
   479   |/
       
   480   o  6:cf5c4f4554ce add cH
       
   481   |
       
   482   o  5:5419eb264a33 add cG
       
   483   |
       
   484   o  4:98065434e5c6 add cE
       
   485   |
       
   486   o  0:54ccbc537fc2 add cA
       
   487   
       
   488   $ hg up 15
       
   489   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   490   $ echo "mmm" >> cM
       
   491   $ hg amend
       
   492   $ hg log -G
       
   493   @  18:210589181b14 add cM
       
   494   |
       
   495   | o  16:a438c045eb37 add cN
       
   496   | |
       
   497   | o  15:2d66e189f5b5 add cM
       
   498   |/
       
   499   o  14:d66ccb8c5871 add cL
       
   500   |
       
   501   | o  9:55c73a90e4b4 add cJ
       
   502   | |
       
   503   o |  7:18214586bf78 add cJ
       
   504   |/
       
   505   o  6:cf5c4f4554ce add cH
       
   506   |
       
   507   o  5:5419eb264a33 add cG
       
   508   |
       
   509   o  4:98065434e5c6 add cE
       
   510   |
       
   511   o  0:54ccbc537fc2 add cA
       
   512   
       
   513 Check that rebasing a commit twice makes the commit visible again
       
   514 
       
   515   $ hg rebase -d 18 -r 16 --keep
       
   516   rebasing 16:a438c045eb37 "add cN"
       
   517   $ hg log -r 14:: -G
       
   518   o  19:104eed5354c7 add cN
       
   519   |
       
   520   @  18:210589181b14 add cM
       
   521   |
       
   522   | o  16:a438c045eb37 add cN
       
   523   | |
       
   524   | o  15:2d66e189f5b5 add cM
       
   525   |/
       
   526   o  14:d66ccb8c5871 add cL
       
   527   |
       
   528   $ hg strip -r 104eed5354c7
       
   529   1 changesets pruned
       
   530   $ hg rebase -d 18 -r 16 --keep
       
   531   rebasing 16:a438c045eb37 "add cN"
       
   532   $ hg log -r 14:: -G
       
   533   o  19:104eed5354c7 add cN
       
   534   |
       
   535   @  18:210589181b14 add cM
       
   536   |
       
   537   | o  16:a438c045eb37 add cN
       
   538   | |
       
   539   | o  15:2d66e189f5b5 add cM
       
   540   |/
       
   541   o  14:d66ccb8c5871 add cL
       
   542   |
       
   543 
       
   544 Test prunestrip
       
   545 
       
   546   $ hg book foo -r 104eed5354c7
       
   547   $ hg strip -r 210589181b14
       
   548   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   549   working directory now at d66ccb8c5871
       
   550   2 changesets pruned
       
   551   $ hg log -r 14:: -G -T '{rev}:{node|short} {desc|firstline} {bookmarks}\n'
       
   552   o  16:a438c045eb37 add cN
       
   553   |
       
   554   o  15:2d66e189f5b5 add cM
       
   555   |
       
   556   @  14:d66ccb8c5871 add cL foo
       
   557   |
       
   558 
       
   559 Check that --hidden used with inhibit does not hide every obsolete commit
       
   560 We show the log before and after a log -G --hidden, they should be the same
       
   561   $ hg log -G
       
   562   o  16:a438c045eb37 add cN
       
   563   |
       
   564   o  15:2d66e189f5b5 add cM
       
   565   |
       
   566   @  14:d66ccb8c5871 add cL
       
   567   |
       
   568   | o  9:55c73a90e4b4 add cJ
       
   569   | |
       
   570   o |  7:18214586bf78 add cJ
       
   571   |/
       
   572   o  6:cf5c4f4554ce add cH
       
   573   |
       
   574   o  5:5419eb264a33 add cG
       
   575   |
       
   576   o  4:98065434e5c6 add cE
       
   577   |
       
   578   o  0:54ccbc537fc2 add cA
       
   579   
       
   580   $ hg log -G --hidden
       
   581   x  19:104eed5354c7 add cN
       
   582   |
       
   583   x  18:210589181b14 add cM
       
   584   |
       
   585   | x  17:b3c3274523f9 temporary amend commit for 2d66e189f5b5
       
   586   | |
       
   587   | | o  16:a438c045eb37 add cN
       
   588   | |/
       
   589   | o  15:2d66e189f5b5 add cM
       
   590   |/
       
   591   @  14:d66ccb8c5871 add cL
       
   592   |
       
   593   | x  13:2f7b7704d714 add cL
       
   594   | |
       
   595   | x  12:fe1634cbe235 add cK
       
   596   | |
       
   597   | | x  11:53a94305e133 add cL
       
   598   | | |
       
   599   | | x  10:ad78ff7d621f add cK
       
   600   | | |
       
   601   | | | o  9:55c73a90e4b4 add cJ
       
   602   | | | |
       
   603   +-------x  8:e84f73d9ad36 temporary amend commit for 18214586bf78
       
   604   | | | |
       
   605   o-----+  7:18214586bf78 add cJ
       
   606    / / /
       
   607   | | o  6:cf5c4f4554ce add cH
       
   608   | | |
       
   609   | | o  5:5419eb264a33 add cG
       
   610   | | |
       
   611   | | o  4:98065434e5c6 add cE
       
   612   | |/
       
   613   x |  3:2db36d8066ff add cD
       
   614   | |
       
   615   x |  2:7df62a38b9bf add cC
       
   616   | |
       
   617   x |  1:02bcbc3f6e56 add cB
       
   618   |/
       
   619   o  0:54ccbc537fc2 add cA
       
   620   
       
   621 
       
   622   $ hg log -G
       
   623   o  16:a438c045eb37 add cN
       
   624   |
       
   625   o  15:2d66e189f5b5 add cM
       
   626   |
       
   627   @  14:d66ccb8c5871 add cL
       
   628   |
       
   629   | o  9:55c73a90e4b4 add cJ
       
   630   | |
       
   631   o |  7:18214586bf78 add cJ
       
   632   |/
       
   633   o  6:cf5c4f4554ce add cH
       
   634   |
       
   635   o  5:5419eb264a33 add cG
       
   636   |
       
   637   o  4:98065434e5c6 add cE
       
   638   |
       
   639   o  0:54ccbc537fc2 add cA
       
   640   
       
   641  
       
   642 check that pruning and inhibited node does not confuse anything
       
   643 
       
   644   $ hg up --hidden 210589181b14
       
   645   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   646   $ hg strip --bundle 210589181b14
       
   647   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   648   saved backup bundle to $TESTTMP/inhibit/.hg/strip-backup/210589181b14-e09c7b88-backup.hg (glob)
       
   649   $ hg unbundle .hg/strip-backup/210589181b14-e09c7b88-backup.hg # restore state
       
   650   adding changesets
       
   651   adding manifests
       
   652   adding file changes
       
   653   added 2 changesets with 1 changes to 2 files (+1 heads)
       
   654   (run 'hg heads' to see heads, 'hg merge' to merge)
       
   655 
       
   656  Only allow direct access and check that evolve works like before
       
   657 (also disable evolve commands to avoid hint about using evolve)
       
   658   $ cat >> $HGRCPATH <<EOF
       
   659   > [extensions]
       
   660   > inhibit=!
       
   661   > [experimental]
       
   662   > evolution=createmarkers
       
   663   > EOF
       
   664 
       
   665   $ hg up 15
       
   666   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   667   working directory parent is obsolete!
       
   668   $ cat >> $HGRCPATH <<EOF
       
   669   > [experimental]
       
   670   > evolution=all
       
   671   > EOF
       
   672   $ echo "CM" > cM
       
   673   $ hg amend
       
   674   $ hg log -G
       
   675   @  21:721c3c279519 add cM
       
   676   |
       
   677   | o  16:a438c045eb37 add cN
       
   678   | |
       
   679   | x  15:2d66e189f5b5 add cM
       
   680   |/
       
   681   o  14:d66ccb8c5871 add cL
       
   682   |
       
   683   o  7:18214586bf78 add cJ
       
   684   |
       
   685   o  6:cf5c4f4554ce add cH
       
   686   |
       
   687   o  5:5419eb264a33 add cG
       
   688   |
       
   689   o  4:98065434e5c6 add cE
       
   690   |
       
   691   o  0:54ccbc537fc2 add cA
       
   692   
       
   693   $ cat >> $HGRCPATH <<EOF
       
   694   > [extensions]
       
   695   > EOF
       
   696   $ echo "inhibit=$(echo $(dirname $TESTDIR))/hgext/inhibit.py" >> $HGRCPATH
       
   697 
       
   698 Empty commit
       
   699   $ hg amend
       
   700   nothing changed
       
   701   [1]
       
   702 
       
   703 Directaccess should load after some extensions precised in the conf
       
   704 With no extension specified:
       
   705 
       
   706   $ cat >$TESTTMP/test_extension.py  << EOF
       
   707   > from mercurial import extensions
       
   708   > def uisetup(ui):
       
   709   >   print extensions._order
       
   710   > EOF
       
   711   $ cat >> $HGRCPATH << EOF
       
   712   > [extensions]
       
   713   > testextension=$TESTTMP/test_extension.py
       
   714   > EOF
       
   715   $ hg id
       
   716   ['rebase', 'strip', 'evolve', 'directaccess', 'inhibit', 'testextension']
       
   717   721c3c279519 tip
       
   718 
       
   719 With test_extension specified:
       
   720   $ cat >> $HGRCPATH << EOF
       
   721   > [directaccess]
       
   722   > loadsafter=testextension
       
   723   > EOF
       
   724   $ hg id
       
   725   ['rebase', 'strip', 'evolve', 'inhibit', 'testextension', 'directaccess']
       
   726   721c3c279519 tip
       
   727 
       
   728 Inhibit should not work without directaccess
       
   729   $ cat >> $HGRCPATH <<EOF
       
   730   > [extensions]
       
   731   > directaccess=!
       
   732   > testextension=!
       
   733   > EOF
       
   734   $ hg up .
       
   735   cannot use inhibit without the direct access extension
       
   736   (please enable it or inhibit won't work)
       
   737   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   738   $ echo "directaccess=$(echo $(dirname $TESTDIR))/hgext/directaccess.py" >> $HGRCPATH
       
   739   $ cd ..
       
   740 
       
   741 
       
   742 hg push should not allow directaccess unless forced with --hidden
       
   743 We copy the inhibhit repo to inhibit2 and make some changes to push to inhibit
       
   744 
       
   745   $ cp -r inhibit inhibit2
       
   746   $ pwd=$(pwd)
       
   747   $ cd inhibit
       
   748   $ mkcommit pk
       
   749   $ hg id
       
   750   003a4735afde tip
       
   751   $ echo "OO" > pk
       
   752   $ hg amend
       
   753   $ hg id
       
   754   71eb4f100663 tip
       
   755 
       
   756 Hidden commits cannot be pushed without --hidden
       
   757   $ hg push -r 003a4735afde $pwd/inhibit2
       
   758   pushing to $TESTTMP/inhibit2
       
   759   abort: hidden revision '003a4735afde'!
       
   760   (use --hidden to access hidden revisions)
       
   761   [255]
       
   762 
       
   763 Visible commits can still be pushed
       
   764   $ hg push -r 71eb4f100663 $pwd/inhibit2
       
   765   pushing to $TESTTMP/inhibit2
       
   766   searching for changes
       
   767   adding changesets
       
   768   adding manifests
       
   769   adding file changes
       
   770   added 1 changesets with 1 changes to 1 files
       
   771   2 new obsolescence markers
       
   772 
       
   773 Pulling from a inhibit repo to a non-inhibit repo should work
       
   774 
       
   775   $ cd ..
       
   776   $ hg clone -q inhibit not-inhibit
       
   777   $ cat >> not-inhibit/.hg/hgrc <<EOF
       
   778   > [extensions]
       
   779   > inhibit=!
       
   780   > directaccess=!
       
   781   > evolve=!
       
   782   > EOF
       
   783   $ cd not-inhibit
       
   784   $ hg book -d foo
       
   785   $ hg pull
       
   786   pulling from $TESTTMP/inhibit
       
   787   searching for changes
       
   788   no changes found
       
   789   adding remote bookmark foo