tests/test-ssh-clone-r.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 09 Apr 2024 02:54:12 +0200
changeset 51577 b5d494f7d28a
parent 49825 2f2682f40ea0
permissions -rw-r--r--
push: rework the computation of fallbackheads to be correct The previous computation tried to be smart but ended up being wrong. This was caught by phase movement test while reworking the phase discovery logic to be faster. The previous logic was failing to catch case where the pushed set was not based on a common heads (i.e. when the discovery seemed to have "over discovered" content, outside the pushed set) In the following graph, `e` is a common head and we `hg push -r f`. We need to detect `c` as a fallback heads and we previous failed to do so:: e | d f |/ c | b | a The performance impact of the change seems minimal. On the most impacted repository at hand (mozilla-try), the slowdown seems mostly mixed in the overall noise `hg push` but seems to be in the hundred of milliseconds order of magnitude. When using rust, we seems to be a bit faster, probably because we leverage more accelaratd internals. I added a couple of performance related common for further investigation later on.

This test tries to exercise the ssh functionality with a dummy script

creating 'remote' repo

  $ hg init remote
  $ cd remote
  $ hg unbundle "$TESTDIR/bundles/remote.hg"
  adding changesets
  adding manifests
  adding file changes
  added 9 changesets with 7 changes to 4 files (+1 heads)
  new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
  (run 'hg heads' to see heads, 'hg merge' to merge)
  $ hg up tip
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd ..

clone remote via stream

  $ for i in 0 1 2 3 4 5 6 7 8; do
  >    hg clone --stream -r "$i" ssh://user@dummy/remote test-"$i"
  >    if cd test-"$i"; then
  >       hg verify -q
  >       cd ..
  >    fi
  > done
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  new changesets bfaf4b5cbf01
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 2 changes to 1 files
  new changesets bfaf4b5cbf01:21f32785131f
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 3 changes to 1 files
  new changesets bfaf4b5cbf01:4ce51a113780
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 4 changesets with 4 changes to 1 files
  new changesets bfaf4b5cbf01:93ee6ab32777
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 2 changes to 1 files
  new changesets bfaf4b5cbf01:c70afb1ee985
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 3 changes to 1 files
  new changesets bfaf4b5cbf01:f03ae5a9b979
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 4 changesets with 5 changes to 2 files
  new changesets bfaf4b5cbf01:095cb14b1b4d
  updating to branch default
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 5 changesets with 6 changes to 3 files
  new changesets bfaf4b5cbf01:faa2e4234c7a
  updating to branch default
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  adding changesets
  adding manifests
  adding file changes
  added 5 changesets with 5 changes to 2 files
  new changesets bfaf4b5cbf01:916f1afdef90
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd test-8
  $ hg pull ../test-7
  pulling from ../test-7
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 4 changesets with 2 changes to 3 files (+1 heads)
  new changesets c70afb1ee985:faa2e4234c7a
  (run 'hg heads' to see heads, 'hg merge' to merge)
  $ hg verify -q
  $ cd ..
  $ cd test-1
  $ hg pull -r 4 ssh://user@dummy/remote
  pulling from ssh://user@dummy/remote
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 0 changes to 0 files (+1 heads)
  new changesets c70afb1ee985
  (run 'hg heads' to see heads, 'hg merge' to merge)
  $ hg verify -q
  $ hg pull ssh://user@dummy/remote
  pulling from ssh://user@dummy/remote
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 6 changesets with 5 changes to 4 files
  new changesets 4ce51a113780:916f1afdef90
  (run 'hg update' to get a working copy)
  $ cd ..
  $ cd test-2
  $ hg pull -r 5 ssh://user@dummy/remote
  pulling from ssh://user@dummy/remote
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 0 changes to 0 files (+1 heads)
  new changesets c70afb1ee985:f03ae5a9b979
  (run 'hg heads' to see heads, 'hg merge' to merge)
  $ hg verify -q
  $ hg pull ssh://user@dummy/remote
  pulling from ssh://user@dummy/remote
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 4 changesets with 4 changes to 4 files
  new changesets 93ee6ab32777:916f1afdef90
  (run 'hg update' to get a working copy)
  $ hg verify -q

  $ cd ..