view tests/test-topic-issue6841.t @ 6935:954d7ea5cd67 stable tip

stack: when stack base is obsolete, pick any successor, even if at random There are situations when s0 is obsolete and we also cannot pick just one successor for it to use in stack. In such a case, let's pick the "latest" successor from the first set. We're assuming that obsutil.successorssets() returns data in the same order (it should, since it makes sure to sort data internally). Keeping that in mind, while the successor picked for s0 by this code is not based on any sort of sophisticated logic, it should nonetheless be the same every time. This patch is probably not going to completely break anything that was previously working fine, because the previous behavior was to just abort with an exception.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 16 Nov 2024 17:01:02 +0400
parents 7ec9f4b04519
children
line wrap: on
line source

New clones shouldn't have topics in any on-disk caches (issue6841)
https://bz.mercurial-scm.org/show_bug.cgi?id=6841

  $ . "$TESTDIR/testlib/common.sh"

  $ cat >> $HGRCPATH << EOF
  > [extensions]
  > topic =
  > [phases]
  > publish = no
  > [ui]
  > ssh = "$PYTHON" "$RUNTESTDIR/dummyssh"
  > EOF

  $ hg init orig
  $ hg clone orig publishing -q
  $ cat >> publishing/.hg/hgrc << EOF
  > [phases]
  > publish = yes
  > EOF

  $ cd orig
  $ mkcommit ROOT
  $ hg push ../publishing
  pushing to ../publishing
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files

  $ echo foo > foo
  $ hg topic topic-foo
  marked working directory as topic: topic-foo
  $ hg ci -qAm foo

  $ cd ..

cloning via ssh to use wire protocol

  $ hg clone ssh://user@dummy/orig new-clone -q
  $ cd new-clone

on-disk caches are using bare branch names only

  $ f -Hq .hg/cache/rbc-names-v?
  0000: 64 65 66 61 75 6c 74                            |default|
  $ grep topic-foo .hg/cache/*
  [1]

and pushing works fine

  $ hg push ssh://user@dummy/publishing
  pushing to ssh://user@dummy/publishing
  searching for changes
  remote: adding changesets
  remote: adding manifests
  remote: adding file changes
  remote: added 1 changesets with 1 changes to 1 files

  $ cd ..