tests/test-obsolete-check-push.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 18 Nov 2021 15:00:13 +0100
changeset 48389 03644a929d6e
parent 45227 559ebfb5a58e
permissions -rw-r--r--
test: use a different timestamp for the updated file In the test we want to trigger a write after the underlying dirstate changed. To do so, we need a write. And as we are about to make dirstate update smarter we need to meddle with the script a bit to make sure there will be a write. Differential Revision: https://phab.mercurial-scm.org/D11793
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45224
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
=======================================================
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
Test check for obsolescence and instability during push
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
=======================================================
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
  $ . $TESTDIR/testlib/obsmarker-common.sh
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
  $ cat >> $HGRCPATH << EOF
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
  > [phases]
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
  > publish=false
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    10
  > [experimental]
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    11
  > evolution = all
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
  > EOF
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    13
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
Tests that pushing orphaness to the server is detected
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
======================================================
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    18
initial setup
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    19
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
  $ mkdir base
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
  $ cd base
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
  $ hg init server
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    23
  $ cd server
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    24
  $ mkcommit root
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    25
  $ hg phase --public .
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    26
  $ mkcommit commit_A0_
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    27
  $ mkcommit commit_B0_
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    28
  $ cd ..
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    29
  $ hg init client
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    30
  $ cd client
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
  $ echo '[paths]' >> .hg/hgrc
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    32
  $ echo 'default=../server' >> .hg/hgrc
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    33
  $ hg pull
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    34
  pulling from $TESTTMP/base/server
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    35
  requesting all changes
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    36
  adding changesets
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    37
  adding manifests
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    38
  adding file changes
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    39
  added 3 changesets with 3 changes to 3 files
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    40
  new changesets 1e4be0697311:c09d8ab29fda (2 drafts)
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    41
  (run 'hg update' to get a working copy)
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    42
  $ hg up 'desc("root")'
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    43
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    44
(having some unrelated change affects discovery result, we should ideally test both case)
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    45
  $ hg branch unrelated --quiet
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    46
  $ mkcommit unrelated
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    47
  $ hg up null
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    48
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    49
  $ hg log -G
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    50
  o  changeset:   3:16affbe0f986
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    51
  |  branch:      unrelated
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    52
  |  tag:         tip
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    53
  |  parent:      0:1e4be0697311
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    54
  |  user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    55
  |  date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    56
  |  summary:     unrelated
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    57
  |
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    58
  | o  changeset:   2:c09d8ab29fda
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    59
  | |  user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    60
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    61
  | |  summary:     commit_B0_
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    62
  | |
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    63
  | o  changeset:   1:37624bf21024
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    64
  |/   user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    65
  |    date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    66
  |    summary:     commit_A0_
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    67
  |
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    68
  o  changeset:   0:1e4be0697311
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    69
     user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    70
     date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    71
     summary:     root
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    72
  
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    73
  $ cd ..
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    74
  $ cd ..
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    75
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    76
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    77
Orphan from pruning
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    78
-------------------
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    79
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    80
Setup
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    81
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    82
  $ cp -R base check-pruned
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    83
  $ cd check-pruned/client
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    84
  $ hg debugobsolete --record-parents `getid 'desc("commit_A0_")'`
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    85
  1 new obsolescence markers
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    86
  obsoleted 1 changesets
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    87
  1 new orphan changesets
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    88
  $ hg log -G
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    89
  o  changeset:   3:16affbe0f986
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    90
  |  branch:      unrelated
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    91
  |  tag:         tip
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    92
  |  parent:      0:1e4be0697311
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    93
  |  user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    94
  |  date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    95
  |  summary:     unrelated
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    96
  |
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    97
  | *  changeset:   2:c09d8ab29fda
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    98
  | |  user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    99
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   100
  | |  instability: orphan
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   101
  | |  summary:     commit_B0_
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   102
  | |
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   103
  | x  changeset:   1:37624bf21024
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   104
  |/   user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   105
  |    date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   106
  |    obsolete:    pruned
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   107
  |    summary:     commit_A0_
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   108
  |
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   109
  o  changeset:   0:1e4be0697311
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   110
     user:        test
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   111
     date:        Thu Jan 01 00:00:00 1970 +0000
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   112
     summary:     root
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   113
  
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   114
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   115
Pushing the result is prevented with a message
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   116
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   117
  $ hg push --new-branch
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   118
  pushing to $TESTTMP/check-pruned/server
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   119
  searching for changes
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   120
  abort: push includes orphan changeset: c09d8ab29fda!
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   121
  [255]
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   122
187cc478e18f push: test the checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   123
  $ cd ../..
