N0REP0
### <pkg:foo.1>
opam-version: "2.0"
### <repo2/repo>
opam-version: "2.0"
### <repo2/packages/bar/bar.1/opam>
opam-version: "2.0"
### OPAMYES=1
### opam repository add --dont-select non-default ./repo2
[non-default] Initialised
### opam update --all

<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] no changes from file://${BASEDIR}/REPO
[non-default] no changes from file://${BASEDIR}/repo2
### opam switch create inv --empty --repo=default,non-default
### opam switch set-invariant foo
The switch invariant was set to ["foo"]
The following actions will be performed:
=== install 1 package
  - install foo 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed foo.1
Done.
### opam switch set-invariant foo
The switch invariant was set to ["foo"]
### opam switch set-invariant --package foo
The switch invariant was set to ["foo"]
### opam switch set-invariant bar
The switch invariant was set to ["bar"]
The following actions will be performed:
=== install 1 package
  - install bar 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed bar.1
Done.
### opam switch set-invariant --package bar
The switch invariant was set to ["bar"]
### <pkg:bar.1>
opam-version: "2.0"
### <pkg:bar.2>
opam-version: "2.0"
### <pkg:baz.1>
opam-version: "2.0"
flags: compiler
depends: [ "bar" { = version } ]
### <pkg:baz.2>
opam-version: "2.0"
flags: compiler
depends: [ "bar" { = version } ]
### opam switch create tonotupgrade baz.1

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["baz" {= "1"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed bar.1
-> installed baz.1
Done.
### opam upgrade -v
Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the conflicting packages.
Nothing to do.
### <pkg:baz.1>
opam-version: "2.0"
flags: compiler
depends: [ "bar" ]
### <pkg:baz.2>
opam-version: "2.0"
flags: compiler
depends: [ "bar" ]
### opam switch create tonupgrade baz.1

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["baz" {= "1"}]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed bar.2
-> installed baz.1
Done.
### opam install bar.1
The following actions will be performed:
=== downgrade 1 package
  - downgrade bar 2 to 1
=== recompile 1 package
  - recompile baz 1      [uses bar]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed   baz.1
-> removed   bar.2
-> installed bar.1
-> installed baz.1
Done.
### opam upgrade -v
The following actions will be performed:
=== recompile 1 package
  - recompile baz 1      [uses bar]
=== upgrade 1 package
  - upgrade   bar 1 to 2

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed   baz.1
-> removed   bar.1
-> installed bar.2
-> installed baz.1
Done.
