tests/test-bundle-phases.t
author Jun Wu <quark@fb.com>
Sat, 08 Jul 2017 16:50:31 -0700
changeset 33349 28f75a1695fb
parent 33032 8e3021fd1a44
child 33408 e3867c712d51
permissions -rw-r--r--
histedit: pass multiple nodes to strip (BC) Previously, histedit.cleanupnode pass root nodes one by one. Since repair.strip takes multiple nodes and can handle them just fine, pass all strip roots at once. This is BC because the number of strip backup files may change from N to 1.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33031
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     2
  > [experimental]
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     3
  > bundle-phases=yes
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     4
  > [extensions]
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     5
  > strip=
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     6
  > drawdag=$TESTDIR/drawdag.py
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     7
  > EOF
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     8
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
     9
Set up repo with linear history
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    10
  $ hg init linear
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    11
  $ cd linear
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    12
  $ hg debugdrawdag <<'EOF'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    13
  > E
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    14
  > |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    15
  > D
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    16
  > |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    17
  > C
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    18
  > |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    19
  > B
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    20
  > |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    21
  > A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    22
  > EOF
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    23
  $ hg phase --public A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    24
  $ hg phase --force --secret D
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    25
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    26
  o  E secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    27
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    28
  o  D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    29
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    30
  o  C draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    31
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    32
  o  B draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    33
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    34
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    35
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    36
Phases are restored when unbundling
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    37
  $ hg bundle --base B -r E bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    38
  3 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    39
  $ hg debugbundle bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    40
  Stream params: sortdict([('Compression', 'BZ')])
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    41
  changegroup -- "sortdict([('version', '02'), ('nbchanges', '3')])"
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    42
      26805aba1e600a82e93661149f2313866a221a7b
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    43
      f585351a92f85104bff7c284233c338b10eb1df7
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    44
      9bc730a19041f9ec7cb33c626e811aa233efb18c
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    45
  phase-heads -- 'sortdict()'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    46
      26805aba1e600a82e93661149f2313866a221a7b draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    47
  $ hg strip --no-backup C
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    48
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    49
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    50
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    51
  o  E secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    52
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    53
  o  D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    54
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    55
  o  C draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    56
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    57
  o  B draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    58
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    59
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    60
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    61
Root revision's phase is preserved
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    62
  $ hg bundle -a bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    63
  5 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    64
  $ hg strip --no-backup A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    65
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    66
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    67
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    68
  o  E secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    69
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    70
  o  D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    71
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    72
  o  C draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    73
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    74
  o  B draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    75
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    76
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    77
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    78
Completely public history can be restored
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    79
  $ hg phase --public E
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    80
  $ hg bundle -a bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    81
  5 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    82
  $ hg strip --no-backup A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    83
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    84
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    85
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    86
  o  E public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    87
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    88
  o  D public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    89
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    90
  o  C public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    91
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    92
  o  B public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    93
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    94
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    95
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    96
Direct transition from public to secret can be restored
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    97
  $ hg phase --secret --force D
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    98
  $ hg bundle -a bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    99
  5 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   100
  $ hg strip --no-backup A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   101
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   102
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   103
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   104
  o  E secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   105
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   106
  o  D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   107
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   108
  o  C public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   109
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   110
  o  B public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   111
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   112
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   113
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   114
Revisions within bundle preserve their phase even if parent changes its phase
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   115
  $ hg phase --draft --force B
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   116
  $ hg bundle --base B -r E bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   117
  3 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   118
  $ hg strip --no-backup C
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   119
  $ hg phase --public B
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   120
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   121
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   122
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   123
  o  E secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   124
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   125
  o  D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   126
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   127
  o  C draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   128
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   129
  o  B public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   130
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   131
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   132
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   133
Phase of ancestors of stripped node get advanced to accommodate child
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   134
  $ hg bundle --base B -r E bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   135
  3 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   136
  $ hg strip --no-backup C
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   137
  $ hg phase --force --secret B
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   138
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   139
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   140
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   141
  o  E secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   142
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   143
  o  D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   144
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   145
  o  C draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   146
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   147
  o  B draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   148
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   149
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   150
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   151
Unbundling advances phases of changesets even if they were already in the repo.
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   152
To test that, create a bundle of everything in draft phase and then unbundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   153
to see that secret becomes draft, but public remains public.
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   154
  $ hg phase --draft --force A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   155
  $ hg phase --draft E
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   156
  $ hg bundle -a bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   157
  5 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   158
  $ hg phase --public A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   159
  $ hg phase --secret --force E
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   160
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   161
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   162
  $ hg log -G -T '{desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   163
  o  E draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   164
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   165
  o  D draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   166
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   167
  o  C draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   168
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   169
  o  B draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   170
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   171
  o  A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   172
  
