# HG changeset patch # User Anton Shestakov # Date 1708887313 10800 # Node ID 920f767589dfc3029bbd79a2ce5213bb12cc6678 # Parent cc49139f580f84d7f4038f4eff5afecb5512ecfa# Parent 3635782b02900b35fd01acf70492d6b55ae6ffab branching: merge with stable diff -r cc49139f580f -r 920f767589df hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Thu Jan 11 13:21:08 2024 -0300 +++ b/hgext3rd/evolve/evolvecmd.py Sun Feb 25 15:55:13 2024 -0300 @@ -18,6 +18,7 @@ context, encoding, error, + extensions, hg, merge, mergeutil, @@ -984,13 +985,12 @@ compat._update(repo, dest, branchmerge=False, force=True) if keepbranch: compat.setbranch(repo, orig.branch()) - if util.safehasattr(repo, 'currenttopic'): - # uurrgs - # there no other topic setter yet - if not orig.topic() and repo.vfs.exists(b'topic'): - repo.vfs.unlink(b'topic') - else: - repo.vfs.write(b'topic', orig.topic()) + if util.safehasattr(repo, 'currenttns') and repo.currenttns != orig.topic_namespace(): + topic = extensions.find(b'topic') + topic._changecurrenttns(repo, orig.topic_namespace()) + if util.safehasattr(repo, 'currenttopic') and repo.currenttopic != orig.topic(): + topic = extensions.find(b'topic') + topic._changecurrenttopic(repo, orig.topic()) stats = merge.graft(repo, orig, pctx, [b'destination', b'evolving'], True) diff -r cc49139f580f -r 920f767589df hgext3rd/topic/topicmap.py --- a/hgext3rd/topic/topicmap.py Thu Jan 11 13:21:08 2024 -0300 +++ b/hgext3rd/topic/topicmap.py Sun Feb 25 15:55:13 2024 -0300 @@ -69,16 +69,16 @@ def _phaseshash(repo, maxrev): """uniq ID for a phase matching a set of rev""" - revs = set() cl = repo.changelog fr = cl.filteredrevs - getrev = compat.getgetrev(cl) - for n in compat.nonpublicphaseroots(repo): - r = getrev(n) - if r not in fr and r < maxrev: - revs.add(r) + nppr = compat.nonpublicphaseroots(repo) + # starting with hg 6.7rc0 phase roots are already revs instead of nodes + # hg <= 6.6 (68289ed170c7) + if not util.safehasattr(repo._phasecache, '_phaseroots'): + getrev = compat.getgetrev(cl) + nppr = set(getrev(n) for n in nppr) + revs = sorted(set(r for r in nppr if r not in fr and r < maxrev)) key = nullid - revs = sorted(revs) if revs: s = hashlib.sha1() for rev in revs: diff -r cc49139f580f -r 920f767589df tests/test-issue-6028.t --- a/tests/test-issue-6028.t Thu Jan 11 13:21:08 2024 -0300 +++ b/tests/test-issue-6028.t Sun Feb 25 15:55:13 2024 -0300 @@ -130,6 +130,11 @@ atop:[4] merged b working directory is now at c920dd828523 +checking that we didn't write an empty topic file when relocating the commit on disk + + $ test -f .hg/topic + [1] + casually checking issue6141: position of p2 is not changed $ hg log -r 'predecessors(.) + .'