| 1 |
$ cat > $TESTTMP/hook.sh << 'EOF' |
| 2 |
> echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" |
| 3 |
> EOF |
| 4 |
|
| 5 |
$ cat >> $HGRCPATH << EOF |
| 6 |
> [extensions] |
| 7 |
> phasereport=$TESTDIR/testlib/ext-phase-report.py |
| 8 |
> [hooks] |
| 9 |
> txnclose-phase.test = sh $TESTTMP/hook.sh |
| 10 |
> EOF |
| 11 |
|
| 12 |
$ hglog() { hg log -G --template "{rev} {phaseidx} {desc}\n" $*; } |
| 13 |
$ mkcommit() { |
| 14 |
> echo "$1" > "$1" |
| 15 |
> hg add "$1" |
| 16 |
> message="$1" |
| 17 |
> shift |
| 18 |
> hg ci -m "$message" $* |
| 19 |
> } |
| 20 |
|
| 21 |
$ hg init initialrepo |
| 22 |
$ cd initialrepo |
| 23 |
|
| 24 |
Cannot change null revision phase |
| 25 |
|
| 26 |
$ hg phase --force --secret null |
| 27 |
abort: cannot change null revision phase |
| 28 |
[255] |
| 29 |
$ hg phase null |
| 30 |
-1: public |
| 31 |
|
| 32 |
$ mkcommit A |
| 33 |
test-debug-phase: new rev 0: x -> 1 |
| 34 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
| 35 |
|
| 36 |
New commit are draft by default |
| 37 |
|
| 38 |
$ hglog |
| 39 |
@ 0 1 A |
| 40 |
|
| 41 |
|
| 42 |
Following commit are draft too |
| 43 |
|
| 44 |
$ mkcommit B |
| 45 |
test-debug-phase: new rev 1: x -> 1 |
| 46 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft |
| 47 |
|
| 48 |
$ hglog |
| 49 |
@ 1 1 B |
| 50 |
| |
| 51 |
o 0 1 A |
| 52 |
|
| 53 |
|
| 54 |
Working directory phase is secret when its parent is secret. |
| 55 |
|
| 56 |
$ hg phase --force --secret . |
| 57 |
test-debug-phase: move rev 1: 1 -> 2 |
| 58 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> secret |
| 59 |
$ hg log -r 'wdir()' -T '{phase}\n' |
| 60 |
secret |
| 61 |
$ hg log -r 'wdir() and public()' -T '{phase}\n' |
| 62 |
$ hg log -r 'wdir() and draft()' -T '{phase}\n' |
| 63 |
$ hg log -r 'wdir() and secret()' -T '{phase}\n' |
| 64 |
secret |
| 65 |
|
| 66 |
Working directory phase is draft when its parent is draft. |
| 67 |
|
| 68 |
$ hg phase --draft . |
| 69 |
test-debug-phase: move rev 1: 2 -> 1 |
| 70 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: secret -> draft |
| 71 |
$ hg log -r 'wdir()' -T '{phase}\n' |
| 72 |
draft |
| 73 |
$ hg log -r 'wdir() and public()' -T '{phase}\n' |
| 74 |
$ hg log -r 'wdir() and draft()' -T '{phase}\n' |
| 75 |
draft |
| 76 |
$ hg log -r 'wdir() and secret()' -T '{phase}\n' |
| 77 |
|
| 78 |
Working directory phase is secret when a new commit will be created as secret, |
| 79 |
even if the parent is draft. |
| 80 |
|
| 81 |
$ hg log -r 'wdir() and secret()' -T '{phase}\n' \ |
| 82 |
> --config phases.new-commit='secret' |
| 83 |
secret |
| 84 |
|
| 85 |
Working directory phase is draft when its parent is public. |
| 86 |
|
| 87 |
$ hg phase --public . |
| 88 |
test-debug-phase: move rev 0: 1 -> 0 |
| 89 |
test-debug-phase: move rev 1: 1 -> 0 |
| 90 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public |
| 91 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public |
| 92 |
$ hg log -r 'wdir()' -T '{phase}\n' |
| 93 |
draft |
| 94 |
$ hg log -r 'wdir() and public()' -T '{phase}\n' |
| 95 |
$ hg log -r 'wdir() and draft()' -T '{phase}\n' |
| 96 |
draft |
| 97 |
$ hg log -r 'wdir() and secret()' -T '{phase}\n' |
| 98 |
$ hg log -r 'wdir() and secret()' -T '{phase}\n' \ |
| 99 |
> --config phases.new-commit='secret' |
| 100 |
secret |
| 101 |
|
| 102 |
Draft commit are properly created over public one: |
| 103 |
|
| 104 |
$ hg phase |
| 105 |
1: public |
| 106 |
$ hglog |
| 107 |
@ 1 0 B |
| 108 |
| |
| 109 |
o 0 0 A |
| 110 |
|
| 111 |
|
| 112 |
$ mkcommit C |
| 113 |
test-debug-phase: new rev 2: x -> 1 |
| 114 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft |
| 115 |
$ mkcommit D |
| 116 |
test-debug-phase: new rev 3: x -> 1 |
| 117 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft |
| 118 |
|
| 119 |
$ hglog |
| 120 |
@ 3 1 D |
| 121 |
| |
| 122 |
o 2 1 C |
| 123 |
| |
| 124 |
o 1 0 B |
| 125 |
| |
| 126 |
o 0 0 A |
| 127 |
|
| 128 |
|
| 129 |
Test creating changeset as secret |
| 130 |
|
| 131 |
$ mkcommit E --config phases.new-commit='secret' |
| 132 |
test-debug-phase: new rev 4: x -> 2 |
| 133 |
test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret |
| 134 |
$ hglog |
| 135 |
@ 4 2 E |
| 136 |
| |
| 137 |
o 3 1 D |
| 138 |
| |
| 139 |
o 2 1 C |
| 140 |
| |
| 141 |
o 1 0 B |
| 142 |
| |
| 143 |
o 0 0 A |
| 144 |
|
| 145 |
|
| 146 |
Test the secret property is inherited |
| 147 |
|
| 148 |
$ mkcommit H |
| 149 |
test-debug-phase: new rev 5: x -> 2 |
| 150 |
test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret |
| 151 |
$ hglog |
| 152 |
@ 5 2 H |
| 153 |
| |
| 154 |
o 4 2 E |
| 155 |
| |
| 156 |
o 3 1 D |
| 157 |
| |
| 158 |
o 2 1 C |
| 159 |
| |
| 160 |
o 1 0 B |
| 161 |
| |
| 162 |
o 0 0 A |
| 163 |
|
| 164 |
|
| 165 |
Even on merge |
| 166 |
|
| 167 |
$ hg up -q 1 |
| 168 |
$ mkcommit "B'" |
| 169 |
test-debug-phase: new rev 6: x -> 1 |
| 170 |
created new head |
| 171 |
test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft |
| 172 |
$ hglog |
| 173 |
@ 6 1 B' |
| 174 |
| |
| 175 |
| o 5 2 H |
| 176 |
| | |
| 177 |
| o 4 2 E |
| 178 |
| | |
| 179 |
| o 3 1 D |
| 180 |
| | |
| 181 |
| o 2 1 C |
| 182 |
|/ |
| 183 |
o 1 0 B |
| 184 |
| |
| 185 |
o 0 0 A |
| 186 |
|
| 187 |
$ hg merge 4 # E |
| 188 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 189 |
(branch merge, don't forget to commit) |
| 190 |
$ hg phase |
| 191 |
6: draft |
| 192 |
4: secret |
| 193 |
$ hg ci -m "merge B' and E" |
| 194 |
test-debug-phase: new rev 7: x -> 2 |
| 195 |
test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret |
| 196 |
|
| 197 |
$ hglog |
| 198 |
@ 7 2 merge B' and E |
| 199 |
|\ |
| 200 |
| o 6 1 B' |
| 201 |
| | |
| 202 |
+---o 5 2 H |
| 203 |
| | |
| 204 |
o | 4 2 E |
| 205 |
| | |
| 206 |
o | 3 1 D |
| 207 |
| | |
| 208 |
o | 2 1 C |
| 209 |
|/ |
| 210 |
o 1 0 B |
| 211 |
| |
| 212 |
o 0 0 A |
| 213 |
|
| 214 |
|
| 215 |
Test secret changeset are not pushed |
| 216 |
|
| 217 |
$ hg init ../push-dest |
| 218 |
$ cat > ../push-dest/.hg/hgrc << EOF |
| 219 |
> [phases] |
| 220 |
> publish=False |
| 221 |
> EOF |
| 222 |
$ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n' |
| 223 |
comparing with ../push-dest |
| 224 |
searching for changes |
| 225 |
0 public A |
| 226 |
1 public B |
| 227 |
2 draft C |
| 228 |
3 draft D |
| 229 |
6 draft B' |
| 230 |
$ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n' |
| 231 |
comparing with ../push-dest |
| 232 |
searching for changes |
| 233 |
0 public A |
| 234 |
1 public B |
| 235 |
2 draft C |
| 236 |
3 draft D |
| 237 |
6 draft B' |
| 238 |
|
| 239 |
$ hg push ../push-dest -f # force because we push multiple heads |
| 240 |
pushing to ../push-dest |
| 241 |
searching for changes |
| 242 |
adding changesets |
| 243 |
adding manifests |
| 244 |
adding file changes |
| 245 |
added 5 changesets with 5 changes to 5 files (+1 heads) |
| 246 |
test-debug-phase: new rev 0: x -> 0 |
| 247 |
test-debug-phase: new rev 1: x -> 0 |
| 248 |
test-debug-phase: new rev 2: x -> 1 |
| 249 |
test-debug-phase: new rev 3: x -> 1 |
| 250 |
test-debug-phase: new rev 4: x -> 1 |
| 251 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
| 252 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
| 253 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft |
| 254 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft |
| 255 |
test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft |
| 256 |
$ hglog |
| 257 |
@ 7 2 merge B' and E |
| 258 |
|\ |
| 259 |
| o 6 1 B' |
| 260 |
| | |
| 261 |
+---o 5 2 H |
| 262 |
| | |
| 263 |
o | 4 2 E |
| 264 |
| | |
| 265 |
o | 3 1 D |
| 266 |
| | |
| 267 |
o | 2 1 C |
| 268 |
|/ |
| 269 |
o 1 0 B |
| 270 |
| |
| 271 |
o 0 0 A |
| 272 |
|
| 273 |
$ cd ../push-dest |
| 274 |
$ hglog |
| 275 |
o 4 1 B' |
| 276 |
| |
| 277 |
| o 3 1 D |
| 278 |
| | |
| 279 |
| o 2 1 C |
| 280 |
|/ |
| 281 |
o 1 0 B |
| 282 |
| |
| 283 |
o 0 0 A |
| 284 |
|
| 285 |
|
| 286 |
(Issue3303) |
| 287 |
Check that remote secret changeset are ignore when checking creation of remote heads |
| 288 |
|
| 289 |
We add a secret head into the push destination. This secret head shadows a |
| 290 |
visible shared between the initial repo and the push destination. |
| 291 |
|
| 292 |
$ hg up -q 4 # B' |
| 293 |
$ mkcommit Z --config phases.new-commit=secret |
| 294 |
test-debug-phase: new rev 5: x -> 2 |
| 295 |
test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret |
| 296 |
$ hg phase . |
| 297 |
5: secret |
| 298 |
|
| 299 |
We now try to push a new public changeset that descend from the common public |
| 300 |
head shadowed by the remote secret head. |
| 301 |
|
| 302 |
$ cd ../initialrepo |
| 303 |
$ hg up -q 6 #B' |
| 304 |
$ mkcommit I |
| 305 |
test-debug-phase: new rev 8: x -> 1 |
| 306 |
created new head |
| 307 |
test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft |
| 308 |
$ hg push ../push-dest |
| 309 |
pushing to ../push-dest |
| 310 |
searching for changes |
| 311 |
adding changesets |
| 312 |
adding manifests |
| 313 |
adding file changes |
| 314 |
added 1 changesets with 1 changes to 1 files (+1 heads) |
| 315 |
test-debug-phase: new rev 6: x -> 1 |
| 316 |
test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft |
| 317 |
|
| 318 |
:note: The "(+1 heads)" is wrong as we do not had any visible head |
| 319 |
|
| 320 |
check that branch cache with "served" filter are properly computed and stored |
| 321 |
|
| 322 |
$ ls ../push-dest/.hg/cache/branch2* |
| 323 |
../push-dest/.hg/cache/branch2-base |
| 324 |
../push-dest/.hg/cache/branch2-served |
| 325 |
$ cat ../push-dest/.hg/cache/branch2-served |
| 326 |
6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 |
| 327 |
b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
| 328 |
6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
| 329 |
$ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too |
| 330 |
6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft |
| 331 |
5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret |
| 332 |
3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft |
| 333 |
$ ls ../push-dest/.hg/cache/branch2* |
| 334 |
../push-dest/.hg/cache/branch2-base |
| 335 |
../push-dest/.hg/cache/branch2-served |
| 336 |
../push-dest/.hg/cache/branch2-visible |
| 337 |
$ cat ../push-dest/.hg/cache/branch2-served |
| 338 |
6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 |
| 339 |
b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
| 340 |
6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
| 341 |
$ cat ../push-dest/.hg/cache/branch2-visible |
| 342 |
6d6770faffce199f1fddd1cf87f6f026138cf061 6 |
| 343 |
b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
| 344 |
2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default |
| 345 |
6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
| 346 |
|
| 347 |
|
| 348 |
Restore condition prior extra insertion. |
| 349 |
$ hg -q --config extensions.mq= strip . |
| 350 |
$ hg up -q 7 |
| 351 |
$ cd .. |
| 352 |
|
| 353 |
Test secret changeset are not pull |
| 354 |
|
| 355 |
$ hg init pull-dest |
| 356 |
$ cd pull-dest |
| 357 |
$ hg pull ../initialrepo |
| 358 |
pulling from ../initialrepo |
| 359 |
requesting all changes |
| 360 |
adding changesets |
| 361 |
adding manifests |
| 362 |
adding file changes |
| 363 |
added 5 changesets with 5 changes to 5 files (+1 heads) |
| 364 |
new changesets 4a2df7238c3b:cf9fe039dfd6 |
| 365 |
test-debug-phase: new rev 0: x -> 0 |
| 366 |
test-debug-phase: new rev 1: x -> 0 |
| 367 |
test-debug-phase: new rev 2: x -> 0 |
| 368 |
test-debug-phase: new rev 3: x -> 0 |
| 369 |
test-debug-phase: new rev 4: x -> 0 |
| 370 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
| 371 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
| 372 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
| 373 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
| 374 |
test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
| 375 |
(run 'hg heads' to see heads, 'hg merge' to merge) |
| 376 |
$ hglog |
| 377 |
o 4 0 B' |
| 378 |
| |
| 379 |
| o 3 0 D |
| 380 |
| | |
| 381 |
| o 2 0 C |
| 382 |
|/ |
| 383 |
o 1 0 B |
| 384 |
| |
| 385 |
o 0 0 A |
| 386 |
|
| 387 |
$ cd .. |
| 388 |
|
| 389 |
But secret can still be bundled explicitly |
| 390 |
|
| 391 |
$ cd initialrepo |
| 392 |
$ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg |
| 393 |
4 changesets found |
| 394 |
$ cd .. |
| 395 |
|
| 396 |
Test secret changeset are not cloned |
| 397 |
(during local clone) |
| 398 |
|
| 399 |
$ hg clone -qU initialrepo clone-dest |
| 400 |
test-debug-phase: new rev 0: x -> 0 |
| 401 |
test-debug-phase: new rev 1: x -> 0 |
| 402 |
test-debug-phase: new rev 2: x -> 0 |
| 403 |
test-debug-phase: new rev 3: x -> 0 |
| 404 |
test-debug-phase: new rev 4: x -> 0 |
| 405 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
| 406 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
| 407 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
| 408 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
| 409 |
test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
| 410 |
$ hglog -R clone-dest |
| 411 |
o 4 0 B' |
| 412 |
| |
| 413 |
| o 3 0 D |
| 414 |
| | |
| 415 |
| o 2 0 C |
| 416 |
|/ |
| 417 |
o 1 0 B |
| 418 |
| |
| 419 |
o 0 0 A |
| 420 |
|
| 421 |
|
| 422 |
Test summary |
| 423 |
|
| 424 |
$ hg summary -R clone-dest --verbose |
| 425 |
parent: -1:000000000000 (no revision checked out) |
| 426 |
branch: default |
| 427 |
commit: (clean) |
| 428 |
update: 5 new changesets (update) |
| 429 |
$ hg summary -R initialrepo |
| 430 |
parent: 7:17a481b3bccb tip |
| 431 |
merge B' and E |
| 432 |
branch: default |
| 433 |
commit: (clean) (secret) |
| 434 |
update: 1 new changesets, 2 branch heads (merge) |
| 435 |
phases: 3 draft, 3 secret |
| 436 |
$ hg summary -R initialrepo --quiet |
| 437 |
parent: 7:17a481b3bccb tip |
| 438 |
update: 1 new changesets, 2 branch heads (merge) |
| 439 |
|
| 440 |
Test revset |
| 441 |
|
| 442 |
$ cd initialrepo |
| 443 |
$ hglog -r 'public()' |
| 444 |
o 1 0 B |
| 445 |
| |
| 446 |
o 0 0 A |
| 447 |
|
| 448 |
$ hglog -r 'draft()' |
| 449 |
o 6 1 B' |
| 450 |
| |
| 451 |
~ |
| 452 |
o 3 1 D |
| 453 |
| |
| 454 |
o 2 1 C |
| 455 |
| |
| 456 |
~ |
| 457 |
$ hglog -r 'secret()' |
| 458 |
@ 7 2 merge B' and E |
| 459 |
|\ |
| 460 |
| ~ |
| 461 |
| o 5 2 H |
| 462 |
|/ |
| 463 |
o 4 2 E |
| 464 |
| |
| 465 |
~ |
| 466 |
|
| 467 |
test that phase are displayed in log at debug level |
| 468 |
|
| 469 |
$ hg log --debug |
| 470 |
changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af |
| 471 |
tag: tip |
| 472 |
phase: secret |
| 473 |
parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 |
| 474 |
parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
| 475 |
manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8 |
| 476 |
user: test |
| 477 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 478 |
extra: branch=default |
| 479 |
description: |
| 480 |
merge B' and E |
| 481 |
|
| 482 |
|
| 483 |
changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 |
| 484 |
phase: draft |
| 485 |
parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
| 486 |
parent: -1:0000000000000000000000000000000000000000 |
| 487 |
manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a |
| 488 |
user: test |
| 489 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 490 |
files+: B' |
| 491 |
extra: branch=default |
| 492 |
description: |
| 493 |
B' |
| 494 |
|
| 495 |
|
| 496 |
changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8 |
| 497 |
phase: secret |
| 498 |
parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
| 499 |
parent: -1:0000000000000000000000000000000000000000 |
| 500 |
manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a |
| 501 |
user: test |
| 502 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 503 |
files+: H |
| 504 |
extra: branch=default |
| 505 |
description: |
| 506 |
H |
| 507 |
|
| 508 |
|
| 509 |
changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
| 510 |
phase: secret |
| 511 |
parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e |
| 512 |
parent: -1:0000000000000000000000000000000000000000 |
| 513 |
manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc |
| 514 |
user: test |
| 515 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 516 |
files+: E |
| 517 |
extra: branch=default |
| 518 |
description: |
| 519 |
E |
| 520 |
|
| 521 |
|
| 522 |
changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e |
| 523 |
phase: draft |
| 524 |
parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 |
| 525 |
parent: -1:0000000000000000000000000000000000000000 |
| 526 |
manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c |
| 527 |
user: test |
| 528 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 529 |
files+: D |
| 530 |
extra: branch=default |
| 531 |
description: |
| 532 |
D |
| 533 |
|
| 534 |
|
| 535 |
changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 |
| 536 |
phase: draft |
| 537 |
parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
| 538 |
parent: -1:0000000000000000000000000000000000000000 |
| 539 |
manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4 |
| 540 |
user: test |
| 541 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 542 |
files+: C |
| 543 |
extra: branch=default |
| 544 |
description: |
| 545 |
C |
| 546 |
|
| 547 |
|
| 548 |
changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
| 549 |
phase: public |
| 550 |
parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 |
| 551 |
parent: -1:0000000000000000000000000000000000000000 |
| 552 |
manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd |
| 553 |
user: test |
| 554 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 555 |
files+: B |
| 556 |
extra: branch=default |
| 557 |
description: |
| 558 |
B |
| 559 |
|
| 560 |
|
| 561 |
changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 |
| 562 |
phase: public |
| 563 |
parent: -1:0000000000000000000000000000000000000000 |
| 564 |
parent: -1:0000000000000000000000000000000000000000 |
| 565 |
manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83 |
| 566 |
user: test |
| 567 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 568 |
files+: A |
| 569 |
extra: branch=default |
| 570 |
description: |
| 571 |
A |
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
|
| 576 |
(Issue3707) |
| 577 |
test invalid phase name |
| 578 |
|
| 579 |
$ mkcommit I --config phases.new-commit='babar' |
| 580 |
transaction abort! |
| 581 |
rollback completed |
| 582 |
config error: phases.new-commit: not a valid phase name ('babar') |
| 583 |
[30] |
| 584 |
Test phase command |
| 585 |
=================== |
| 586 |
|
| 587 |
initial picture |
| 588 |
|
| 589 |
$ hg log -G --template "{rev} {phase} {desc}\n" |
| 590 |
@ 7 secret merge B' and E |
| 591 |
|\ |
| 592 |
| o 6 draft B' |
| 593 |
| | |
| 594 |
+---o 5 secret H |
| 595 |
| | |
| 596 |
o | 4 secret E |
| 597 |
| | |
| 598 |
o | 3 draft D |
| 599 |
| | |
| 600 |
o | 2 draft C |
| 601 |
|/ |
| 602 |
o 1 public B |
| 603 |
| |
| 604 |
o 0 public A |
| 605 |
|
| 606 |
|
| 607 |
display changesets phase |
| 608 |
|
| 609 |
(mixing -r and plain rev specification) |
| 610 |
|
| 611 |
$ hg phase 1::4 -r 7 |
| 612 |
1: public |
| 613 |
2: draft |
| 614 |
3: draft |
| 615 |
4: secret |
| 616 |
7: secret |
| 617 |
|
| 618 |
|
| 619 |
move changeset forward |
| 620 |
|
| 621 |
(with -r option) |
| 622 |
|
| 623 |
$ hg phase --public -r 2 |
| 624 |
test-debug-phase: move rev 2: 1 -> 0 |
| 625 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public |
| 626 |
$ hg log -G --template "{rev} {phase} {desc}\n" |
| 627 |
@ 7 secret merge B' and E |
| 628 |
|\ |
| 629 |
| o 6 draft B' |
| 630 |
| | |
| 631 |
+---o 5 secret H |
| 632 |
| | |
| 633 |
o | 4 secret E |
| 634 |
| | |
| 635 |
o | 3 draft D |
| 636 |
| | |
| 637 |
o | 2 public C |
| 638 |
|/ |
| 639 |
o 1 public B |
| 640 |
| |
| 641 |
o 0 public A |
| 642 |
|
| 643 |
|
| 644 |
move changeset backward |
| 645 |
|
| 646 |
(without -r option) |
| 647 |
|
| 648 |
$ hg phase --draft --force 2 |
| 649 |
test-debug-phase: move rev 2: 0 -> 1 |
| 650 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft |
| 651 |
$ hg log -G --template "{rev} {phase} {desc}\n" |
| 652 |
@ 7 secret merge B' and E |
| 653 |
|\ |
| 654 |
| o 6 draft B' |
| 655 |
| | |
| 656 |
+---o 5 secret H |
| 657 |
| | |
| 658 |
o | 4 secret E |
| 659 |
| | |
| 660 |
o | 3 draft D |
| 661 |
| | |
| 662 |
o | 2 draft C |
| 663 |
|/ |
| 664 |
o 1 public B |
| 665 |
| |
| 666 |
o 0 public A |
| 667 |
|
| 668 |
|
| 669 |
move changeset forward and backward |
| 670 |
|
| 671 |
$ hg phase --draft --force 1::4 |
| 672 |
test-debug-phase: move rev 1: 0 -> 1 |
| 673 |
test-debug-phase: move rev 4: 2 -> 1 |
| 674 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft |
| 675 |
test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft |
| 676 |
$ hg log -G --template "{rev} {phase} {desc}\n" |
| 677 |
@ 7 secret merge B' and E |
| 678 |
|\ |
| 679 |
| o 6 draft B' |
| 680 |
| | |
| 681 |
+---o 5 secret H |
| 682 |
| | |
| 683 |
o | 4 draft E |
| 684 |
| | |
| 685 |
o | 3 draft D |
| 686 |
| | |
| 687 |
o | 2 draft C |
| 688 |
|/ |
| 689 |
o 1 draft B |
| 690 |
| |
| 691 |
o 0 public A |
| 692 |
|
| 693 |
test partial failure |
| 694 |
|
| 695 |
$ hg phase --public 7 |
| 696 |
test-debug-phase: move rev 1: 1 -> 0 |
| 697 |
test-debug-phase: move rev 2: 1 -> 0 |
| 698 |
test-debug-phase: move rev 3: 1 -> 0 |
| 699 |
test-debug-phase: move rev 4: 1 -> 0 |
| 700 |
test-debug-phase: move rev 6: 1 -> 0 |
| 701 |
test-debug-phase: move rev 7: 2 -> 0 |
| 702 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public |
| 703 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public |
| 704 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public |
| 705 |
test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public |
| 706 |
test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public |
| 707 |
test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public |
| 708 |
$ hg log -G --template "{rev} {phase} {desc}\n" |
| 709 |
@ 7 public merge B' and E |
| 710 |
|\ |
| 711 |
| o 6 public B' |
| 712 |
| | |
| 713 |
+---o 5 secret H |
| 714 |
| | |
| 715 |
o | 4 public E |
| 716 |
| | |
| 717 |
o | 3 public D |
| 718 |
| | |
| 719 |
o | 2 public C |
| 720 |
|/ |
| 721 |
o 1 public B |
| 722 |
| |
| 723 |
o 0 public A |
| 724 |
|
| 725 |
$ hg phase --draft '5 or 7' |
| 726 |
test-debug-phase: move rev 5: 2 -> 1 |
| 727 |
test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft |
| 728 |
cannot move 1 changesets to a higher phase, use --force |
| 729 |
phase changed for 1 changesets |
| 730 |
[1] |
| 731 |
$ hg log -G --template "{rev} {phase} {desc}\n" |
| 732 |
@ 7 public merge B' and E |
| 733 |
|\ |
| 734 |
| o 6 public B' |
| 735 |
| | |
| 736 |
+---o 5 draft H |
| 737 |
| | |
| 738 |
o | 4 public E |
| 739 |
| | |
| 740 |
o | 3 public D |
| 741 |
| | |
| 742 |
o | 2 public C |
| 743 |
|/ |
| 744 |
o 1 public B |
| 745 |
| |
| 746 |
o 0 public A |
| 747 |
|
| 748 |
|
| 749 |
test complete failure |
| 750 |
|
| 751 |
$ hg phase --draft 7 |
| 752 |
cannot move 1 changesets to a higher phase, use --force |
| 753 |
no phases changed |
| 754 |
[1] |
| 755 |
|
| 756 |
$ cd .. |
| 757 |
|
| 758 |
test hidden changeset are not cloned as public (issue3935) |
| 759 |
|
| 760 |
$ cd initialrepo |
| 761 |
|
| 762 |
(enabling evolution) |
| 763 |
$ cat >> $HGRCPATH << EOF |
| 764 |
> [experimental] |
| 765 |
> evolution.createmarkers=True |
| 766 |
> EOF |
| 767 |
|
| 768 |
(making a changeset hidden; H in that case) |
| 769 |
$ hg debugobsolete `hg id -T "{node}" -r 5` |
| 770 |
1 new obsolescence markers |
| 771 |
obsoleted 1 changesets |
| 772 |
|
| 773 |
$ cd .. |
| 774 |
$ hg clone initialrepo clonewithobs |
| 775 |
requesting all changes |
| 776 |
adding changesets |
| 777 |
adding manifests |
| 778 |
adding file changes |
| 779 |
added 7 changesets with 6 changes to 6 files |
| 780 |
new changesets 4a2df7238c3b:17a481b3bccb |
| 781 |
test-debug-phase: new rev 0: x -> 0 |
| 782 |
test-debug-phase: new rev 1: x -> 0 |
| 783 |
test-debug-phase: new rev 2: x -> 0 |
| 784 |
test-debug-phase: new rev 3: x -> 0 |
| 785 |
test-debug-phase: new rev 4: x -> 0 |
| 786 |
test-debug-phase: new rev 5: x -> 0 |
| 787 |
test-debug-phase: new rev 6: x -> 0 |
| 788 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
| 789 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
| 790 |
test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
| 791 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
| 792 |
test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public |
| 793 |
test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
| 794 |
test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public |
| 795 |
updating to branch default |
| 796 |
6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 797 |
$ cd clonewithobs |
| 798 |
$ hg log -G --template "{rev} {phase} {desc}\n" |
| 799 |
@ 6 public merge B' and E |
| 800 |
|\ |
| 801 |
| o 5 public B' |
| 802 |
| | |
| 803 |
o | 4 public E |
| 804 |
| | |
| 805 |
o | 3 public D |
| 806 |
| | |
| 807 |
o | 2 public C |
| 808 |
|/ |
| 809 |
o 1 public B |
| 810 |
| |
| 811 |
o 0 public A |
| 812 |
|
| 813 |
|
| 814 |
test verify repo containing hidden changesets, which should not abort just |
| 815 |
because repo.cancopy() is False |
| 816 |
|
| 817 |
$ cd ../initialrepo |
| 818 |
$ hg verify -q |
| 819 |
|
| 820 |
$ cd .. |
| 821 |
|
| 822 |
check whether HG_PENDING makes pending changes only in related |
| 823 |
repositories visible to an external hook. |
| 824 |
|
| 825 |
(emulate a transaction running concurrently by copied |
| 826 |
.hg/phaseroots.pending in subsequent test) |
| 827 |
|
| 828 |
$ cat > $TESTTMP/savepending.sh <<EOF |
| 829 |
> cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved |
| 830 |
> exit 1 # to avoid changing phase for subsequent tests |
| 831 |
> EOF |
| 832 |
$ cd push-dest |
| 833 |
$ hg phase 6 |
| 834 |
6: draft |
| 835 |
$ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6 |
| 836 |
abort: pretxnclose hook exited with status 1 |
| 837 |
[40] |
| 838 |
$ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending |
| 839 |
|
| 840 |
(check (in)visibility of phaseroot while transaction running in repo) |
| 841 |
|
| 842 |
$ cat > $TESTTMP/checkpending.sh <<EOF |
| 843 |
> echo '@initialrepo' |
| 844 |
> hg -R "$TESTTMP/initialrepo" phase 7 |
| 845 |
> echo '@push-dest' |
| 846 |
> hg -R "$TESTTMP/push-dest" phase 6 |
| 847 |
> exit 1 # to avoid changing phase for subsequent tests |
| 848 |
> EOF |
| 849 |
$ cd ../initialrepo |
| 850 |
$ hg phase 7 |
| 851 |
7: public |
| 852 |
$ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7 |
| 853 |
@initialrepo |
| 854 |
7: secret |
| 855 |
@push-dest |
| 856 |
6: draft |
| 857 |
abort: pretxnclose hook exited with status 1 |
| 858 |
[40] |
| 859 |
|
| 860 |
Check that pretxnclose-phase hook can control phase movement |
| 861 |
|
| 862 |
$ hg phase --force b3325c91a4d9 --secret |
| 863 |
test-debug-phase: move rev 3: 0 -> 2 |
| 864 |
test-debug-phase: move rev 4: 0 -> 2 |
| 865 |
test-debug-phase: move rev 5: 1 -> 2 |
| 866 |
test-debug-phase: move rev 7: 0 -> 2 |
| 867 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret |
| 868 |
test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret |
| 869 |
test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret |
| 870 |
test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret |
| 871 |
$ hg log -G -T phases |
| 872 |
@ changeset: 7:17a481b3bccb |
| 873 |
|\ tag: tip |
| 874 |
| | phase: secret |
| 875 |
| | parent: 6:cf9fe039dfd6 |
| 876 |
| | parent: 4:a603bfb5a83e |
| 877 |
| | user: test |
| 878 |
| | date: Thu Jan 01 00:00:00 1970 +0000 |
| 879 |
| | summary: merge B' and E |
| 880 |
| | |
| 881 |
| o changeset: 6:cf9fe039dfd6 |
| 882 |
| | phase: public |
| 883 |
| | parent: 1:27547f69f254 |
| 884 |
| | user: test |
| 885 |
| | date: Thu Jan 01 00:00:00 1970 +0000 |
| 886 |
| | summary: B' |
| 887 |
| | |
| 888 |
o | changeset: 4:a603bfb5a83e |
| 889 |
| | phase: secret |
| 890 |
| | user: test |
| 891 |
| | date: Thu Jan 01 00:00:00 1970 +0000 |
| 892 |
| | summary: E |
| 893 |
| | |
| 894 |
o | changeset: 3:b3325c91a4d9 |
| 895 |
| | phase: secret |
| 896 |
| | user: test |
| 897 |
| | date: Thu Jan 01 00:00:00 1970 +0000 |
| 898 |
| | summary: D |
| 899 |
| | |
| 900 |
o | changeset: 2:f838bfaca5c7 |
| 901 |
|/ phase: public |
| 902 |
| user: test |
| 903 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 904 |
| summary: C |
| 905 |
| |
| 906 |
o changeset: 1:27547f69f254 |
| 907 |
| phase: public |
| 908 |
| user: test |
| 909 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 910 |
| summary: B |
| 911 |
| |
| 912 |
o changeset: 0:4a2df7238c3b |
| 913 |
phase: public |
| 914 |
user: test |
| 915 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 916 |
summary: A |
| 917 |
|
| 918 |
|
| 919 |
Install a hook that prevent b3325c91a4d9 to become public |
| 920 |
|
| 921 |
$ cat >> .hg/hgrc << EOF |
| 922 |
> [hooks] |
| 923 |
> pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]" |
| 924 |
> EOF |
| 925 |
|
| 926 |
Try various actions. only the draft move should succeed |
| 927 |
|
| 928 |
$ hg phase --public b3325c91a4d9 |
| 929 |
abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
| 930 |
[40] |
| 931 |
$ hg phase --public a603bfb5a83e |
| 932 |
abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
| 933 |
[40] |
| 934 |
$ hg phase --draft 17a481b3bccb |
| 935 |
test-debug-phase: move rev 3: 2 -> 1 |
| 936 |
test-debug-phase: move rev 4: 2 -> 1 |
| 937 |
test-debug-phase: move rev 7: 2 -> 1 |
| 938 |
test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft |
| 939 |
test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft |
| 940 |
test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft |
| 941 |
$ hg phase --public 17a481b3bccb |
| 942 |
abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
| 943 |
[40] |
| 944 |
|
| 945 |
$ cd .. |
| 946 |
|
| 947 |
Test for the "internal" phase |
| 948 |
============================= |
| 949 |
|
| 950 |
Check we deny its usage on older repository |
| 951 |
|
| 952 |
$ hg init no-internal-phase --config format.use-internal-phase=no |
| 953 |
$ cd no-internal-phase |
| 954 |
$ hg debugrequires | grep internal-phase |
| 955 |
[1] |
| 956 |
$ echo X > X |
| 957 |
$ hg add X |
| 958 |
$ hg status |
| 959 |
A X |
| 960 |
$ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError |
| 961 |
** ProgrammingError: this repository does not support the internal phase |
| 962 |
raise error.ProgrammingError(msg) (no-pyoxidizer !) |
| 963 |
*ProgrammingError: this repository does not support the internal phase (glob) |
| 964 |
$ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError |
| 965 |
** ProgrammingError: this repository does not support the archived phase |
| 966 |
raise error.ProgrammingError(msg) (no-pyoxidizer !) |
| 967 |
*ProgrammingError: this repository does not support the archived phase (glob) |
| 968 |
|
| 969 |
$ cd .. |
| 970 |
|
| 971 |
Check it works fine with repository that supports it. |
| 972 |
|
| 973 |
$ hg init internal-phase --config format.use-internal-phase=yes |
| 974 |
$ cd internal-phase |
| 975 |
$ hg debugrequires | grep internal-phase |
| 976 |
internal-phase-2 |
| 977 |
$ mkcommit A |
| 978 |
test-debug-phase: new rev 0: x -> 1 |
| 979 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
| 980 |
|
| 981 |
Commit an internal changesets |
| 982 |
|
| 983 |
$ echo B > B |
| 984 |
$ hg add B |
| 985 |
$ hg status |
| 986 |
A B |
| 987 |
$ hg --config "phases.new-commit=internal" commit -m "my test internal commit" |
| 988 |
test-debug-phase: new rev 1: x -> 96 |
| 989 |
test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal |
| 990 |
|
| 991 |
The changeset is a working parent descendant. |
| 992 |
Per the usual visibility rules, it is made visible. |
| 993 |
|
| 994 |
$ hg log -G -l 3 |
| 995 |
@ changeset: 1:c01c42dffc7f |
| 996 |
| tag: tip |
| 997 |
| user: test |
| 998 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 999 |
| summary: my test internal commit |
| 1000 |
| |
| 1001 |
o changeset: 0:4a2df7238c3b |
| 1002 |
user: test |
| 1003 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 1004 |
summary: A |
| 1005 |
|
| 1006 |
|
| 1007 |
Commit is hidden as expected |
| 1008 |
|
| 1009 |
$ hg up 0 |
| 1010 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 1011 |
$ hg log -G |
| 1012 |
@ changeset: 0:4a2df7238c3b |
| 1013 |
tag: tip |
| 1014 |
user: test |
| 1015 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 1016 |
summary: A |
| 1017 |
|
| 1018 |
The hidden commit is an orphan but doesn't show up without --hidden |
| 1019 |
And internal changesets are not considered for unstability. |
| 1020 |
|
| 1021 |
$ hg debugobsolete `hg id -T "{node}" -r 0` |
| 1022 |
1 new obsolescence markers |
| 1023 |
obsoleted 1 changesets |
| 1024 |
$ hg --hidden log -G -r '(0::) - 0' |
| 1025 |
o changeset: 1:c01c42dffc7f |
| 1026 |
| tag: tip |
| 1027 |
~ user: test |
| 1028 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 1029 |
summary: my test internal commit |
| 1030 |
|
| 1031 |
$ hg --hidden log -G -r 'unstable()' |
| 1032 |
|
| 1033 |
$ hg log -G -r 'unstable()' |
| 1034 |
|
| 1035 |
|
| 1036 |
Test for archived phase |
| 1037 |
----------------------- |
| 1038 |
|
| 1039 |
Commit an archived changesets |
| 1040 |
|
| 1041 |
$ cd .. |
| 1042 |
$ hg clone --quiet --pull internal-phase archived-phase \ |
| 1043 |
> --config format.exp-archived-phase=yes \ |
| 1044 |
> --config extensions.phasereport='!' \ |
| 1045 |
> --config hooks.txnclose-phase.test= |
| 1046 |
|
| 1047 |
$ cd archived-phase |
| 1048 |
|
| 1049 |
$ echo B > B |
| 1050 |
$ hg add B |
| 1051 |
$ hg status |
| 1052 |
A B |
| 1053 |
$ hg --config "phases.new-commit=archived" commit -m "my test archived commit" |
| 1054 |
test-debug-phase: new rev 1: x -> 32 |
| 1055 |
test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived |
| 1056 |
|
| 1057 |
The changeset is a working parent descendant. |
| 1058 |
Per the usual visibility rules, it is made visible. |
| 1059 |
|
| 1060 |
$ hg log -G -l 3 |
| 1061 |
@ changeset: 1:8df5997c3361 |
| 1062 |
| tag: tip |
| 1063 |
| user: test |
| 1064 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 1065 |
| summary: my test archived commit |
| 1066 |
| |
| 1067 |
o changeset: 0:4a2df7238c3b |
| 1068 |
user: test |
| 1069 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 1070 |
summary: A |
| 1071 |
|
| 1072 |
|
| 1073 |
Commit is hidden as expected |
| 1074 |
|
| 1075 |
$ hg up 0 |
| 1076 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 1077 |
$ hg log -G |
| 1078 |
@ changeset: 0:4a2df7238c3b |
| 1079 |
tag: tip |
| 1080 |
user: test |
| 1081 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 1082 |
summary: A |
| 1083 |
|
| 1084 |
$ cd .. |
| 1085 |
|
| 1086 |
Recommitting an exact match of a public commit shouldn't change it to |
| 1087 |
draft: |
| 1088 |
|
| 1089 |
$ cd initialrepo |
| 1090 |
$ hg phase -r 2 |
| 1091 |
2: public |
| 1092 |
$ hg up -C 1 |
| 1093 |
0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
| 1094 |
$ mkcommit C |
| 1095 |
warning: commit already existed in the repository! |
| 1096 |
$ hg phase -r 2 |
| 1097 |
2: public |
| 1098 |
|
| 1099 |
Same, but for secret: |
| 1100 |
|
| 1101 |
$ hg up 7 |
| 1102 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 1103 |
$ mkcommit F -s |
| 1104 |
test-debug-phase: new rev 8: x -> 2 |
| 1105 |
test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret |
| 1106 |
$ hg up 7 |
| 1107 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 1108 |
$ hg phase |
| 1109 |
7: draft |
| 1110 |
$ mkcommit F |
| 1111 |
test-debug-phase: new rev 8: x -> 2 |
| 1112 |
warning: commit already existed in the repository! |
| 1113 |
test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret |
| 1114 |
$ hg phase -r tip |
| 1115 |
8: secret |
| 1116 |
|
| 1117 |
But what about obsoleted changesets? |
| 1118 |
|
| 1119 |
$ hg up 4 |
| 1120 |
0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
| 1121 |
$ mkcommit H |
| 1122 |
test-debug-phase: new rev 5: x -> 2 |
| 1123 |
warning: commit already existed in the repository! |
| 1124 |
test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret |
| 1125 |
$ hg phase -r 5 |
| 1126 |
5: secret |
| 1127 |
$ hg par |
| 1128 |
changeset: 5:a030c6be5127 |
| 1129 |
user: test |
| 1130 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 1131 |
obsolete: pruned |
| 1132 |
summary: H |
| 1133 |
|
| 1134 |
$ hg up tip |
| 1135 |
2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 1136 |
$ cd .. |
| 1137 |
|
| 1138 |
Testing that command line flags override configuration |
| 1139 |
|
| 1140 |
$ hg init commit-overrides |
| 1141 |
$ cd commit-overrides |
| 1142 |
|
| 1143 |
`hg commit --draft` overrides new-commit=secret |
| 1144 |
|
| 1145 |
$ mkcommit A --config phases.new-commit='secret' --draft |
| 1146 |
test-debug-phase: new rev 0: x -> 1 |
| 1147 |
test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
| 1148 |
$ hglog |
| 1149 |
@ 0 1 A |
| 1150 |
|
| 1151 |
|
| 1152 |
`hg commit --secret` overrides new-commit=draft |
| 1153 |
|
| 1154 |
$ mkcommit B --config phases.new-commit='draft' --secret |
| 1155 |
test-debug-phase: new rev 1: x -> 2 |
| 1156 |
test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> secret |
| 1157 |
$ hglog |
| 1158 |
@ 1 2 B |
| 1159 |
| |
| 1160 |
o 0 1 A |
| 1161 |
|
| 1162 |
|
| 1163 |
$ cd .. |