tests/test-phases.t
changeset 34876 eb1b964b354b
parent 34866 1644623ab096
child 34938 aa05b95949fe
equal deleted inserted replaced
34875:4f0d4bc63b8a 34876:eb1b964b354b
    26   $ hg phase null
    26   $ hg phase null
    27   -1: public
    27   -1: public
    28 
    28 
    29   $ mkcommit A
    29   $ mkcommit A
    30   test-debug-phase: new rev 0:  x -> 1
    30   test-debug-phase: new rev 0:  x -> 1
    31   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> 1
    31   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> draft
    32 
    32 
    33 New commit are draft by default
    33 New commit are draft by default
    34 
    34 
    35   $ hglog
    35   $ hglog
    36   0 1 A
    36   0 1 A
    37 
    37 
    38 Following commit are draft too
    38 Following commit are draft too
    39 
    39 
    40   $ mkcommit B
    40   $ mkcommit B
    41   test-debug-phase: new rev 1:  x -> 1
    41   test-debug-phase: new rev 1:  x -> 1
    42   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> 1
    42   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> draft
    43 
    43 
    44   $ hglog
    44   $ hglog
    45   1 1 B
    45   1 1 B
    46   0 1 A
    46   0 1 A
    47 
    47 
    48 Draft commit are properly created over public one:
    48 Draft commit are properly created over public one:
    49 
    49 
    50   $ hg phase --public .
    50   $ hg phase --public .
    51   test-debug-phase: move rev 0: 1 -> 0
    51   test-debug-phase: move rev 0: 1 -> 0
    52   test-debug-phase: move rev 1: 1 -> 0
    52   test-debug-phase: move rev 1: 1 -> 0
    53   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:  1 -> 0
    53   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:  draft -> public
    54   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:  1 -> 0
    54   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:  draft -> public
    55   $ hg phase
    55   $ hg phase
    56   1: public
    56   1: public
    57   $ hglog
    57   $ hglog
    58   1 0 B
    58   1 0 B
    59   0 0 A
    59   0 0 A
    60 
    60 
    61   $ mkcommit C
    61   $ mkcommit C
    62   test-debug-phase: new rev 2:  x -> 1
    62   test-debug-phase: new rev 2:  x -> 1
    63   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> 1
    63   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> draft
    64   $ mkcommit D
    64   $ mkcommit D
    65   test-debug-phase: new rev 3:  x -> 1
    65   test-debug-phase: new rev 3:  x -> 1
    66   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> 1
    66   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> draft
    67 
    67 
    68   $ hglog
    68   $ hglog
    69   3 1 D
    69   3 1 D
    70   2 1 C
    70   2 1 C
    71   1 0 B
    71   1 0 B
    73 
    73 
    74 Test creating changeset as secret
    74 Test creating changeset as secret
    75 
    75 
    76   $ mkcommit E --config phases.new-commit='secret'
    76   $ mkcommit E --config phases.new-commit='secret'
    77   test-debug-phase: new rev 4:  x -> 2
    77   test-debug-phase: new rev 4:  x -> 2
    78   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:   -> 2
    78   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:   -> secret
    79   $ hglog
    79   $ hglog
    80   4 2 E
    80   4 2 E
    81   3 1 D
    81   3 1 D
    82   2 1 C
    82   2 1 C
    83   1 0 B
    83   1 0 B
    85 
    85 
    86 Test the secret property is inherited
    86 Test the secret property is inherited
    87 
    87 
    88   $ mkcommit H
    88   $ mkcommit H
    89   test-debug-phase: new rev 5:  x -> 2
    89   test-debug-phase: new rev 5:  x -> 2
    90   test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8:   -> 2
    90   test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8:   -> secret
    91   $ hglog
    91   $ hglog
    92   5 2 H
    92   5 2 H
    93   4 2 E
    93   4 2 E
    94   3 1 D
    94   3 1 D
    95   2 1 C
    95   2 1 C
   100 
   100 
   101   $ hg up -q 1
   101   $ hg up -q 1
   102   $ mkcommit "B'"
   102   $ mkcommit "B'"
   103   test-debug-phase: new rev 6:  x -> 1
   103   test-debug-phase: new rev 6:  x -> 1
   104   created new head
   104   created new head
   105   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> 1
   105   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> draft
   106   $ hglog
   106   $ hglog
   107   6 1 B'
   107   6 1 B'
   108   5 2 H
   108   5 2 H
   109   4 2 E
   109   4 2 E
   110   3 1 D
   110   3 1 D
   117   $ hg phase
   117   $ hg phase
   118   6: draft
   118   6: draft
   119   4: secret
   119   4: secret
   120   $ hg ci -m "merge B' and E"
   120   $ hg ci -m "merge B' and E"
   121   test-debug-phase: new rev 7:  x -> 2
   121   test-debug-phase: new rev 7:  x -> 2
   122   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:   -> 2
   122   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:   -> secret
   123 
   123 
   124   $ hglog
   124   $ hglog
   125   7 2 merge B' and E
   125   7 2 merge B' and E
   126   6 1 B'
   126   6 1 B'
   127   5 2 H
   127   5 2 H
   165   test-debug-phase: new rev 0:  x -> 0
   165   test-debug-phase: new rev 0:  x -> 0
   166   test-debug-phase: new rev 1:  x -> 0
   166   test-debug-phase: new rev 1:  x -> 0
   167   test-debug-phase: new rev 2:  x -> 1
   167   test-debug-phase: new rev 2:  x -> 1
   168   test-debug-phase: new rev 3:  x -> 1
   168   test-debug-phase: new rev 3:  x -> 1
   169   test-debug-phase: new rev 4:  x -> 1
   169   test-debug-phase: new rev 4:  x -> 1
   170   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> 0
   170   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> public
   171   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> 0
   171   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> public
   172   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> 1
   172   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> draft
   173   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> 1
   173   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> draft
   174   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> 1
   174   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> draft
   175   $ hglog
   175   $ hglog
   176   7 2 merge B' and E
   176   7 2 merge B' and E
   177   6 1 B'
   177   6 1 B'
   178   5 2 H
   178   5 2 H
   179   4 2 E
   179   4 2 E
   196 visible shared between the initial repo and the push destination.
   196 visible shared between the initial repo and the push destination.
   197 
   197 
   198   $ hg up -q 4 # B'
   198   $ hg up -q 4 # B'
   199   $ mkcommit Z --config phases.new-commit=secret
   199   $ mkcommit Z --config phases.new-commit=secret
   200   test-debug-phase: new rev 5:  x -> 2
   200   test-debug-phase: new rev 5:  x -> 2
   201   test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a:   -> 2
   201   test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a:   -> secret
   202   $ hg phase .
   202   $ hg phase .
   203   5: secret
   203   5: secret
   204 
   204 
   205 We now try to push a new public changeset that descend from the common public
   205 We now try to push a new public changeset that descend from the common public
   206 head shadowed by the remote secret head.
   206 head shadowed by the remote secret head.
   208   $ cd ../initialrepo
   208   $ cd ../initialrepo
   209   $ hg up -q 6 #B'
   209   $ hg up -q 6 #B'
   210   $ mkcommit I
   210   $ mkcommit I
   211   test-debug-phase: new rev 8:  x -> 1
   211   test-debug-phase: new rev 8:  x -> 1
   212   created new head
   212   created new head
   213   test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061:   -> 1
   213   test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061:   -> draft
   214   $ hg push ../push-dest
   214   $ hg push ../push-dest
   215   pushing to ../push-dest
   215   pushing to ../push-dest
   216   searching for changes
   216   searching for changes
   217   adding changesets
   217   adding changesets
   218   adding manifests
   218   adding manifests
   219   adding file changes
   219   adding file changes
   220   added 1 changesets with 1 changes to 1 files (+1 heads)
   220   added 1 changesets with 1 changes to 1 files (+1 heads)
   221   test-debug-phase: new rev 6:  x -> 1
   221   test-debug-phase: new rev 6:  x -> 1
   222   test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061:   -> 1
   222   test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061:   -> draft
   223 
   223 
   224 :note: The "(+1 heads)" is wrong as we do not had any visible head
   224 :note: The "(+1 heads)" is wrong as we do not had any visible head
   225 
   225 
   226 check that branch cache with "served" filter are properly computed and stored
   226 check that branch cache with "served" filter are properly computed and stored
   227 
   227 
   271   test-debug-phase: new rev 0:  x -> 0
   271   test-debug-phase: new rev 0:  x -> 0
   272   test-debug-phase: new rev 1:  x -> 0
   272   test-debug-phase: new rev 1:  x -> 0
   273   test-debug-phase: new rev 2:  x -> 0
   273   test-debug-phase: new rev 2:  x -> 0
   274   test-debug-phase: new rev 3:  x -> 0
   274   test-debug-phase: new rev 3:  x -> 0
   275   test-debug-phase: new rev 4:  x -> 0
   275   test-debug-phase: new rev 4:  x -> 0
   276   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> 0
   276   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> public
   277   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> 0
   277   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> public
   278   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> 0
   278   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> public
   279   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> 0
   279   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> public
   280   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> 0
   280   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> public
   281   (run 'hg heads' to see heads, 'hg merge' to merge)
   281   (run 'hg heads' to see heads, 'hg merge' to merge)
   282   $ hglog
   282   $ hglog
   283   4 0 B'
   283   4 0 B'
   284   3 0 D
   284   3 0 D
   285   2 0 C
   285   2 0 C
   301   test-debug-phase: new rev 0:  x -> 0
   301   test-debug-phase: new rev 0:  x -> 0
   302   test-debug-phase: new rev 1:  x -> 0
   302   test-debug-phase: new rev 1:  x -> 0
   303   test-debug-phase: new rev 2:  x -> 0
   303   test-debug-phase: new rev 2:  x -> 0
   304   test-debug-phase: new rev 3:  x -> 0
   304   test-debug-phase: new rev 3:  x -> 0
   305   test-debug-phase: new rev 4:  x -> 0
   305   test-debug-phase: new rev 4:  x -> 0
   306   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> 0
   306   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> public
   307   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> 0
   307   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> public
   308   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> 0
   308   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> public
   309   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> 0
   309   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> public
   310   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> 0
   310   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> public
   311   $ hglog -R clone-dest
   311   $ hglog -R clone-dest
   312   4 0 B'
   312   4 0 B'
   313   3 0 D
   313   3 0 D
   314   2 0 C
   314   2 0 C
   315   1 0 B
   315   1 0 B
   505 
   505 
   506 (with -r option)
   506 (with -r option)
   507 
   507 
   508   $ hg phase --public -r 2
   508   $ hg phase --public -r 2
   509   test-debug-phase: move rev 2: 1 -> 0
   509   test-debug-phase: move rev 2: 1 -> 0
   510   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:  1 -> 0
   510   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:  draft -> public
   511   $ hg log -G --template "{rev} {phase} {desc}\n"
   511   $ hg log -G --template "{rev} {phase} {desc}\n"
   512   @    7 secret merge B' and E
   512   @    7 secret merge B' and E
   513   |\
   513   |\
   514   | o  6 draft B'
   514   | o  6 draft B'
   515   | |
   515   | |
   530 
   530 
   531 (without -r option)
   531 (without -r option)
   532 
   532 
   533   $ hg phase --draft --force 2
   533   $ hg phase --draft --force 2
   534   test-debug-phase: move rev 2: 0 -> 1
   534   test-debug-phase: move rev 2: 0 -> 1
   535   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:  0 -> 1
   535   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:  public -> draft
   536   $ hg log -G --template "{rev} {phase} {desc}\n"
   536   $ hg log -G --template "{rev} {phase} {desc}\n"
   537   @    7 secret merge B' and E
   537   @    7 secret merge B' and E
   538   |\
   538   |\
   539   | o  6 draft B'
   539   | o  6 draft B'
   540   | |
   540   | |
   554 move changeset forward and backward
   554 move changeset forward and backward
   555 
   555 
   556   $ hg phase --draft --force 1::4
   556   $ hg phase --draft --force 1::4
   557   test-debug-phase: move rev 1: 0 -> 1
   557   test-debug-phase: move rev 1: 0 -> 1
   558   test-debug-phase: move rev 4: 2 -> 1
   558   test-debug-phase: move rev 4: 2 -> 1
   559   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:  0 -> 1
   559   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:  public -> draft
   560   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  2 -> 1
   560   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  secret -> draft
   561   $ hg log -G --template "{rev} {phase} {desc}\n"
   561   $ hg log -G --template "{rev} {phase} {desc}\n"
   562   @    7 secret merge B' and E
   562   @    7 secret merge B' and E
   563   |\
   563   |\
   564   | o  6 draft B'
   564   | o  6 draft B'
   565   | |
   565   | |
   582   test-debug-phase: move rev 2: 1 -> 0
   582   test-debug-phase: move rev 2: 1 -> 0
   583   test-debug-phase: move rev 3: 1 -> 0
   583   test-debug-phase: move rev 3: 1 -> 0
   584   test-debug-phase: move rev 4: 1 -> 0
   584   test-debug-phase: move rev 4: 1 -> 0
   585   test-debug-phase: move rev 6: 1 -> 0
   585   test-debug-phase: move rev 6: 1 -> 0
   586   test-debug-phase: move rev 7: 2 -> 0
   586   test-debug-phase: move rev 7: 2 -> 0
   587   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:  1 -> 0
   587   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:  draft -> public
   588   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:  1 -> 0
   588   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:  draft -> public
   589   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:  1 -> 0
   589   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:  draft -> public
   590   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  1 -> 0
   590   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  draft -> public
   591   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:  1 -> 0
   591   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:  draft -> public
   592   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:  2 -> 0
   592   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:  secret -> public
   593   $ hg phase --draft '5 or 7'
   593   $ hg phase --draft '5 or 7'
   594   test-debug-phase: move rev 5: 2 -> 1
   594   test-debug-phase: move rev 5: 2 -> 1
   595   test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8:  2 -> 1
   595   test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8:  secret -> draft
   596   cannot move 1 changesets to a higher phase, use --force
   596   cannot move 1 changesets to a higher phase, use --force
   597   phase changed for 1 changesets
   597   phase changed for 1 changesets
   598   [1]
   598   [1]
   599   $ hg log -G --template "{rev} {phase} {desc}\n"
   599   $ hg log -G --template "{rev} {phase} {desc}\n"
   600   @    7 public merge B' and E
   600   @    7 public merge B' and E
   650   test-debug-phase: new rev 2:  x -> 0
   650   test-debug-phase: new rev 2:  x -> 0
   651   test-debug-phase: new rev 3:  x -> 0
   651   test-debug-phase: new rev 3:  x -> 0
   652   test-debug-phase: new rev 4:  x -> 0
   652   test-debug-phase: new rev 4:  x -> 0
   653   test-debug-phase: new rev 5:  x -> 0
   653   test-debug-phase: new rev 5:  x -> 0
   654   test-debug-phase: new rev 6:  x -> 0
   654   test-debug-phase: new rev 6:  x -> 0
   655   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> 0
   655   test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256:   -> public
   656   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> 0
   656   test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56:   -> public
   657   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> 0
   657   test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757:   -> public
   658   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> 0
   658   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:   -> public
   659   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:   -> 0
   659   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:   -> public
   660   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> 0
   660   test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519:   -> public
   661   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:   -> 0
   661   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:   -> public
   662   updating to branch default
   662   updating to branch default
   663   6 files updated, 0 files merged, 0 files removed, 0 files unresolved
   663   6 files updated, 0 files merged, 0 files removed, 0 files unresolved
   664   $ cd clonewithobs
   664   $ cd clonewithobs
   665   $ hg log -G --template "{rev} {phase} {desc}\n"
   665   $ hg log -G --template "{rev} {phase} {desc}\n"
   666   @    6 public merge B' and E
   666   @    6 public merge B' and E
   738   $ hg phase --force b3325c91a4d9 --secret
   738   $ hg phase --force b3325c91a4d9 --secret
   739   test-debug-phase: move rev 3: 0 -> 2
   739   test-debug-phase: move rev 3: 0 -> 2
   740   test-debug-phase: move rev 4: 0 -> 2
   740   test-debug-phase: move rev 4: 0 -> 2
   741   test-debug-phase: move rev 5: 1 -> 2
   741   test-debug-phase: move rev 5: 1 -> 2
   742   test-debug-phase: move rev 7: 0 -> 2
   742   test-debug-phase: move rev 7: 0 -> 2
   743   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:  0 -> 2
   743   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:  public -> secret
   744   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  0 -> 2
   744   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  public -> secret
   745   test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8:  1 -> 2
   745   test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8:  draft -> secret
   746   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:  0 -> 2
   746   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:  public -> secret
   747   $ hg log -G -T phases
   747   $ hg log -G -T phases
   748   @    changeset:   7:17a481b3bccb
   748   @    changeset:   7:17a481b3bccb
   749   |\   tag:         tip
   749   |\   tag:         tip
   750   | |  phase:       secret
   750   | |  phase:       secret
   751   | |  parent:      6:cf9fe039dfd6
   751   | |  parent:      6:cf9fe039dfd6
   794 
   794 
   795 Install a hook that prevent b3325c91a4d9 to become public
   795 Install a hook that prevent b3325c91a4d9 to become public
   796 
   796 
   797   $ cat >> .hg/hgrc << EOF
   797   $ cat >> .hg/hgrc << EOF
   798   > [hooks]
   798   > [hooks]
   799   > pretxnclose-phase.nopublish_D = (echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 0 -lt \$HG_PHASE ]
   799   > pretxnclose-phase.nopublish_D = (echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]
   800   > EOF
   800   > EOF
   801 
   801 
   802 Try various actions. only the draft move should succeed
   802 Try various actions. only the draft move should succeed
   803 
   803 
   804   $ hg phase --public b3325c91a4d9
   804   $ hg phase --public b3325c91a4d9
   813   [255]
   813   [255]
   814   $ hg phase --draft 17a481b3bccb
   814   $ hg phase --draft 17a481b3bccb
   815   test-debug-phase: move rev 3: 2 -> 1
   815   test-debug-phase: move rev 3: 2 -> 1
   816   test-debug-phase: move rev 4: 2 -> 1
   816   test-debug-phase: move rev 4: 2 -> 1
   817   test-debug-phase: move rev 7: 2 -> 1
   817   test-debug-phase: move rev 7: 2 -> 1
   818   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:  2 -> 1
   818   test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e:  secret -> draft
   819   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  2 -> 1
   819   test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde:  secret -> draft
   820   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:  2 -> 1
   820   test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af:  secret -> draft
   821   $ hg phase --public 17a481b3bccb
   821   $ hg phase --public 17a481b3bccb
   822   transaction abort!
   822   transaction abort!
   823   rollback completed
   823   rollback completed
   824   abort: pretxnclose-phase.nopublish_D hook exited with status 1
   824   abort: pretxnclose-phase.nopublish_D hook exited with status 1
   825   [255]
   825   [255]