45225
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   124
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   125
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   126
Orphan from superseding
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   127
-----------------------
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   128
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   129
Setup
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   130
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   131
  $ cp -R base check-superseded
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   132
  $ cd check-superseded/client
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   133
  $ hg up 'desc("commit_A0_")'
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   134
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   135
  $ hg branch other
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   136
  marked working directory as branch other
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   137
  $ hg commit --amend -m commit_A1_
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   138
  1 new orphan changesets
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   139
  $ hg log -G
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   140
  @  changeset:   4:df9b82a99e21
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   141
  |  branch:      other
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   142
  |  tag:         tip
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   143
  |  parent:      0:1e4be0697311
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   144
  |  user:        test
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   145
  |  date:        Thu Jan 01 00:00:00 1970 +0000
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   146
  |  summary:     commit_A1_
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   147
  |
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   148
  | o  changeset:   3:16affbe0f986
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   149
  |/   branch:      unrelated
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   150
  |    parent:      0:1e4be0697311
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   151
  |    user:        test
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   152
  |    date:        Thu Jan 01 00:00:00 1970 +0000
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   153
  |    summary:     unrelated
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   154
  |
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   155
  | *  changeset:   2:c09d8ab29fda
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   156
  | |  user:        test
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   157
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   158
  | |  instability: orphan
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   159
  | |  summary:     commit_B0_
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   160
  | |
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   161
  | x  changeset:   1:37624bf21024
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   162
  |/   user:        test
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   163
  |    date:        Thu Jan 01 00:00:00 1970 +0000
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   164
  |    obsolete:    rewritten using amend as 4:df9b82a99e21
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   165
  |    summary:     commit_A0_
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   166
  |
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   167
  o  changeset:   0:1e4be0697311
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   168
     user:        test
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   169
     date:        Thu Jan 01 00:00:00 1970 +0000
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   170
     summary:     root
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   171
  
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   172
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   173
Pushing the result is prevented with a message
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   174
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   175
  $ hg push --new-branch
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   176
  pushing to $TESTTMP/check-superseded/server
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   177
  searching for changes
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   178
  abort: push includes orphan changeset: c09d8ab29fda!
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   179
  [255]
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   180
fc751824ae97 push: another test for checks preventing pushing orphaness to a server
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45224
diff changeset
   181
  $ cd ../..
45226
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   182
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   183
Tests that user get warned if it is about to publish obsolete/unstable content
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   184
------------------------------------------------------------------------------
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   185
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   186
Orphan from pruning
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   187
-------------------
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   188
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   189
Make sure the only difference is phase:
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   190
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   191
  $ cd check-pruned/client
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   192
  $ hg push --force --rev 'not desc("unrelated")'
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   193
  pushing to $TESTTMP/check-pruned/server
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   194
  searching for changes
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   195
  no changes found
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   196
  1 new obsolescence markers
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   197
  obsoleted 1 changesets
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   198
  1 new orphan changesets
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   199
  [1]
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   200
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   201
Check something prevents a silent publication of the obsolete changeset
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   202
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   203
  $ hg push --publish --new-branch
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   204
  pushing to $TESTTMP/check-pruned/server
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   205
  searching for changes
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   206
  abort: push includes orphan changeset: c09d8ab29fda!
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   207
  [255]
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   208
5ff77aaba1e4 push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45225
diff changeset
   209
  $ cd ../..
45227
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   210
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   211
Orphan from superseding
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   212
-----------------------
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   213
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   214
Make sure the only difference is phase:
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   215
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   216
  $ cd check-superseded/client
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   217
  $ hg push --force --rev 'not desc("unrelated")'
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   218
  pushing to $TESTTMP/check-superseded/server
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   219
  searching for changes
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   220
  adding changesets
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   221
  adding manifests
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   222
  adding file changes
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   223
  added 1 changesets with 0 changes to 0 files (+1 heads)
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   224
  1 new obsolescence markers
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   225
  obsoleted 1 changesets
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   226
  1 new orphan changesets
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   227
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   228
Check something prevents a silent publication of the obsolete changeset
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   229
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   230
  $ hg push --publish --new-branch
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   231
  pushing to $TESTTMP/check-superseded/server
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   232
  searching for changes
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   233
  abort: push includes orphan changeset: c09d8ab29fda!
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   234
  [255]
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   235
559ebfb5a58e push: test for checks preventing publishing obsolete changeset
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45226
diff changeset
   236
  $ cd ../..