evolve: if required, rebase backward when resolving content divergence

This patch makes some update in logic of content-divergence resolution.
Before this patch, we always set the parent of ahead one (from the two
divergent cset) as resolution parent and then make sure both are located
on resolution parent and perform 3-way merge to get resultant cset.

But now, if the reason behind content-divergence is that one side amended
some content changes while other moved backward in the dag (relocated on
one of its ancestor); we set the parent of relocated one as resolution
parent and then make sure both are on resolution parent and perform 3-way
merge.

Note: this change covers the backward movement only for the case when the
moved cset is a direct child to one of its current parent's ancestor.

To check if one of the divergent cset was rebased backward we check if `gca`
is present in the ancestors of base i.e. `::base` because if we rebase a
cset backward it would become a child of one of its current parent's ancestor.

For e.g.
```
..     D' D
..      \ |
..        C
..        |
..        B  D''
..        | /
..        A
..        |
..        ● O
```

Here `D'` and `D''` are divergent from each other, where `D''` rebased backward
and `D'` amended some changes. So here if we see the range `::base` i.e. `::D`
contains `gca` i.e. `A`.

Following is the check which help us to find out if one of the divergent
cset was rebased backward:
	if gca in repo.revs(b'(::%d)-(%d)', basep1, basep1)

Where,
  gca: greatest common ancestor of two divergent changesets
  basep1: p1 of base of two divergent changesets

```
..        C''
..        |
..     C' B  C
..      \ | /
..        A
..        |
..        ● O
```

Above graph will help us understand revset clearly:
1) Obviously we are checking presence of gca in the ancestors of basep1
2) But you might be thinking why base.p1() instead of base:
	because it filters false-positive for e.g. in above graph it would
	have considered it as a backward rebase if it was `::C` (::base)
        instead of `::A` (::basep1) , as you can see `::C` contains A.
   But it still give false positive because `::A` contains the basep1
   i.e. A, which is why we do `(::basep1) - basep1`

Changes is test files reflect the changed behavior.
8 jobs for topic/default/khanchi-tests-content-div-3 in 5 minutes and 46 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #112281
checks-py2

00:01:20

passed #112282
checks-py3

00:01:06

passed #112287
doc

00:00:43

manual #112280
allowed to fail manual
pytype
failed #112283
tests-py2-cext

00:05:45

failed #112284
tests-py2-pure

00:05:39

failed #112285
tests-py3-cext

00:03:27

failed #112286
tests-py3-pure

00:03:56

 
Name Stage Failure
failed
tests-py2-cext Test
Skipped test-check-flake8.t: blacklisted
Skipped test-check-pyflakes.t: blacklisted
Skipped test-check-setup-manifest.t: blacklisted
Failed test-evolve-templates.t: output changed
# Ran 194 tests, 6 skipped, 1 failed.
python hash seed: 3147179847
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py2-pure Test
Skipped test-check-flake8.t: blacklisted
Skipped test-check-pyflakes.t: blacklisted
Skipped test-check-setup-manifest.t: blacklisted
Failed test-evolve-templates.t: output changed
# Ran 194 tests, 6 skipped, 1 failed.
python hash seed: 1777386141
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py3-pure Test
Skipped test-check-flake8.t: blacklisted
Skipped test-check-pyflakes.t: blacklisted
Skipped test-check-setup-manifest.t: blacklisted
Failed test-evolve-templates.t: output changed
# Ran 194 tests, 6 skipped, 1 failed.
python hash seed: 2650117406
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1
failed
tests-py3-cext Test
Skipped test-check-flake8.t: blacklisted
Skipped test-check-pyflakes.t: blacklisted
Skipped test-check-setup-manifest.t: blacklisted
Failed test-evolve-templates.t: output changed
# Ran 194 tests, 6 skipped, 1 failed.
python hash seed: 4002463564
Running after_script
Uploading artifacts for failed job
ERROR: Job failed: exit code 1