annotate tests/test-topic-issue6500.t @ 6224:17ffdea0edbb stable

evolve: look for split successors of the correct ancestor (issue6648) Consider two changesets, 1 and 2. 1 is split into two new changesets and 2 is pruned. If we stand on 2 and call hg evolve, _singlesuccessor() will traverse ancestors of wdp in search of a changeset with successors to update to (it will be 1, which was split). In case of a split, select_split_successor() gets control. The issue is this function didn't traverse ancestors, and instead tried to look up successors of the original changeset (i.e. 2 in our case, which was pruned). We can make select_split_successor() aware of _singlesuccessor() logic by using the changeset that actually has successors without traversing ancestors again. It's done by storing that changeset in MultipleSuccessorsError exception.
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 21 Apr 2022 22:19:27 +0400
parents 6c67219ce779
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6022
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
1 KeyError: b'topic' on history-rewriting commands (issue6500)
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
2 https://bz.mercurial-scm.org/show_bug.cgi?id=6500
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
3
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
4 $ . $TESTDIR/testlib/common.sh
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
5
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
6 Making sure we're not caching .topic() results for memctx or anything else that's not stored on-disk
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
7
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
8 $ hg init issue6500-caching-memctx
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
9 $ cd issue6500-caching-memctx
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
10
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
11 $ cat >> $HGRCPATH << EOF
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
12 > [extensions]
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
13 > evolve =
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
14 > topic =
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
15 > EOF
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
16
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
17 for this test we need 2 changesets with amend_source, one with topic and one without
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
18
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
19 $ hg topics foo
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
20 marked working directory as topic: foo
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
21 $ echo apple > a
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
22 $ hg ci -qAm 'apple'
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
23 $ echo apricot > a
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
24 $ hg ci --amend -m 'apricot'
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
25
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
26 not using `hg topics --clear -r .` here because that would remove amend_source, see _changetopics()
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
27
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
28 $ hg topics --clear
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
29 $ hg ci --amend -m 'no foo apricot'
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
30
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
31 $ hg log --hidden -r 1+2 -T '{rev}: {join(extras, " ")}\n'
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
32 1: amend_source=* branch=default topic=foo (glob)
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
33 2: amend_source=* branch=default (glob)
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
34
6023
6c67219ce779 topic: don't cache topic of e.g. memctx in _topiccache (issue6500)
Anton Shestakov <av6@dwimlabs.net>
parents: 6022
diff changeset
35 creating and handling 2 memctx instances (based on 1 and then 2) should work
6022
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
36
6023
6c67219ce779 topic: don't cache topic of e.g. memctx in _topiccache (issue6500)
Anton Shestakov <av6@dwimlabs.net>
parents: 6022
diff changeset
37 $ hg touch --hidden -r 1+2 --duplicate
6c67219ce779 topic: don't cache topic of e.g. memctx in _topiccache (issue6500)
Anton Shestakov <av6@dwimlabs.net>
parents: 6022
diff changeset
38 switching to topic foo
6022
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
39
6023
6c67219ce779 topic: don't cache topic of e.g. memctx in _topiccache (issue6500)
Anton Shestakov <av6@dwimlabs.net>
parents: 6022
diff changeset
40 make sure extras stay the same
6022
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
41
43bde39bbe65 tests: demonstrate how caching topic of memctx results in issue6500
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
42 $ hg log --hidden -r 3+4 -T '{rev}: {join(extras, " ")}\n'
6023
6c67219ce779 topic: don't cache topic of e.g. memctx in _topiccache (issue6500)
Anton Shestakov <av6@dwimlabs.net>
parents: 6022
diff changeset
43 3: __touch-noise__=* amend_source=* branch=default topic=foo (glob)
6c67219ce779 topic: don't cache topic of e.g. memctx in _topiccache (issue6500)
Anton Shestakov <av6@dwimlabs.net>
parents: 6022
diff changeset
44 4: __touch-noise__=* amend_source=* branch=default (glob)