tests/test-obsolete-checkheads.t
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 24 Aug 2012 16:52:45 +0200
changeset 17547 e6de4761d26f
parent 17546 488e470634d8
child 17548 eaa5fcc5bd20
permissions -rw-r--r--
checkheads: attend to phases when computing new heads with obsolete Checkheads was more permissive than expected. When the remote heads are public we don't need to search for successors. None will make a public head disappear.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17546
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
Check that obsolete properly strip heads
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
  $ cat > obs.py << EOF
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     3
  > import mercurial.obsolete
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
  > mercurial.obsolete._enabled = True
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
  > EOF
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
  $ cat >> $HGRCPATH << EOF
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
  > [phases]
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     8
  > # public changeset are not obsolete
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
  > publish=false
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
  > [ui]
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    11
  > logtemplate='{node|short} ({phase}) {desc|firstline}\n'
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
  > [extensions]
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
  > graphlog=
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    14
  > EOF
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    15
  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    16
  $ mkcommit() {
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    17
  >    echo "$1" > "$1"
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    18
  >    hg add "$1"
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    19
  >    hg ci -m "add $1"
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    20
  > }
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    21
  $ getid() {
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    22
  >    hg id --debug -ir "desc('$1')"
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    23
  > }
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    24
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    25
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    26
  $ hg init remote
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    27
  $ cd remote
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
  $ mkcommit base
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    29
  $ hg phase --public .
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    30
  $ cd ..
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    31
  $ cp -r remote base
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    32
  $ hg clone remote local
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    33
  updating to branch default
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    34
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    35
  $ cd local
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
New head replaces old head
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    38
==========================
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    39
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    40
setup
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    41
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    42
  $ mkcommit old
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    43
  $ hg push
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    44
  pushing to $TESTTMP/remote
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    45
  searching for changes
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    46
  adding changesets
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    47
  adding manifests
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    48
  adding file changes
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    49
  added 1 changesets with 1 changes to 1 files
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    50
  $ hg up -q '.^'
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    51
  $ mkcommit new
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    52
  created new head
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    53
  $ hg debugobsolete `getid old` `getid new`
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    54
  $ hg glog --hidden
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    55
  @  71e3228bffe1 (draft) add new
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    56
  |
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    57
  | x  c70b08862e08 (draft) add old
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    58
  |/
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    59
  o  b4952fcf48cf (public) add base
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    60
  
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    61
  $ cp -r ../remote ../backup1
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    62
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    63
old exists remotely as draft. It is obsoleted by new that we now push.
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    64
Push should not warn about creating new head
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    65
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    66
  $ hg push
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    67
  pushing to $TESTTMP/remote
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    68
  searching for changes
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    69
  adding changesets
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    70
  adding manifests
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    71
  adding file changes
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    72
  added 1 changesets with 1 changes to 1 files (+1 heads)
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    73
17547
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    74
old head is now public (public local version)
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    75
=============================================
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    76
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    77
setup
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    78
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    79
  $ rm -fr ../remote
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    80
  $ cp -r ../backup1 ../remote
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    81
  $ hg -R ../remote phase --public c70b08862e08
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    82
  $ hg pull -v
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    83
  pulling from $TESTTMP/remote
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    84
  searching for changes
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    85
  no changes found
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    86
  $ hg glog --hidden
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    87
  @  71e3228bffe1 (draft) add new
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    88
  |
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    89
  | o  c70b08862e08 (public) add old
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    90
  |/
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    91
  o  b4952fcf48cf (public) add base
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    92
  
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    93
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    94
Abort: old will still be an head because it's public.
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    95
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    96
  $ hg push
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    97
  pushing to $TESTTMP/remote
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    98
  searching for changes
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
    99
  abort: push creates new remote head 71e3228bffe1!
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   100
  (did you forget to merge? use push -f to force)
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   101
  [255]
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   102
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   103
old head is now public (public remote version)
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   104
==============================================
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   105
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   106
TODO: Not implemented yet.
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   107
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   108
# setup
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   109
#
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   110
#   $ rm -fr ../remote
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   111
#   $ cp -r ../backup1 ../remote
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   112
#   $ hg -R ../remote phase --public c70b08862e08
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   113
#   $ hg phase --draft --force c70b08862e08
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   114
#   $ hg glog --hidden
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   115
#   @  71e3228bffe1 (draft) add new
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   116
#   |
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   117
#   | x  c70b08862e08 (draft) add old
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   118
#   |/
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   119
#   o  b4952fcf48cf (public) add base
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   120
#
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   121
#
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   122
#
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   123
# Abort: old will still be an head because it's public.
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   124
#
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   125
#   $ hg push
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   126
#   pushing to $TESTTMP/remote
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   127
#   searching for changes
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   128
#   abort: push creates new remote head 71e3228bffe1!
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   129
#   (did you forget to merge? use push -f to force)
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   130
#   [255]
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   131
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   132
old head is obsolete but replacement is not pushed
17546
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   133
==================================================
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   134
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   135
setup
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   136
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   137
  $ rm -fr ../remote
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   138
  $ cp -r ../backup1 ../remote
17547
e6de4761d26f checkheads: attend to phases when computing new heads with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17546
diff changeset
   139
  $ hg phase --draft --force '(0::) - 0'
17546
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   140
  $ hg up -q '.^'
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   141
  $ mkcommit other
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   142
  created new head
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   143
  $ hg glog --hidden
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   144
  @  d7d41ccbd4de (draft) add other
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   145
  |
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   146
  | o  71e3228bffe1 (draft) add new
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   147
  |/
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   148
  | x  c70b08862e08 (draft) add old
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   149
  |/
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   150
  o  b4952fcf48cf (public) add base
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   151
  
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   152
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   153
old exists remotely as draft. It is obsoleted by new but we don't push new.
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   154
Push should abort on new head
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   155
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   156
  $ hg push -r 'desc("other")'
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   157
  pushing to $TESTTMP/remote
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   158
  searching for changes
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   159
  abort: push creates new remote head d7d41ccbd4de!
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   160
  (did you forget to merge? use push -f to force)
488e470634d8 test: add testing of checkheads behavior with obsolete
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
   161
  [255]