tests/test-topic-flow-single-head.t
author Manuel Jacob <me@manueljacob.de>
Sat, 21 Mar 2020 20:36:41 +0100
changeset 5314 f12d2172a133
parent 4871 a8ff17479fb8
child 4905 f3e39a354378
permissions -rw-r--r--
evolve: consider all obsolete ancestors when finding new parent for orphan Both the old and the new logic have in common that the orphan changeset is moved to the tipmost successor of one or more ancestors of the orphan changeset. The previous logic considered only the first non-pruned ancestor of the orphan changeset. The new logic considers all obsolete ancestors of the orphan changeset. The logic in _possibledestination() had to be changed to be consistent with the new logic.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3157
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
=====================
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
Test workflow options
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
=====================
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
  $ . "$TESTDIR/testlib/topic_setup.sh"
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
  $ . "$TESTDIR/testlib/common.sh"
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
Test single head enforcing - Setup
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
=============================================
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    10
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    11
  $ hg init single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
  $ cd single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    13
  $ cat <<EOF >> .hg/hgrc
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
  > [phases]
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
  > publish = no
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
  > [experimental]
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
  > enforce-single-head = yes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    18
  > evolution = all
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    19
  > EOF
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
  $ mkcommit ROOT
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
  $ mkcommit c_dA0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
  $ cd ..
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    23
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    24
  $ hg clone single-head-server client
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    25
  updating to branch default
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    26
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    27
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    28
Test single head enforcing - with branch only
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    29
---------------------------------------------
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    30
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
  $ cd client
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    32
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    33
continuing the current defaultbranch
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    34
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    35
  $ mkcommit c_dB0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    36
  $ hg push
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    37
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    38
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    39
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    40
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    41
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    42
  added 1 changesets with 1 changes to 1 files
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    43
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    44
creating a new branch
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    45
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    46
  $ hg up 'desc("ROOT")'
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    47
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    48
  $ hg branch branch_A
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    49
  marked working directory as branch branch_A
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    50
  (branches are permanent and global, did you want a bookmark?)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    51
  $ mkcommit c_aC0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    52
  $ hg push --new-branch
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    53
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    54
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    55
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    56
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    57
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    58
  added 1 changesets with 1 changes to 1 files (+1 heads)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    59
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    60
Create a new head on the default branch
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    61
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    62
  $ hg up 'desc("c_dA0")'
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    63
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    64
  $ mkcommit c_dD0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    65
  created new head
3397
f7129e3d5a38 topic: suggest using topic when user creates a new head on branch
Pulkit Goyal <7895pulkit@gmail.com>
parents: 3157
diff changeset
    66
  (consider using topic for lightweight branches. See 'hg help topic')
3157
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    67
  $ hg push -f
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    68
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    69
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    70
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    71
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    72
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    73
  transaction abort!
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    74
  rollback completed
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    75
  abort: 2 heads on "default"
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    76
  (286d02a6e2a2, 9bf953aa81f6)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    77
  [255]
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    78
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    79
remerge them
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    80
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    81
  $ hg merge
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    82
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    83
  (branch merge, don't forget to commit)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    84
  $ mkcommit c_dE0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    85
  $ hg push
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    86
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    87
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    88
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    89
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    90
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    91
  added 2 changesets with 2 changes to 2 files
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    92
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    93
Test single head enforcing - with topic
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    94
---------------------------------------
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    95
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    96
pushing a new topic
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    97
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    98
  $ hg topic foo
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    99
  marked working directory as topic: foo
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   100
  $ mkcommit c_dF0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   101
  active topic 'foo' grew its first changeset
3769
1bc4b0807c37 topic: display a hint pointing at help when a topic becomes non-empty
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 3397
diff changeset
   102
  (see 'hg help topics' for more information)
3157
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   103
  $ hg push
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   104
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   105
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   106
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   107
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   108
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   109
  added 1 changesets with 1 changes to 1 files
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   110
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   111
pushing a new topo branch (with a topic)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   112
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   113
  $ hg up 'desc("c_dD0")'
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   114
  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   115
  $ hg topic bar
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   116
  marked working directory as topic: bar
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   117
  $ mkcommit c_dG0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   118
  active topic 'bar' grew its first changeset
3769
1bc4b0807c37 topic: display a hint pointing at help when a topic becomes non-empty
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 3397
diff changeset
   119
  (see 'hg help topics' for more information)
3157
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   120
  $ hg push
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   121
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   122
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   123
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   124
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   125
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   126
  added 1 changesets with 1 changes to 1 files (+1 heads)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   127
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   128
detect multiple heads on the topic
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   129
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   130
  $ mkcommit c_dH0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   131
  $ hg push
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   132
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   133
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   134
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   135
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   136
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   137
  added 1 changesets with 1 changes to 1 files
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   138
  $ hg up 'desc("c_dG0")'
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   139
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   140
  $ mkcommit c_dI0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   141
  $ hg push  -f
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   142
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   143
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   144
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   145
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   146
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   147
  transaction abort!
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   148
  rollback completed
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   149
  abort: 2 heads on "default:bar"
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   150
  (5194f5dcd542, 48a01453c1c5)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   151
  [255]
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   152
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   153
merge works fine
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   154
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   155
  $ hg merge
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   156
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   157
  (branch merge, don't forget to commit)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   158
  $ mkcommit c_dJ0
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   159
  $ hg push
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   160
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   161
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   162
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   163
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   164
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   165
  added 2 changesets with 2 changes to 2 files
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   166
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   167
Test single head enforcing - by phase move
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   168
------------------------------------------
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   169
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   170
  $ hg -R ../single-head-server phase --public 'desc("c_dJ0")'
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   171
  abort: 2 heads on "default"
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   172
  (6ed1df20edb1, 678bca4de98c)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   173
  [255]
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   174
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   175
Test single head enforcing - after rewrite
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   176
------------------------------------------
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   177
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   178
  $ hg up foo
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   179
  switching to topic foo
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   180
  3 files updated, 0 files merged, 4 files removed, 0 files unresolved
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   181
  $ hg commit --amend -m c_dF1
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   182
  $ hg push
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   183
  pushing to $TESTTMP/single-head-server
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   184
  searching for changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   185
  adding changesets
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   186
  adding manifests
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   187
  adding file changes
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   188
  added 1 changesets with 0 changes to 1 files (+1 heads)
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   189
  1 new obsolescence markers
f286eefbd20d topic: add an option to enforce a single head per name in a repository
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   190
  obsoleted 1 changesets