tests/test-evolve-content-divergent-first-changeset.t
author Sushil khanchi <sushilkhanchi97@gmail.com>
Mon, 04 Nov 2019 01:30:50 +0530
changeset 5230 39d282fd04e0
parent 4984 b779b40f996e
child 5111 1fe3f7ffb462
permissions -rw-r--r--
evolve: add pre-check logic for content-divergence in rewriteutil.precheck() For now, pre-check will abort if rewriting a rev create divergence (and config experimental.evolution.allowdivergence is not set to True). But this behaviour can be improved where instead of abort maybe we can confirm the user to either proceed with divergence or some other options depends on what command user is running. Changes in test file are used to overrides the pre-check for testing purpose (using experimental.evolution.allowdivergence=yes).

  $ . $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 --config ui.merge=internal: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 12772224141b

  $ hg evolve --list