tests/test-single-head.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 01 Jun 2022 03:08:15 +0200
branchstable
changeset 49270 a31245a984f2
parent 47039 54589bb9604d
permissions -rw-r--r--
ci: drop the phabricator refresh step Now that phabricator is no longer in us, we should avoid this useless step to save time and simplify things.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     1
=====================
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     2
Test workflow options
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     3
=====================
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     4
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     5
  $ . "$TESTDIR/testlib/obsmarker-common.sh"
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     6
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     7
Test single head enforcing - Setup
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     8
=============================================
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     9
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    10
  $ cat << EOF >> $HGRCPATH
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    11
  > [experimental]
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    12
  > evolution = all
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    13
  > EOF
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    14
  $ hg init single-head-server
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    15
  $ cd single-head-server
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    16
  $ cat <<EOF >> .hg/hgrc
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    17
  > [phases]
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    18
  > publish = no
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    19
  > [experimental]
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    20
  > single-head-per-branch = yes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    21
  > EOF
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    22
  $ mkcommit ROOT
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    23
  $ mkcommit c_dA0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    24
  $ cd ..
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    25
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    26
  $ hg clone single-head-server client
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    27
  updating to branch default
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    28
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    29
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    30
Test single head enforcing - with branch only
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    31
---------------------------------------------
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    32
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    33
  $ cd client
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    34
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    35
continuing the current defaultbranch
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    36
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    37
  $ mkcommit c_dB0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    38
  $ hg push
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35185
diff changeset
    39
  pushing to $TESTTMP/single-head-server
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    40
  searching for changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    41
  adding changesets
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    42
  adding manifests
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    43
  adding file changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    44
  added 1 changesets with 1 changes to 1 files
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    45
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    46
creating a new branch
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    47
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    48
  $ hg up 'desc("ROOT")'
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    49
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    50
  $ hg branch branch_A
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    51
  marked working directory as branch branch_A
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    52
  (branches are permanent and global, did you want a bookmark?)
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    53
  $ mkcommit c_aC0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    54
  $ hg push --new-branch
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35185
diff changeset
    55
  pushing to $TESTTMP/single-head-server
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    56
  searching for changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    57
  adding changesets
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    58
  adding manifests
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    59
  adding file changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    60
  added 1 changesets with 1 changes to 1 files (+1 heads)
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    61
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    62
Create a new head on the default branch
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    63
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    64
  $ hg up 'desc("c_dA0")'
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    65
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    66
  $ mkcommit c_dD0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    67
  created new head
47039
54589bb9604d enforcesinglehead-test: add the expected node output next to the error
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46096
diff changeset
    68
  $ hg log -r 'heads(::branch("default"))' -T '{node|short}\n'
54589bb9604d enforcesinglehead-test: add the expected node output next to the error
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46096
diff changeset
    69
  286d02a6e2a2