33032
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   173
Unbundling change in the middle of a stack does not affect later changes
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   174
  $ hg strip --no-backup E
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   175
  $ hg phase --secret --force D
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   176
  $ hg log -G -T '{desc} {phase}\n'
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   177
  o  D secret
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   178
  |
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   179
  o  C draft
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   180
  |
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   181
  o  B draft
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   182
  |
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   183
  o  A public
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   184
  
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   185
  $ hg bundle --base A -r B bundle
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   186
  1 changesets found
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   187
  $ hg unbundle -q bundle
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   188
  $ rm bundle
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   189
  $ hg log -G -T '{desc} {phase}\n'
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   190
  o  D secret
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   191
  |
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   192
  o  C draft
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   193
  |
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   194
  o  B draft
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   195
  |
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   196
  o  A public
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   197
  
8e3021fd1a44 strip: include phases in bundle (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents: 33031
diff changeset
   198
33031
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   199
  $ cd ..
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   200
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   201
Set up repo with non-linear history
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   202
  $ hg init non-linear
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   203
  $ cd non-linear
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   204
  $ hg debugdrawdag <<'EOF'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   205
  > D E
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   206
  > |\|
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   207
  > B C
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   208
  > |/
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   209
  > A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   210
  > EOF
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   211
  $ hg phase --public C
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   212
  $ hg phase --force --secret B
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   213
  $ hg log -G -T '{node|short} {desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   214
  o  03ca77807e91 E draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   215
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   216
  | o  215e7b0814e1 D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   217
  |/|
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   218
  o |  dc0947a82db8 C public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   219
  | |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   220
  | o  112478962961 B secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   221
  |/
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   222
  o  426bada5c675 A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   223
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   224
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   225
Restore bundle of entire repo
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   226
  $ hg bundle -a bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   227
  5 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   228
  $ hg debugbundle bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   229
  Stream params: sortdict([('Compression', 'BZ')])
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   230
  changegroup -- "sortdict([('version', '02'), ('nbchanges', '5')])"
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   231
      426bada5c67598ca65036d57d9e4b64b0c1ce7a0
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   232
      112478962961147124edd43549aedd1a335e44bf
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   233
      dc0947a82db884575bb76ea10ac97b08536bfa03
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   234
      215e7b0814e1cac8e2614e7284f2a5dc266b4323
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   235
      03ca77807e919db8807c3749086dc36fb478cac0
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   236
  phase-heads -- 'sortdict()'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   237
      dc0947a82db884575bb76ea10ac97b08536bfa03 public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   238
      03ca77807e919db8807c3749086dc36fb478cac0 draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   239
  $ hg strip --no-backup A
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   240
  $ hg unbundle -q bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   241
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   242
  $ hg log -G -T '{node|short} {desc} {phase}\n'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   243
  o  03ca77807e91 E draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   244
  |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   245
  | o  215e7b0814e1 D secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   246
  |/|
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   247
  o |  dc0947a82db8 C public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   248
  | |
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   249
  | o  112478962961 B secret
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   250
  |/
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   251
  o  426bada5c675 A public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   252
  
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   253
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   254
  $ hg bundle --base 'A + C' -r D bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   255
  2 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   256
  $ hg debugbundle bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   257
  Stream params: sortdict([('Compression', 'BZ')])
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   258
  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   259
      112478962961147124edd43549aedd1a335e44bf
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   260
      215e7b0814e1cac8e2614e7284f2a5dc266b4323
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   261
  phase-heads -- 'sortdict()'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   262
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   263
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   264
  $ hg bundle --base A -r D bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   265
  3 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   266
  $ hg debugbundle bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   267
  Stream params: sortdict([('Compression', 'BZ')])
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   268
  changegroup -- "sortdict([('version', '02'), ('nbchanges', '3')])"
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   269
      112478962961147124edd43549aedd1a335e44bf
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   270
      dc0947a82db884575bb76ea10ac97b08536bfa03
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   271
      215e7b0814e1cac8e2614e7284f2a5dc266b4323
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   272
  phase-heads -- 'sortdict()'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   273
      dc0947a82db884575bb76ea10ac97b08536bfa03 public
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   274
  $ rm bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   275
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   276
  $ hg bundle --base 'B + C' -r 'D + E' bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   277
  2 changesets found
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   278
  $ hg debugbundle bundle
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   279
  Stream params: sortdict([('Compression', 'BZ')])
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   280
  changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])"
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   281
      215e7b0814e1cac8e2614e7284f2a5dc266b4323
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   282
      03ca77807e919db8807c3749086dc36fb478cac0
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   283
  phase-heads -- 'sortdict()'
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   284
      03ca77807e919db8807c3749086dc36fb478cac0 draft
e8c8d81eb864 bundle: add config option to include phases
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
   285
  $ rm bundle