# HG changeset patch # User Anton Shestakov # Date 1689871326 10800 # Node ID 9148051f3712d3636e41df95fd9006407cd6600e # Parent 90b631fde2d76559f77c92be52aa889603a1cb50 evolve: don't warn about topics while resolving public content-divergence During content divergence resolution where one side is already published, we can hit a case when there is no actual content difference between the two changesets. Some of the metadata can be valuable, such as branch. But topics are only important for non-public changesets. warnmetadataloss() is trying to warn users about metadata "loss" during the resolution, but it only runs when one of the sides is published. So it shouldn't care about topics or topic namespaces. diff -r 90b631fde2d7 -r 9148051f3712 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Mon Jul 17 15:52:39 2023 -0300 +++ b/hgext3rd/evolve/evolvecmd.py Thu Jul 20 13:42:06 2023 -0300 @@ -692,7 +692,7 @@ public content-divergence""" # needtowarn: aspects where we need to warn user - needtowarn = [b'branch', b'topic', b'close'] + needtowarn = [b'branch', b'close'] aspects = set() localextra = local.extra() otherextra = other.extra() diff -r 90b631fde2d7 -r 9148051f3712 tests/test-evolve-public-content-divergent-discard.t --- a/tests/test-evolve-public-content-divergent-discard.t Mon Jul 17 15:52:39 2023 -0300 +++ b/tests/test-evolve-public-content-divergent-discard.t Thu Jul 20 13:42:06 2023 -0300 @@ -636,6 +636,8 @@ $ hg init pubdiv7 $ cd pubdiv7 + $ echo '[extensions]' > .hg/hgrc + $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> .hg/hgrc $ for ch in a b c d; do > echo $ch > $ch; > hg ci -Am "added "$ch; @@ -652,26 +654,42 @@ $ hg branch double//slash marked working directory as branch double//slash (branches are permanent and global, did you want a bookmark?) + $ hg debug-topic-namespace tns-1 + marked working directory as topic namespace: tns-1 + $ hg topics topic-1 + marked working directory as topic: topic-1 $ echo dada > d $ hg ci -Am "added d" adding d + active topic 'topic-1' grew its first changeset + (see 'hg help topics' for more information) $ hg prune -r "min(desc('added d'))" -s . --hidden 1 changesets pruned 2 new content-divergent changesets (publish one side) $ hg phase --public + active topic 'topic-1' is now empty + (use 'hg topic --clear' to clear it if needed) $ hg up -r "draft()" + clearing empty topic "topic-1" 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg debug-topic-namespace tns-2 + marked working directory as topic namespace: tns-2 + $ hg topics topic-2 + marked working directory as topic: topic-2 + (make other divergent a closed branch head) $ hg ci --amend -m "closing branch double//slash" --close-branch + active topic 'topic-2' grew its first changeset + (see 'hg help topics' for more information) $ hg glog - @ 6:83825baa0dc2 closing branch double//slash + @ 6:fe5d55b4e488 closing branch double//slash | draft content-divergent | - | o 5:8b3ac33245dd added d + | o 5:bde8ac1c636a added d |/ public | o 2:155349b645be added c @@ -691,7 +709,8 @@ with: [6] closing branch double//slash base: [3] added d 0 files updated, 0 files merged, 0 files removed, 0 files unresolved - other divergent changeset 83825baa0dc2 is a closed branch head and differs from local 8b3ac33245dd by "branch, description" only, discarding 83825baa0dc2 - content divergence resolution between 8b3ac33245dd (public) and 83825baa0dc2 has same content as 8b3ac33245dd, discarding 83825baa0dc2 - working directory is now at 8b3ac33245dd + other divergent changeset fe5d55b4e488 is a closed branch head and differs from local bde8ac1c636a by "branch, description" only, discarding fe5d55b4e488 + content divergence resolution between bde8ac1c636a (public) and fe5d55b4e488 has same content as bde8ac1c636a, discarding fe5d55b4e488 + active topic 'topic-2' is now empty + working directory is now at bde8ac1c636a