Commit fa1324e5 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

head-checking: also test single head enforcement with topic

They are an important part of why we want this.
parent f560d23639e1
Pipeline #4854 passed with stage
in 5 minutes and 20 seconds
......@@ -9,8 +9,8 @@
This case is part of a series of tests checking this behavior.
Category A: Involving obsolescence
TestCase 1: A fully obsolete branch kept visible by another one.
Category B: Involving obsolescence and topic
TestCase 1: A fully obsolete topic kept visible by another one.
.. old-state:
..
......@@ -14,8 +14,8 @@
.. old-state:
..
.. * 2 changeset changeset on branch default
.. * 2 changeset changeset on branch Z on top of them.
.. * 2 changeset changeset on topic X
.. * 2 changeset changeset on topic Y on top of them.
..
.. new-state:
..
......@@ -19,8 +19,8 @@
..
.. new-state:
..
.. * 2 changeset changeset on branch Z at the same location
.. * 2 changeset changeset on branch default superceeding the other ones
.. * 2 changeset changeset on topic Y at the same location
.. * 2 changeset changeset on topic X superceeding the other ones
..
.. expected-result:
..
......@@ -28,5 +28,5 @@
..
.. graph-summary:
..
.. D (branch Z)
.. D (topic-Y)
.. |
......@@ -32,3 +32,3 @@
.. |
.. C (branch Z)
.. C (topic-Y)
.. |
......@@ -34,3 +34,3 @@
.. |
.. B ø⇠◔ B'
.. B ø⇠◔ B' (topic-X)
.. | |
......@@ -36,5 +36,5 @@
.. | |
.. A ø⇠◔ A'
.. A ø⇠◔ A' (topic-X)
.. |/
..
......@@ -44,10 +44,10 @@
Test setup
----------
$ mkdir A1
$ cd A1
$ mkdir B1
$ cd B1
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
......@@ -49,6 +49,10 @@
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
$ hg topic -r . topic-X
switching to topic topic-X
changed topic on 1 changesets to "topic-X"
$ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0
$ mkcommit B0
......@@ -54,5 +58,3 @@
$ mkcommit B0
$ hg branch Z
marked working directory as branch Z
(branches are permanent and global, did you want a bookmark?)
$ hg topic topic-Y
$ mkcommit C0
......@@ -58,3 +60,5 @@
$ mkcommit C0
active topic 'topic-Y' grew its first changeset
(see 'hg help topics' for more information)
$ mkcommit D0
$ hg push --new-branch
......@@ -59,7 +63,7 @@
$ mkcommit D0
$ hg push --new-branch
pushing to $TESTTMP/A1/server
pushing to $TESTTMP/B1/server
searching for changes
adding changesets
adding manifests
adding file changes
......@@ -62,7 +66,9 @@
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 3 files
added 4 changesets with 3 changes to 4 files (+1 heads)
1 new obsolescence markers
obsoleted 1 changesets
$ hg up 0
0 files updated, 0 files merged, 4 files removed, 0 files unresolved
......@@ -67,3 +73,5 @@
$ hg up 0
0 files updated, 0 files merged, 4 files removed, 0 files unresolved
$ hg topic topic-X
marked working directory as topic: topic-X
$ mkcommit A1
......@@ -69,6 +77,4 @@
$ mkcommit A1
created new head
(consider using topic for lightweight branches. See 'hg help topic')
$ mkcommit B1
$ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
1 new obsolescence markers
......@@ -78,5 +84,5 @@
1 new obsolescence markers
obsoleted 1 changesets
$ hg log -G --hidden
@ 262c8c798096 [default] (draft): B1
@ f4ed6717fb66 [default:topic-X] (draft): B1
|
......@@ -82,3 +88,3 @@
|
o f6082bc4ffef [default] (draft): A1
o c1340bef453e [default:topic-X] (draft): A1
|
......@@ -84,3 +90,3 @@
|
| * cdf1dbb37a67 [Z] (draft): D0
| * 618812b710f7 [default:topic-Y] (draft): D0
| |
......@@ -86,3 +92,3 @@
| |
| * 3213e3e16c67 [Z] (draft): C0
| * d1ad53773db2 [default:topic-Y] (draft): C0
| |
......@@ -88,3 +94,3 @@
| |
| x d73caddc5533 [default] (draft): B0
| x 1c1f62b56685 [default:topic-X] (draft): B0
| |
......@@ -90,5 +96,5 @@
| |
| x 8aaa48160adc [default] (draft): A0
| x 5a47a98cd8e5 [default:topic-X] (draft): A0
|/
o 1e4be0697311 [default] (public): root
......@@ -97,7 +103,7 @@
--------------
$ hg push -r 'desc("B1")'
pushing to $TESTTMP/A1/server
pushing to $TESTTMP/B1/server
searching for changes
adding changesets
adding manifests
......
......@@ -10,8 +10,8 @@
This case is part of a series of tests checking this behavior.
Category A: Involving obsolescence
Category B: Involving obsolescence with topic
TestCase 2: A branch is split in two, effectively creating two heads
.. old-state:
..
......@@ -14,9 +14,9 @@
TestCase 2: A branch is split in two, effectively creating two heads
.. old-state:
..
.. * 2 changeset changeset on branch default
.. * 2 changeset changeset on branch Z on top of them.
.. * 2 changeset changeset on topic X
.. * 2 changeset changeset on topic Y on top of them.
..
.. new-state:
..
......@@ -20,9 +20,9 @@
..
.. new-state:
..
.. * 2 changeset changeset on branch Z at the same location
.. * 1 changeset changeset on branch default unchanged
.. * 1 changeset changeset on branch default superceeding the other ones
.. * 2 changeset changeset on topic Y at the same location
.. * 1 changeset changeset on topic X unchanged
.. * 1 changeset changeset on topic X superceeding the other ones
..
.. expected-result:
..
......@@ -30,5 +30,5 @@
..
.. graph-summary:
..
.. D (branch Z)
.. D (topic-Y)
.. |
......@@ -34,3 +34,3 @@
.. |
.. C (branch Z)
.. C (topic-Y)
.. |
......@@ -36,3 +36,3 @@
.. |
.. B ø⇠◔ B'
.. B ø⇠◔ B' (topic-X)
.. | |
......@@ -38,5 +38,5 @@
.. | |
.. A ● |
.. A ● | (topic-X)
.. |/
.. ●
......@@ -46,10 +46,10 @@
Test setup
----------
$ mkdir A2
$ cd A2
$ mkdir B2
$ cd B2
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
......@@ -51,8 +51,12 @@
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
$ hg topic -r . topic-X
switching to topic topic-X
changed topic on 1 changesets to "topic-X"
$ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0
$ mkcommit B0
$ hg branch Z
marked working directory as branch Z
......@@ -56,5 +60,5 @@
$ mkcommit B0
$ hg branch Z
marked working directory as branch Z
(branches are permanent and global, did you want a bookmark?)
$ hg topic topic-Y
$ mkcommit C0
......@@ -60,3 +64,5 @@
$ mkcommit C0
active topic 'topic-Y' grew its first changeset
(see 'hg help topics' for more information)
$ mkcommit D0
$ hg push --new-branch
......@@ -61,7 +67,7 @@
$ mkcommit D0
$ hg push --new-branch
pushing to $TESTTMP/A2/server
pushing to $TESTTMP/B2/server
searching for changes
adding changesets
adding manifests
adding file changes
......@@ -64,7 +70,9 @@
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 3 files
added 4 changesets with 3 changes to 4 files (+1 heads)
1 new obsolescence markers
obsoleted 1 changesets
$ hg up 0
0 files updated, 0 files merged, 4 files removed, 0 files unresolved
......@@ -69,3 +77,5 @@
$ hg up 0
0 files updated, 0 files merged, 4 files removed, 0 files unresolved
$ hg topic topic-X
marked working directory as topic: topic-X
$ mkcommit B1
......@@ -71,8 +81,6 @@
$ mkcommit B1
created new head
(consider using topic for lightweight branches. See 'hg help topic')
$ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
1 new obsolescence markers
obsoleted 1 changesets
2 new orphan changesets
$ hg log -G --hidden
......@@ -74,7 +82,7 @@
$ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
1 new obsolescence markers
obsoleted 1 changesets
2 new orphan changesets
$ hg log -G --hidden
@ 25c56d33e4c4 [default] (draft): B1
@ 5a4735b75167 [default:topic-X] (draft): B1
|
......@@ -80,3 +88,3 @@
|
| * cdf1dbb37a67 [Z] (draft): D0
| * 02490b2dd1c5 [Z:topic-Y] (draft): D0
| |
......@@ -82,3 +90,3 @@
| |
| * 3213e3e16c67 [Z] (draft): C0
| * 447ad8382abc [Z:topic-Y] (draft): C0
| |
......@@ -84,3 +92,3 @@
| |
| x d73caddc5533 [default] (draft): B0
| x 1c1f62b56685 [default:topic-X] (draft): B0
| |
......@@ -86,5 +94,5 @@
| |
| o 8aaa48160adc [default] (draft): A0
| o 5a47a98cd8e5 [default:topic-X] (draft): A0
|/
o 1e4be0697311 [default] (public): root
......@@ -95,10 +103,10 @@
(force push to make sure we get the changeset on the remote)
$ hg push -r 'desc("B1")' --force
pushing to $TESTTMP/A2/server
pushing to $TESTTMP/B2/server
searching for changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
......@@ -99,9 +107,9 @@
searching for changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: rejecting multiple heads on branch "default"
(2 heads: 8aaa48160adc 25c56d33e4c4)
abort: rejecting multiple heads on branch "default:topic-X"
(2 heads: 5a47a98cd8e5 5a4735b75167)
[255]
......@@ -9,8 +9,8 @@
This case is part of a series of tests checking this behavior.
Category A: Involving obsolescence
Category B: Involving obsolescence with topic
TestCase 3: Full superceedig of a branch interleaved with another
.. old-state:
..
......@@ -13,9 +13,9 @@
TestCase 3: Full superceedig of a branch interleaved with another
.. old-state:
..
.. * 2 changeset changeset on branch default
.. * 2 changeset changeset on branch Z interleaved with the other
.. * 2 changeset changeset on topic Y
.. * 2 changeset changeset on topic X interleaved with the other
..
.. new-state:
..
......@@ -19,8 +19,8 @@
..
.. new-state:
..
.. * 2 changeset changeset on branch Z at the same location
.. * 2 changeset changeset on branch default superceeding the other ones
.. * 2 changeset changeset on topic X at the same location
.. * 2 changeset changeset on topic Y superceeding the other ones
..
.. expected-result:
..
......@@ -28,5 +28,5 @@
..
.. graph-summary:
..
.. D (branch Z)
.. D (topic-Y)
.. |
......@@ -32,3 +32,3 @@
.. |
.. C ø⇠◔ C'
.. C ø⇠◔ C' (topix-X)
.. | |
......@@ -34,3 +34,3 @@
.. | |
.. B ● | (branch Z)
.. B ● | (topic-Y)
.. | |
......@@ -36,5 +36,5 @@
.. | |
.. A ø⇠◔ A'
.. A ø⇠◔ A' (topic-X)
.. |/
..
......@@ -44,10 +44,10 @@
Test setup
----------
$ mkdir A3
$ cd A3
$ mkdir B3
$ cd B3
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
......@@ -49,9 +49,11 @@
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
$ hg branch Z
marked working directory as branch Z
(branches are permanent and global, did you want a bookmark?)
$ hg topic -r . topic-X
switching to topic topic-X
changed topic on 1 changesets to "topic-X"
$ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0
$ hg topic topic-Y
$ mkcommit B0
......@@ -57,4 +59,5 @@
$ mkcommit B0
$ hg branch default --force
marked working directory as branch default
active topic 'topic-Y' grew its first changeset
(see 'hg help topics' for more information)
$ hg topic topic-X
$ mkcommit C0
......@@ -60,6 +63,3 @@
$ mkcommit C0
created new head
(consider using topic for lightweight branches. See 'hg help topic')
$ hg branch Z --force
marked working directory as branch Z
$ hg topic topic-Y
$ mkcommit D0
......@@ -65,4 +65,2 @@
$ mkcommit D0
created new head
(consider using topic for lightweight branches. See 'hg help topic')
$ hg push --new-branch
......@@ -68,6 +66,6 @@
$ hg push --new-branch
pushing to $TESTTMP/A3/server
pushing to $TESTTMP/B3/server
searching for changes
adding changesets
adding manifests
adding file changes
......@@ -70,7 +68,9 @@
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 3 files
added 4 changesets with 3 changes to 4 files (+1 heads)
1 new obsolescence markers
obsoleted 1 changesets
$ hg up 0
0 files updated, 0 files merged, 4 files removed, 0 files unresolved
......@@ -75,3 +75,5 @@
$ hg up 0
0 files updated, 0 files merged, 4 files removed, 0 files unresolved
$ hg topic topic-X
marked working directory as topic: topic-X
$ mkcommit A1
......@@ -77,6 +79,4 @@
$ mkcommit A1
created new head
(consider using topic for lightweight branches. See 'hg help topic')
$ mkcommit C1
$ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
1 new obsolescence markers
......@@ -86,5 +86,5 @@
1 new obsolescence markers
obsoleted 1 changesets
$ hg log -G --hidden
@ 0c76bc104656 [default] (draft): C1
@ 9f6e6381b9aa [default:topic-X] (draft): C1
|
......@@ -90,3 +90,3 @@
|
o f6082bc4ffef [default] (draft): A1
o c1340bef453e [default:topic-X] (draft): A1
|
......@@ -92,3 +92,3 @@
|
| * 78578c4306ce [Z] (draft): D0
| * 850d57e10bfe [default:topic-Y] (draft): D0
| |
......@@ -94,3 +94,3 @@
| |
| x afc55ba2ce61 [default] (draft): C0
| x fcdd583577e8 [default:topic-X] (draft): C0
| |
......@@ -96,3 +96,3 @@
| |
| * 93e5c1321ece [Z] (draft): B0
| * 030eec7a0fe2 [default:topic-Y] (draft): B0
| |
......@@ -98,5 +98,5 @@
| |
| x 8aaa48160adc [default] (draft): A0
| x 5a47a98cd8e5 [default:topic-X] (draft): A0
|/
o 1e4be0697311 [default] (public): root
......@@ -105,7 +105,7 @@
--------------
$ hg push -r 'desc("C1")'
pushing to $TESTTMP/A3/server
pushing to $TESTTMP/B3/server
searching for changes
adding changesets
adding manifests
......
......@@ -14,8 +14,8 @@
.. old-state:
..
.. * 2 changeset changeset on branch default
.. * 2 changeset changeset on branch Z interleaved with the other one
.. * 2 changeset changeset on topic X
.. * 2 changeset changeset on topic Y interleaved with the other one
..
.. new-state:
..
......@@ -19,9 +19,9 @@
..
.. new-state:
..
.. * 2 changeset changeset on branch Z at the same location
.. * 1 changeset on default untouched (the lower one)
.. * 1 changeset on default moved on the other one
.. * 2 changeset changeset on topic Y at the same location
.. * 1 changeset on topic X untouched (the lower one)
.. * 1 changeset on topic X moved on the other one
..
.. expected-result:
..
......@@ -29,5 +29,5 @@
..
.. graph-summary:
..
.. D (branch Z)
.. D (topic-Y)
.. |
......@@ -33,3 +33,3 @@
.. |
.. C ø⇠◔ C'
.. C ø⇠◔ C' (topic-X)
.. | |
......@@ -35,3 +35,3 @@
.. | |
.. B ● | (branch Z)
.. B ● | (topic-Y)
.. |/
......@@ -37,5 +37,5 @@
.. |/
.. A ●
.. A ● (topic-X)
.. |
.. ●
......@@ -45,10 +45,10 @@
Test setup
----------
$ mkdir A4
$ cd A4
$ mkdir B4
$ cd B4
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
......@@ -50,9 +50,11 @@
$ setuprepos single-head
creating basic server and client repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd client
$ hg branch Z
marked working directory as branch Z
(branches are permanent and global, did you want a bookmark?)
$ hg topic -r . topic-X
switching to topic topic-X
changed topic on 1 changesets to "topic-X"
$ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0
$ hg topic topic-Y
$ mkcommit B0
......@@ -58,4 +60,5 @@
$ mkcommit B0
$ hg branch default --force
marked working directory as branch default
active topic 'topic-Y' grew its first changeset
(see 'hg help topics' for more information)
$ hg topic topic-X
$ mkcommit C0
......@@ -61,6 +64,3 @@
$ mkcommit C0
created new head
(consider using topic for lightweight branches. See 'hg help topic')
$ hg branch Z --force
marked working directory as branch Z
$ hg topic topic-Y
$ mkcommit D0
......@@ -66,4 +66,2 @@
$ mkcommit D0
created new head
(consider using topic for lightweight branches. See 'hg help topic')
$ hg push --new-branch
......@@ -69,6 +67,6 @@
$ hg push --new-branch
pushing to $TESTTMP/A4/server
pushing to $TESTTMP/B4/server
searching for changes
adding changesets
adding manifests
adding file changes
......@@ -71,6 +69,8 @@
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 3 files
added 4 changesets with 3 changes to 4 files (+1 heads)
1 new obsolescence markers
obsoleted 1 changesets
$ hg up 'desc("A0")'
......@@ -76,2 +76,3 @@
$ hg up 'desc("A0")'
switching to topic topic-X
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
......@@ -77,2 +78,3 @@
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
$ hg topic topic-X
$ mkcommit C1
......@@ -78,8 +80,6 @@
$ mkcommit C1
created new head