tests/test-inhibit.t
branchmercurial-3.6
changeset 1798 acfc610ec304
parent 1797 4de90774eade
parent 1761 e2585c6cdbdc
child 1799 b1809340478b
child 1819 642f86363883
equal deleted inserted replaced
1797:4de90774eade 1798:acfc610ec304
     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 edge cases of bookmark -D
       
   309   $ hg book -D book2 -m hello
       
   310   abort: Cannot use both -m and -D
       
   311   [255]
       
   312 
       
   313   $ hg book -Draster-fix
       
   314   abort: Error, please check your command
       
   315   (make sure to put a space between -D and your bookmark name)
       
   316   [255]
       
   317 
       
   318 Test that direct access make changesets visible
       
   319 
       
   320   $ hg export 2db36d8066ff 02bcbc3f6e56
       
   321   # HG changeset patch
       
   322   # User test
       
   323   # Date 0 0
       
   324   #      Thu Jan 01 00:00:00 1970 +0000
       
   325   # Node ID 2db36d8066ff50e8be3d3e6c2da1ebc0a8381d82
       
   326   # Parent  7df62a38b9bf9daf968de235043ba88a8ef43393
       
   327   add cD
       
   328   
       
   329   diff -r 7df62a38b9bf -r 2db36d8066ff cD
       
   330   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   331   +++ b/cD	Thu Jan 01 00:00:00 1970 +0000
       
   332   @@ -0,0 +1,1 @@
       
   333   +cD
       
   334   # HG changeset patch
       
   335   # User test
       
   336   # Date 0 0
       
   337   #      Thu Jan 01 00:00:00 1970 +0000
       
   338   # Node ID 02bcbc3f6e56fb2928efec2c6e24472720bf5511
       
   339   # Parent  54ccbc537fc2d6845a5d61337c1cfb80d1d2815e
       
   340   add cB
       
   341   
       
   342   diff -r 54ccbc537fc2 -r 02bcbc3f6e56 cB
       
   343   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   344   +++ b/cB	Thu Jan 01 00:00:00 1970 +0000
       
   345   @@ -0,0 +1,1 @@
       
   346   +cB
       
   347 
       
   348 But only with hash
       
   349 
       
   350   $ hg export 2db36d8066ff::
       
   351   # HG changeset patch
       
   352   # User test
       
   353   # Date 0 0
       
   354   #      Thu Jan 01 00:00:00 1970 +0000
       
   355   # Node ID 2db36d8066ff50e8be3d3e6c2da1ebc0a8381d82
       
   356   # Parent  7df62a38b9bf9daf968de235043ba88a8ef43393
       
   357   add cD
       
   358   
       
   359   diff -r 7df62a38b9bf -r 2db36d8066ff cD
       
   360   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   361   +++ b/cD	Thu Jan 01 00:00:00 1970 +0000
       
   362   @@ -0,0 +1,1 @@
       
   363   +cD
       
   364 
       
   365   $ hg export 1 3
       
   366   abort: hidden revision '1'!
       
   367   (use --hidden to access hidden revisions)
       
   368   [255]
       
   369 
       
   370 
       
   371 Test directaccess in a larger revset
       
   372 
       
   373   $ hg log -r '. + .^ + 2db36d8066ff' -T '{node|short}\n'
       
   374   55c73a90e4b4
       
   375   cf5c4f4554ce
       
   376   2db36d8066ff
       
   377 
       
   378 Test directaccess only takes hashes
       
   379 
       
   380   $ HOOKPATH=$TESTTMP/printexplicitaccess.py
       
   381   $ cat >> $HOOKPATH <<EOF
       
   382   > def hook(ui, repo, **kwds):
       
   383   >     for i in sorted(repo._explicitaccess):
       
   384   >         ui.write('directaccess: %s\n' % i)
       
   385   > EOF
       
   386 
       
   387   $ hg log -r 1 -r 2 -r 2db36d8066f -T '{rev}\n' --config hooks.post-log=python:$HOOKPATH:hook
       
   388   1
       
   389   2
       
   390   3
       
   391   directaccess: 3
       
   392 
       
   393 With severals hidden sha, rebase of one hidden stack onto another one:
       
   394   $ hg update -C 0
       
   395   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
       
   396   $ mkcommit cK
       
   397   created new head
       
   398   $ mkcommit cL
       
   399   $ hg update -C 9
       
   400   4 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   401   $ hg log -G
       
   402   o  11:53a94305e133 add cL
       
   403   |
       
   404   o  10:ad78ff7d621f add cK
       
   405   |
       
   406   | @  9:55c73a90e4b4 add cJ
       
   407   | |
       
   408   | | o  7:18214586bf78 add cJ
       
   409   | |/
       
   410   | o  6:cf5c4f4554ce add cH
       
   411   | |
       
   412   | o  5:5419eb264a33 add cG
       
   413   | |
       
   414   | o  4:98065434e5c6 add cE
       
   415   |/
       
   416   o  0:54ccbc537fc2 add cA
       
   417   
       
   418   $ hg strip --hidden 10:
       
   419   2 changesets pruned
       
   420   $ hg log -G
       
   421   @  9:55c73a90e4b4 add cJ
       
   422   |
       
   423   | o  7:18214586bf78 add cJ
       
   424   |/
       
   425   o  6:cf5c4f4554ce add cH
       
   426   |
       
   427   o  5:5419eb264a33 add cG
       
   428   |
       
   429   o  4:98065434e5c6 add cE
       
   430   |
       
   431   o  0:54ccbc537fc2 add cA
       
   432   
       
   433   $ hg rebase -s 10 -d 3 
       
   434   abort: hidden revision '3'!
       
   435   (use --hidden to access hidden revisions)
       
   436   [255]
       
   437   $ hg rebase -r ad78ff7d621f -r 53a94305e133 -d  2db36d8066ff --config experimental.rebaseskipobsolete=0
       
   438   Warning: accessing hidden changesets 2db36d8066ff for write operation
       
   439   Warning: accessing hidden changesets ad78ff7d621f,53a94305e133 for write operation
       
   440   rebasing 10:ad78ff7d621f "add cK"
       
   441   rebasing 11:53a94305e133 "add cL"
       
   442   $ hg log -G
       
   443   o  13:2f7b7704d714 add cL
       
   444   |
       
   445   o  12:fe1634cbe235 add cK
       
   446   |
       
   447   | @  9:55c73a90e4b4 add cJ
       
   448   | |
       
   449   | | o  7:18214586bf78 add cJ
       
   450   | |/
       
   451   | o  6:cf5c4f4554ce add cH
       
   452   | |
       
   453   | o  5:5419eb264a33 add cG
       
   454   | |
       
   455   | o  4:98065434e5c6 add cE
       
   456   | |
       
   457   o |  3:2db36d8066ff add cD
       
   458   | |
       
   459   o |  2:7df62a38b9bf add cC
       
   460   | |
       
   461   o |  1:02bcbc3f6e56 add cB
       
   462   |/
       
   463   o  0:54ccbc537fc2 add cA
       
   464   
       
   465 
       
   466 Check that amending in the middle of a stack does not show obsolete revs
       
   467 Since we are doing operation in the middle of the stack we cannot just
       
   468 have createmarkers as we are creating instability
       
   469 
       
   470   $ cat >> $HGRCPATH <<EOF
       
   471   > [experimental]
       
   472   > evolution=all
       
   473   > EOF
       
   474 
       
   475   $ hg strip --hidden 1::
       
   476   5 changesets pruned
       
   477   $ hg log -G
       
   478   @  9:55c73a90e4b4 add cJ
       
   479   |
       
   480   | o  7:18214586bf78 add cJ
       
   481   |/
       
   482   o  6:cf5c4f4554ce add cH
       
   483   |
       
   484   o  5:5419eb264a33 add cG
       
   485   |
       
   486   o  4:98065434e5c6 add cE
       
   487   |
       
   488   o  0:54ccbc537fc2 add cA
       
   489   
       
   490   $ hg up 7
       
   491   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   492   $ mkcommit cL
       
   493   $ mkcommit cM
       
   494   $ mkcommit cN
       
   495   $ hg log -G
       
   496   @  16:a438c045eb37 add cN
       
   497   |
       
   498   o  15:2d66e189f5b5 add cM
       
   499   |
       
   500   o  14:d66ccb8c5871 add cL
       
   501   |
       
   502   | o  9:55c73a90e4b4 add cJ
       
   503   | |
       
   504   o |  7:18214586bf78 add cJ
       
   505   |/
       
   506   o  6:cf5c4f4554ce add cH
       
   507   |
       
   508   o  5:5419eb264a33 add cG
       
   509   |
       
   510   o  4:98065434e5c6 add cE
       
   511   |
       
   512   o  0:54ccbc537fc2 add cA
       
   513   
       
   514   $ hg up 15
       
   515   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   516   $ echo "mmm" >> cM
       
   517   $ hg amend
       
   518   $ hg log -G
       
   519   @  18:210589181b14 add cM
       
   520   |
       
   521   | o  16:a438c045eb37 add cN
       
   522   | |
       
   523   | o  15:2d66e189f5b5 add cM
       
   524   |/
       
   525   o  14:d66ccb8c5871 add cL
       
   526   |
       
   527   | o  9:55c73a90e4b4 add cJ
       
   528   | |
       
   529   o |  7:18214586bf78 add cJ
       
   530   |/
       
   531   o  6:cf5c4f4554ce add cH
       
   532   |
       
   533   o  5:5419eb264a33 add cG
       
   534   |
       
   535   o  4:98065434e5c6 add cE
       
   536   |
       
   537   o  0:54ccbc537fc2 add cA
       
   538   
       
   539 Check that rebasing a commit twice makes the commit visible again
       
   540 
       
   541   $ hg rebase -d 18 -r 16 --keep
       
   542   rebasing 16:a438c045eb37 "add cN"
       
   543   $ hg log -r 14:: -G
       
   544   o  19:104eed5354c7 add cN
       
   545   |
       
   546   @  18:210589181b14 add cM
       
   547   |
       
   548   | o  16:a438c045eb37 add cN
       
   549   | |
       
   550   | o  15:2d66e189f5b5 add cM
       
   551   |/
       
   552   o  14:d66ccb8c5871 add cL
       
   553   |
       
   554   $ hg strip -r 210589181b14
       
   555   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   556   working directory now at d66ccb8c5871
       
   557   2 changesets pruned
       
   558 
       
   559 Using a hash prefix solely made of digits should work
       
   560   $ hg update 210589181
       
   561   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   562   $ hg rebase -d 18 -r 16 --keep
       
   563   rebasing 16:a438c045eb37 "add cN"
       
   564   $ hg log -r 14:: -G
       
   565   o  19:104eed5354c7 add cN
       
   566   |
       
   567   @  18:210589181b14 add cM
       
   568   |
       
   569   | o  16:a438c045eb37 add cN
       
   570   | |
       
   571   | o  15:2d66e189f5b5 add cM
       
   572   |/
       
   573   o  14:d66ccb8c5871 add cL
       
   574   |
       
   575 
       
   576 Test prunestrip
       
   577 
       
   578   $ hg book foo -r 104eed5354c7
       
   579   $ hg strip -r 210589181b14
       
   580   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   581   working directory now at d66ccb8c5871
       
   582   2 changesets pruned
       
   583   $ hg log -r 14:: -G -T '{rev}:{node|short} {desc|firstline} {bookmarks}\n'
       
   584   o  16:a438c045eb37 add cN
       
   585   |
       
   586   o  15:2d66e189f5b5 add cM
       
   587   |
       
   588   @  14:d66ccb8c5871 add cL foo
       
   589   |
       
   590 
       
   591 Check that --hidden used with inhibit does not hide every obsolete commit
       
   592 We show the log before and after a log -G --hidden, they should be the same
       
   593   $ hg log -G
       
   594   o  16:a438c045eb37 add cN
       
   595   |
       
   596   o  15:2d66e189f5b5 add cM
       
   597   |
       
   598   @  14:d66ccb8c5871 add cL
       
   599   |
       
   600   | o  9:55c73a90e4b4 add cJ
       
   601   | |
       
   602   o |  7:18214586bf78 add cJ
       
   603   |/
       
   604   o  6:cf5c4f4554ce add cH
       
   605   |
       
   606   o  5:5419eb264a33 add cG
       
   607   |
       
   608   o  4:98065434e5c6 add cE
       
   609   |
       
   610   o  0:54ccbc537fc2 add cA
       
   611   
       
   612   $ hg log -G --hidden
       
   613   x  19:104eed5354c7 add cN
       
   614   |
       
   615   x  18:210589181b14 add cM
       
   616   |
       
   617   | x  17:b3c3274523f9 temporary amend commit for 2d66e189f5b5
       
   618   | |
       
   619   | | o  16:a438c045eb37 add cN
       
   620   | |/
       
   621   | o  15:2d66e189f5b5 add cM
       
   622   |/
       
   623   @  14:d66ccb8c5871 add cL
       
   624   |
       
   625   | x  13:2f7b7704d714 add cL
       
   626   | |
       
   627   | x  12:fe1634cbe235 add cK
       
   628   | |
       
   629   | | x  11:53a94305e133 add cL
       
   630   | | |
       
   631   | | x  10:ad78ff7d621f add cK
       
   632   | | |
       
   633   | | | o  9:55c73a90e4b4 add cJ
       
   634   | | | |
       
   635   +-------x  8:e84f73d9ad36 temporary amend commit for 18214586bf78
       
   636   | | | |
       
   637   o-----+  7:18214586bf78 add cJ
       
   638    / / /
       
   639   | | o  6:cf5c4f4554ce add cH
       
   640   | | |
       
   641   | | o  5:5419eb264a33 add cG
       
   642   | | |
       
   643   | | o  4:98065434e5c6 add cE
       
   644   | |/
       
   645   x |  3:2db36d8066ff add cD
       
   646   | |
       
   647   x |  2:7df62a38b9bf add cC
       
   648   | |
       
   649   x |  1:02bcbc3f6e56 add cB
       
   650   |/
       
   651   o  0:54ccbc537fc2 add cA
       
   652   
       
   653 
       
   654   $ hg log -G
       
   655   o  16:a438c045eb37 add cN
       
   656   |
       
   657   o  15:2d66e189f5b5 add cM
       
   658   |
       
   659   @  14:d66ccb8c5871 add cL
       
   660   |
       
   661   | o  9:55c73a90e4b4 add cJ
       
   662   | |
       
   663   o |  7:18214586bf78 add cJ
       
   664   |/
       
   665   o  6:cf5c4f4554ce add cH
       
   666   |
       
   667   o  5:5419eb264a33 add cG
       
   668   |
       
   669   o  4:98065434e5c6 add cE
       
   670   |
       
   671   o  0:54ccbc537fc2 add cA
       
   672   
       
   673  
       
   674 check that pruning and inhibited node does not confuse anything
       
   675 
       
   676   $ hg up --hidden 210589181b14
       
   677   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   678   $ hg strip --bundle 210589181b14
       
   679   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   680   saved backup bundle to $TESTTMP/inhibit/.hg/strip-backup/210589181b14-e09c7b88-backup.hg (glob)
       
   681   $ hg unbundle .hg/strip-backup/210589181b14-e09c7b88-backup.hg # restore state
       
   682   adding changesets
       
   683   adding manifests
       
   684   adding file changes
       
   685   added 2 changesets with 1 changes to 2 files (+1 heads)
       
   686   (run 'hg heads .' to see heads, 'hg merge' to merge)
       
   687 
       
   688  Only allow direct access and check that evolve works like before
       
   689 (also disable evolve commands to avoid hint about using evolve)
       
   690   $ cat >> $HGRCPATH <<EOF
       
   691   > [extensions]
       
   692   > inhibit=!
       
   693   > [experimental]
       
   694   > evolution=createmarkers
       
   695   > EOF
       
   696 
       
   697   $ hg up 15
       
   698   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   699   working directory parent is obsolete!
       
   700   $ cat >> $HGRCPATH <<EOF
       
   701   > [experimental]
       
   702   > evolution=all
       
   703   > EOF
       
   704   $ echo "CM" > cM
       
   705   $ hg amend
       
   706   $ hg log -G
       
   707   @  21:721c3c279519 add cM
       
   708   |
       
   709   | o  16:a438c045eb37 add cN
       
   710   | |
       
   711   | x  15:2d66e189f5b5 add cM
       
   712   |/
       
   713   o  14:d66ccb8c5871 add cL
       
   714   |
       
   715   o  7:18214586bf78 add cJ
       
   716   |
       
   717   o  6:cf5c4f4554ce add cH
       
   718   |
       
   719   o  5:5419eb264a33 add cG
       
   720   |
       
   721   o  4:98065434e5c6 add cE
       
   722   |
       
   723   o  0:54ccbc537fc2 add cA
       
   724   
       
   725   $ cat >> $HGRCPATH <<EOF
       
   726   > [extensions]
       
   727   > EOF
       
   728   $ echo "inhibit=$(echo $(dirname $TESTDIR))/hgext/inhibit.py" >> $HGRCPATH
       
   729 
       
   730 Empty commit
       
   731   $ hg amend
       
   732   nothing changed
       
   733   [1]
       
   734 
       
   735 Check that the behavior of rebase with obsolescence markers is maintained
       
   736 despite inhibit
       
   737 
       
   738   $ hg up a438c045eb37
       
   739   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   740   $ hg rebase -r 15:: -d 21 --config experimental.rebaseskipobsolete=True
       
   741   note: not rebasing 15:2d66e189f5b5 "add cM", already in destination as 21:721c3c279519 "add cM"
       
   742   rebasing 16:a438c045eb37 "add cN"
       
   743   $ hg up -q 2d66e189f5b5 # To inhibit it as the rest of test depends on it
       
   744   $ hg up -q 21
       
   745 
       
   746 Directaccess should load after some extensions precised in the conf
       
   747 With no extension specified:
       
   748 
       
   749   $ cat >$TESTTMP/test_extension.py  << EOF
       
   750   > from mercurial import extensions
       
   751   > def uisetup(ui):
       
   752   >   print extensions._order
       
   753   > EOF
       
   754   $ cat >> $HGRCPATH << EOF
       
   755   > [extensions]
       
   756   > testextension=$TESTTMP/test_extension.py
       
   757   > EOF
       
   758   $ hg id
       
   759   ['rebase', 'strip', 'evolve', 'directaccess', 'inhibit', 'testextension']
       
   760   721c3c279519
       
   761 
       
   762 With test_extension specified:
       
   763   $ cat >> $HGRCPATH << EOF
       
   764   > [directaccess]
       
   765   > loadsafter=testextension
       
   766   > EOF
       
   767   $ hg id
       
   768   ['rebase', 'strip', 'evolve', 'inhibit', 'testextension', 'directaccess']
       
   769   721c3c279519
       
   770 
       
   771 Inhibit should not work without directaccess
       
   772   $ cat >> $HGRCPATH <<EOF
       
   773   > [extensions]
       
   774   > directaccess=!
       
   775   > testextension=!
       
   776   > EOF
       
   777   $ hg up .
       
   778   cannot use inhibit without the direct access extension
       
   779   (please enable it or inhibit won't work)
       
   780   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   781   $ echo "directaccess=$(echo $(dirname $TESTDIR))/hgext/directaccess.py" >> $HGRCPATH
       
   782   $ cd ..
       
   783 
       
   784 hg push should not allow directaccess unless forced with --hidden
       
   785 We copy the inhibhit repo to inhibit2 and make some changes to push to inhibit
       
   786 
       
   787   $ cp -r inhibit inhibit2
       
   788   $ pwd=$(pwd)
       
   789   $ cd inhibit
       
   790   $ mkcommit pk
       
   791   created new head
       
   792   $ hg id
       
   793   003a4735afde tip
       
   794   $ echo "OO" > pk
       
   795   $ hg amend
       
   796   $ hg id
       
   797   71eb4f100663 tip
       
   798 
       
   799 Hidden commits cannot be pushed without --hidden
       
   800   $ hg push -r 003a4735afde $pwd/inhibit2
       
   801   pushing to $TESTTMP/inhibit2
       
   802   abort: hidden revision '003a4735afde'!
       
   803   (use --hidden to access hidden revisions)
       
   804   [255]
       
   805 
       
   806 Visible commits can still be pushed
       
   807   $ hg push -r 71eb4f100663 $pwd/inhibit2
       
   808   pushing to $TESTTMP/inhibit2
       
   809   searching for changes
       
   810   adding changesets
       
   811   adding manifests
       
   812   adding file changes
       
   813   added 1 changesets with 1 changes to 1 files (+1 heads)
       
   814   2 new obsolescence markers
       
   815 
       
   816 Create a stack (obsolete with successor in dest) -> (not obsolete) and rebase
       
   817 it. We expect to not see the stack at the end of the rebase.
       
   818   $ hg log -G  -r "25::"
       
   819   @  25:71eb4f100663 add pk
       
   820   |
       
   821   $ hg up -C 22
       
   822   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   823   $ mkcommit Dk
       
   824   $ hg prune 22 -s 25
       
   825   1 changesets pruned
       
   826   $ hg rebase -s 22 -d 25 --config experimental.rebaseskipobsolete=True
       
   827   note: not rebasing 22:46cb6daad392 "add cN", already in destination as 25:71eb4f100663 "add pk"
       
   828   rebasing 26:7ad60e760c7b "add Dk" (tip)
       
   829   $ hg log -G  -r "25::"
       
   830   @  27:1192fa9fbc68 add Dk
       
   831   |
       
   832   o  25:71eb4f100663 add pk
       
   833   |
       
   834 
       
   835 Create a stack (obsolete with succ in dest) -> (not obsolete) -> (not obsolete).
       
   836 Rebase the first two revs of the stack onto dest, we expect to see one new
       
   837 revision on the destination and everything visible.
       
   838   $ hg up 25
       
   839   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   840   $ mkcommit Dl
       
   841   created new head
       
   842   $ mkcommit Dp
       
   843   $ mkcommit Do
       
   844   $ hg log -G -r "25::"
       
   845   @  30:b517facce1ef add Do
       
   846   |
       
   847   o  29:c5a47ab27c2e add Dp
       
   848   |
       
   849   o  28:8c1c2edbaf1b add Dl
       
   850   |
       
   851   | o  27:1192fa9fbc68 add Dk
       
   852   |/
       
   853   o  25:71eb4f100663 add pk
       
   854   |
       
   855   $ hg prune 28 -s 27
       
   856   1 changesets pruned
       
   857   $ hg up 25
       
   858   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
   859   $ hg rebase -r "28 + 29" --keep -d 27 --config experimental.rebaseskipobsolete=True
       
   860   note: not rebasing 28:8c1c2edbaf1b "add Dl", already in destination as 27:1192fa9fbc68 "add Dk"
       
   861   rebasing 29:c5a47ab27c2e "add Dp"
       
   862   $ hg log -G  -r "25::"
       
   863   o  31:7d8affb1f604 add Dp
       
   864   |
       
   865   | o  30:b517facce1ef add Do
       
   866   | |
       
   867   | o  29:c5a47ab27c2e add Dp
       
   868   | |
       
   869   | o  28:8c1c2edbaf1b add Dl
       
   870   | |
       
   871   o |  27:1192fa9fbc68 add Dk
       
   872   |/
       
   873   @  25:71eb4f100663 add pk
       
   874   |
       
   875 
       
   876 Rebase the same stack in full on the destination, we expect it to disappear
       
   877 and only see the top revision added to destination. We don\'t expect 29 to be
       
   878 skipped as we used --keep before.
       
   879   $ hg rebase -s 28 -d 27 --config experimental.rebaseskipobsolete=True
       
   880   note: not rebasing 28:8c1c2edbaf1b "add Dl", already in destination as 27:1192fa9fbc68 "add Dk"
       
   881   rebasing 29:c5a47ab27c2e "add Dp"
       
   882   rebasing 30:b517facce1ef "add Do"
       
   883   $ hg log -G  -r "25::"
       
   884   o  32:1d43fff9e26f add Do
       
   885   |
       
   886   o  31:7d8affb1f604 add Dp
       
   887   |
       
   888   o  27:1192fa9fbc68 add Dk
       
   889   |
       
   890   @  25:71eb4f100663 add pk
       
   891   |
       
   892 
       
   893 Pulling from a inhibit repo to a non-inhibit repo should work
       
   894 
       
   895   $ cd ..
       
   896   $ hg clone -q inhibit not-inhibit
       
   897   $ cat >> not-inhibit/.hg/hgrc <<EOF
       
   898   > [extensions]
       
   899   > inhibit=!
       
   900   > directaccess=!
       
   901   > evolve=!
       
   902   > EOF
       
   903   $ cd not-inhibit
       
   904   $ hg book -d foo
       
   905   $ hg pull
       
   906   pulling from $TESTTMP/inhibit
       
   907   searching for changes
       
   908   no changes found
       
   909   adding remote bookmark foo
       
   910 
       
   911 Test that bookmark -D can take multiple branch names
       
   912   $ cd ../inhibit
       
   913   $ hg bookmark book2 book1 book3
       
   914   $ touch foo && hg add foo && hg ci -m "add foo"
       
   915   created new head
       
   916   $ hg up book1
       
   917   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   918   (activating bookmark book1)
       
   919   $ hg bookmark -D book2 book3
       
   920   bookmark 'book2' deleted
       
   921   bookmark 'book3' deleted
       
   922   1 changesets pruned