tests/test-push-checkheads-multibranches-E1.t
author Manuel Jacob <me@manueljacob.de>
Mon, 07 Aug 2023 23:12:02 +0200
branchstable
changeset 50820 9ed281bbf864
parent 44450 7d5455b988ec
permissions -rw-r--r--
hgweb: encode WSGI environment using the ISO-8859-1 codec The WSGI specification (PEP 3333) specifies that on Python 3 all strings passed by the server must be of type str with code points encodable using the ISO 8859-1 codec. For some reason, I introduced a bug in 2632c1ed8f34 by applying the reverse change. Maybe I got confused because PEP 3333 says that arbitrary operating system environment variables may be contained in the WSGI environment and therefore we need to handle the WSGI environment variables like we would handle operating system environment variables. The bug mentioned in the previous paragraph and fixed by this changeset manifested e.g. in the path of the URL being encoded in the wrong way. Browsers encode non-ASCII bytes with the percent-encoding. WSGI servers will decode the percent-encoded bytes and pass them to the application as strings where each byte is mapped to the corresponding code point with the same ordinal (i.e. it is decoded using the ISO-8859-1 codec). Mercurial uses the bytes type for these strings (which makes much more sense), so we need to encode it again using the ISO-8859-1 codec. If we use another codec, it can result in nonsense.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44450
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
====================================
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
Testing head checking code: Case E-1
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
====================================
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
Mercurial checks for the introduction of new heads on push. Evolution comes
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
into play to detect if existing branches on the server are being replaced by
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
some of the new one we push.
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
This case is part of a series of tests checking this behavior.
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    10
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    11
Category E: case involving changeset on multiple branch
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
TestCase 8: moving a branch to another location
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    13
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
.. old-state:
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
..
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
.. * 1-changeset on branch default
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
.. * 1-changeset on branch Z (above default)
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    18
..
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    19
.. new-state:
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
..
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
.. * 1-changeset on branch default
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
.. * 1-changeset on branch Z (rebased away from A0)
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    23
..
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    24
.. expected-result:
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    25
..
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    26
.. * push allowed
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    27
..
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    28
.. graph-summary:
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    29
..
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    30
..   B ø⇠◔ B'
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
..     | |
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    32
..   A ◔ |
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    33
..     |/
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    34
..     ●
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    35
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    36
  $ . $TESTDIR/testlib/push-checkheads-util.sh
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    37
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    38
Test setup
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    39
----------
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    40
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    41
  $ mkdir E1
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    42
  $ cd E1
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    43
  $ setuprepos
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    44
  creating basic server and client repo
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    45
  updating to branch default
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    46
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    47
  $ cd client
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    48
  $ hg branch Z
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    49
  marked working directory as branch Z
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    50
  (branches are permanent and global, did you want a bookmark?)
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    51
  $ mkcommit B0
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    52
  $ hg push --new-branch
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    53
  pushing to $TESTTMP/E1/server
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    54
  searching for changes
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    55
  adding changesets
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    56
  adding manifests
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    57
  adding file changes
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    58
  added 1 changesets with 1 changes to 1 files
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    59
  $ hg up 0
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    60
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    61
  $ hg branch --force Z
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    62
  marked working directory as branch Z
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    63
  $ mkcommit B1
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    64
  created new head
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    65
  $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    66
  1 new obsolescence markers
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    67
  obsoleted 1 changesets
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    68
  $ hg log -G --hidden
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    69
  @  c98b855401e7 (draft): B1
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    70
  |
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    71
  | x  93e5c1321ece (draft): B0
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    72
  | |
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    73
  | o  8aaa48160adc (draft): A0
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    74
  |/
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    75
  o  1e4be0697311 (public): root
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    76
  
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    77
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    78
Actual testing
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    79
--------------
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    80
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    81
  $ hg push
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    82
  pushing to $TESTTMP/E1/server
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    83
  searching for changes
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    84
  adding changesets
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    85
  adding manifests
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    86
  adding file changes
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    87
  added 1 changesets with 1 changes to 1 files (+1 heads)
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    88
  1 new obsolescence markers
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    89
  obsoleted 1 changesets
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    90
7d5455b988ec discovery: avoid wrong detection of multiple branch heads (issue6256)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    91
  $ cd ../..