Mercurial > evolve
view tests/test-evolve-content-divergent-first-changeset.t @ 6574:054a7c342463
topic: use distinct names for distinct origvalidator and _validate()
Here, the same topicrepo.transaction method, we set up various transaction
validators. On older hg versions (5.3 and older) this involves storing the
original transaction validator (i.e. tr._validator function) and creating a
wrapper function to use as the replacement.
In cases when multiple
topic-related validators were needed, the code used to store tr._validator
multiple times, and create a wrapper function that used origvalidator multiple
times as well. In such cases we can no longer use the same names for the
functions/variables, as they are used inside multiple validator functions, but
are going to be overridden by later assignments/definitions (due to the shared
names), since it's done in the scope of the same topicrepo.transaction().
Names can be better, but it'll do for now, and at some point we'll simply drop
compatibility for 5.3, which should happen relatively soon.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 14 Oct 2023 15:53:40 -0300 |
parents | 83ceafbaa7d6 |
children | 88f9bbba392d |
line wrap: on
line source
$ . $TESTDIR/testlib/pythonpath.sh $ cat >> $HGRCPATH << EOF > [extensions] > evolve= > [experimental] > evolution.allowdivergence = True > EOF This test file tests the case of content-divergence resolution of changesets that have the null revision as the parent. $ hg init issue6201 $ cd issue6201 $ touch test $ hg add test $ hg commit -m test $ hg log -T '{node|short}\n' be090ea66256 $ echo a >> test $ hg amend -m div1 $ hg log -T '{node|short}\n' 79fa0eb22d65 $ hg up be090ea66256 --hidden --quiet updated to hidden changeset be090ea66256 (hidden revision 'be090ea66256' was rewritten as: 79fa0eb22d65) working directory parent is obsolete! (be090ea66256) $ echo a >> test $ echo b >> test $ hg amend -m div2 2 new content-divergent changesets $ hg log -T '{node|short}\n' 4b2524b7508e 79fa0eb22d65 $ hg evolve --content-divergent --tool :other merge:[1] div1 with: [2] div2 base: [0] test 0 files updated, 1 files merged, 0 files removed, 0 files unresolved working directory is now at 62fcb3488421 $ hg evolve --list