54589bb9604d enforcesinglehead-test: add the expected node output next to the error
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46096
diff changeset
    70
  9bf953aa81f6
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    71
  $ hg push -f
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35185
diff changeset
    72
  pushing to $TESTTMP/single-head-server
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    73
  searching for changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    74
  adding changesets
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    75
  adding manifests
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    76
  adding file changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    77
  transaction abort!
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    78
  rollback completed
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    79
  abort: rejecting multiple heads on branch "default"
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    80
  (2 heads: 286d02a6e2a2 9bf953aa81f6)
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    81
  [255]
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    82
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    83
remerge them
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    84
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    85
  $ hg merge
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    86
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    87
  (branch merge, don't forget to commit)
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    88
  $ mkcommit c_dE0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    89
  $ hg push
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35185
diff changeset
    90
  pushing to $TESTTMP/single-head-server
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    91
  searching for changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    92
  adding changesets
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    93
  adding manifests
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    94
  adding file changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    95
  added 2 changesets with 2 changes to 2 files
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    96
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    97
Test single head enforcing - after rewrite
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    98
------------------------------------------
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    99
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   100
  $ mkcommit c_dF0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   101
  $ hg push
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35185
diff changeset
   102
  pushing to $TESTTMP/single-head-server
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   103
  searching for changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   104
  adding changesets
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   105
  adding manifests
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   106
  adding file changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   107
  added 1 changesets with 1 changes to 1 files
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   108
  $ hg commit --amend -m c_dF1
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   109
  $ hg push
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35185
diff changeset
   110
  pushing to $TESTTMP/single-head-server
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   111
  searching for changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   112
  adding changesets
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   113
  adding manifests
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   114
  adding file changes
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   115
  added 1 changesets with 0 changes to 1 files (+1 heads)
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   116
  1 new obsolescence markers
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   117
  obsoleted 1 changesets
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   118
42967
3609ea82b971 singlehead: fix a small typo in a test comment
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42897
diff changeset
   119
Check it does not interfer with strip
3609ea82b971 singlehead: fix a small typo in a test comment
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42897
diff changeset
   120
-------------------------------------
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   121
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   122
setup
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   123
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   124
  $ hg branch branch_A --force
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   125
  marked working directory as branch branch_A
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   126
  $ mkcommit c_aG0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   127
  created new head
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   128
  $ hg update 'desc("c_dF1")'
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   129
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   130
  $ mkcommit c_dH0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   131
  $ hg update 'desc("c_aG0")'
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   132
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   133
  $ hg merge
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   134
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   135
  (branch merge, don't forget to commit)
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   136
  $ mkcommit c_aI0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   137
  $ hg log -G
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   138
  @    changeset:   10:49003e504178
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   139
  |\   branch:      branch_A
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   140
  | |  tag:         tip
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   141
  | |  parent:      8:a33fb808fb4b
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   142
  | |  parent:      3:840af1c6bc88
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   143
  | |  user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   144
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   145
  | |  summary:     c_aI0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   146
  | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   147
  | | o  changeset:   9:fe47ea669cea
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   148
  | | |  parent:      7:99a2dc242c5d
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   149
  | | |  user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   150
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   151
  | | |  summary:     c_dH0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   152
  | | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   153
  | o |  changeset:   8:a33fb808fb4b
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   154
  | |/   branch:      branch_A
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   155
  | |    user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   156
  | |    date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   157
  | |    summary:     c_aG0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   158
  | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   159
  | o  changeset:   7:99a2dc242c5d
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   160
  | |  parent:      5:6ed1df20edb1
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   161
  | |  user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   162
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   163
  | |  summary:     c_dF1
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   164
  | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   165
  | o    changeset:   5:6ed1df20edb1
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   166
  | |\   parent:      4:9bf953aa81f6
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   167
  | | |  parent:      2:286d02a6e2a2
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   168
  | | |  user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   169
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   170
  | | |  summary:     c_dE0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   171
  | | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   172
  | | o  changeset:   4:9bf953aa81f6
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   173
  | | |  parent:      1:134bc3852ad2
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   174
  | | |  user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   175
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   176
  | | |  summary:     c_dD0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   177
  | | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   178
  o | |  changeset:   3:840af1c6bc88
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   179
  | | |  branch:      branch_A
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   180
  | | |  parent:      0:ea207398892e
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   181
  | | |  user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   182
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   183
  | | |  summary:     c_aC0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   184
  | | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   185
  | o |  changeset:   2:286d02a6e2a2
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   186
  | |/   user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   187
  | |    date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   188
  | |    summary:     c_dB0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   189
  | |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   190
  | o  changeset:   1:134bc3852ad2
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   191
  |/   user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   192
  |    date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   193
  |    summary:     c_dA0
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   194
  |
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   195
  o  changeset:   0:ea207398892e
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   196
     user:        test
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   197
     date:        Thu Jan 01 00:00:00 1970 +0000
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   198
     summary:     ROOT
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   199
  
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   200
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   201
actual stripping
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   202
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   203
  $ hg strip --config extensions.strip= --rev 'desc("c_dH0")'
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35185
diff changeset
   204
  saved backup bundle to $TESTTMP/client/.hg/strip-backup/fe47ea669cea-a41bf5a9-backup.hg
35185
66ecde8a704d server: introduce a 'experimental.single-head-per-branch' option
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   205
42969
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   206
Test that closing heads are ignored by default
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   207
-----------------------------------------------
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   208
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   209
  $ hg up 'desc("c_aG0")'
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   210
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   211
  $ mkcommit c_aJ0
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   212
  created new head
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   213
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   214
pushing the new head should fails
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   215
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   216
  $ hg push -f
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   217
  pushing to $TESTTMP/single-head-server
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   218
  searching for changes
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   219
  adding changesets
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   220
  adding manifests
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   221
  adding file changes
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   222
  transaction abort!
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   223
  rollback completed
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   224
  abort: rejecting multiple heads on branch "branch_A"
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   225
  (2 heads: 49003e504178 468bd81ccc5d)
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   226
  [255]
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   227
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   228
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   229
closing the head and pushing should succeed
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   230
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   231
  $ mkcommit c_aK0 --close-branch
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   232
  $ hg push -f
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   233
  pushing to $TESTTMP/single-head-server
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   234
  searching for changes
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   235
  adding changesets
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   236
  adding manifests
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   237
  adding file changes
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   238
  added 4 changesets with 4 changes to 4 files (-1 heads)
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   239
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   240
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   241
Test that closing heads can be explicitly accounted for
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   242
-------------------------------------------------------
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   243
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   244
  $ cat <<EOF >> $TESTTMP/single-head-server/.hg/hgrc
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   245
  > [experimental]
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   246
  > single-head-per-branch:account-closed-heads = yes
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   247
  > EOF
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   248
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   249
  $ hg up 'desc("c_aG0")'
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   250
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   251
  $ mkcommit c_aL0
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   252
  created new head
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   253
  $ mkcommit c_aM0 --close-branch
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   254
  $ hg push -f
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   255
  pushing to $TESTTMP/single-head-server
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   256
  searching for changes
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   257
  adding changesets
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   258
  adding manifests
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   259
  adding file changes
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   260
  transaction abort!
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   261
  rollback completed
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   262
  abort: rejecting multiple heads on branch "branch_A"
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   263
  (3 heads: 49003e504178 5254bcccab93 42b9fe70a3c1)
76608f9f27f6 singlehead: introduce special handling of closed heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42967
diff changeset
   264
  [255]
43734
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   265
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   266
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   267
Test that config can be overriden as the boolean it is
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   268
------------------------------------------------------
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   269
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   270
  $ cat <<EOF >> $TESTTMP/single-head-server/.hg/hgrc
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   271
  > [experimental]
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   272
  > single-head-per-branch = no
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   273
  > EOF
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   274
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   275
Because of previous test, we'll also push c_aL0 and c_aM0.
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   276
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   277
  $ hg out -T "{desc}\n"
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   278
  comparing with $TESTTMP/single-head-server
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   279
  searching for changes
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   280
  c_aL0
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   281
  c_aM0
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   282
46096
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   283
Let's make a new head and push everything. The server feedback will mention
43734
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   284
exactly one new head because c_aM0 is closed.
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   285
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   286
  $ hg up 'desc("c_aG0")'
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   287
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   288
  $ mkcommit c_aN0
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   289
  created new head
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   290
  $ hg push -f
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   291
  pushing to $TESTTMP/single-head-server
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   292
  searching for changes
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   293
  adding changesets
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   294
  adding manifests
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   295
  adding file changes
88a306478556 singlehead: making config item a bool again
Georges Racinet <georges.racinet@octobus.net>
parents: 42969
diff changeset
   296
  added 3 changesets with 3 changes to 3 files (+1 heads)
46096
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   297
  $ cd ..
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   298
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   299
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   300
Test that singe-head-per-branch can be restricted to public changes
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   301
-------------------------------------------------------------------
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   302
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   303
  $ hg clone -r 49003e504178 single-head-server public-only
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   304
  adding changesets
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   305
  adding manifests
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   306
  adding file changes
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   307
  added 9 changesets with 9 changes to 9 files
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   308
  1 new obsolescence markers
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   309
  new changesets ea207398892e:49003e504178 (9 drafts)
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   310
  updating to branch branch_A
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   311
  9 files updated, 0 files merged, 0 files removed, 0 files unresolved
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   312
  $ cd public-only
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   313
  $ cat <<EOF >> .hg/hgrc
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   314
  > [phases]
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   315
  > publish = no
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   316
  > [experimental]
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   317
  > single-head-per-branch = yes
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   318
  > single-head-per-branch:public-changes-only = yes
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   319
  > EOF
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   320
  > hg phase -p :
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   321
  $ hg update 'desc("c_aG0")'
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   322
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   323
  $ mkcommit c_dO0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   324
  created new head
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   325
  $ hg log -G
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   326
  @  changeset:   9:8058fd35cc2b
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   327
  |  branch:      branch_A
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   328
  |  tag:         tip
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   329
  |  parent:      7:a33fb808fb4b
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   330
  |  user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   331
  |  date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   332
  |  summary:     c_dO0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   333
  |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   334
  | o  changeset:   8:49003e504178
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   335
  |/|  branch:      branch_A
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   336
  | |  parent:      7:a33fb808fb4b
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   337
  | |  parent:      3:840af1c6bc88
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   338
  | |  user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   339
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   340
  | |  summary:     c_aI0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   341
  | |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   342
  o |  changeset:   7:a33fb808fb4b
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   343
  | |  branch:      branch_A
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   344
  | |  user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   345
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   346
  | |  summary:     c_aG0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   347
  | |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   348
  o |  changeset:   6:99a2dc242c5d
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   349
  | |  user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   350
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   351
  | |  summary:     c_dF1
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   352
  | |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   353
  o |    changeset:   5:6ed1df20edb1
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   354
  |\ \   parent:      4:9bf953aa81f6
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   355
  | | |  parent:      2:286d02a6e2a2
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   356
  | | |  user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   357
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   358
  | | |  summary:     c_dE0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   359
  | | |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   360
  | o |  changeset:   4:9bf953aa81f6
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   361
  | | |  parent:      1:134bc3852ad2
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   362
  | | |  user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   363
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   364
  | | |  summary:     c_dD0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   365
  | | |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   366
  | | o  changeset:   3:840af1c6bc88
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   367
  | | |  branch:      branch_A
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   368
  | | |  parent:      0:ea207398892e
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   369
  | | |  user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   370
  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   371
  | | |  summary:     c_aC0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   372
  | | |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   373
  o | |  changeset:   2:286d02a6e2a2
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   374
  |/ /   user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   375
  | |    date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   376
  | |    summary:     c_dB0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   377
  | |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   378
  o |  changeset:   1:134bc3852ad2
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   379
  |/   user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   380
  |    date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   381
  |    summary:     c_dA0
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   382
  |
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   383
  o  changeset:   0:ea207398892e
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   384
     user:        test
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   385
     date:        Thu Jan 01 00:00:00 1970 +0000
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   386
     summary:     ROOT
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   387
  
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   388
  $ hg phase -p .
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   389
  abort: rejecting multiple heads on branch "branch_A"
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   390
  (2 heads: 49003e504178 8058fd35cc2b)
4d5e2fd53707 singlehead: introduce option to restrict to public changes
Joerg Sonnenberger <joerg@bec.de>
parents: 43734
diff changeset
   391
  [255]