# HG changeset patch # User Pierre-Yves David # Date 2023-11-06 22:17:10 # Node ID 80bda4254b84607d71138cf1be5c5a154dca07e2 # Parent 5d740f920640a8e3920906845d8a49bd6ab4a81f unstable: do not consider internal phases when computing unstable The revisions that are not part of the "working" set by other means should not be considered for the evolution related computation. This impact the test introduced in 5f9af8422b31 as this is actually a more semantic fix of the issue. diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -939,7 +939,7 @@ def clearobscaches(repo): def _mutablerevs(repo): """the set of mutable revision in the repository""" - return repo._phasecache.getrevset(repo, phases.mutablephases) + return repo._phasecache.getrevset(repo, phases.relevant_mutable_phases) @cachefor(b'obsolete') diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -165,6 +165,7 @@ phasenumber2.update({phase: phase for ph phasenumber2.update({b'%i' % phase: phase for phase in phasenames}) # record phase property mutablephases = (draft, secret, archived, internal) +relevant_mutable_phases = (draft, secret) # could be obsolete or unstable remotehiddenphases = (secret, archived, internal) localhiddenphases = (internal, archived) diff --git a/tests/test-phases.t b/tests/test-phases.t --- a/tests/test-phases.t +++ b/tests/test-phases.t @@ -1001,18 +1001,20 @@ Commit is hidden as expected summary: A The hidden commit is an orphan but doesn't show up without --hidden +And internal changesets are not considered for unstability. $ hg debugobsolete `hg id --debug -ir 0` 1 new obsolescence markers obsoleted 1 changesets - $ hg --hidden log -G -r 'unstable()' - * changeset: 1:c01c42dffc7f + $ hg --hidden log -G -r '(0::) - 0' + o changeset: 1:c01c42dffc7f | tag: tip ~ user: test date: Thu Jan 01 00:00:00 1970 +0000 - instability: orphan summary: my test internal commit + $ hg --hidden log -G -r 'unstable()' + $ hg log -G -r 'unstable()'