evolve: add tests of relocation case in public divergence
These tests cover the cases when "other" is behind the "public"
one and we would have to relocate "other" here. It covers
all the conflicting and non-conflicting cases.
#!/bin/sh# setup config and various utility to test obsolescence marker exchanges testscat>>$HGRCPATH<<EOF[web]# We test http pull and push, drop authentication requirementpush_ssl = falseallow_push = *[ui]# simpler log outputlogtemplate ="{node|short} ({phase}): {desc}\n"[phases]# non publishing serverpublish=False[experimental]# reduce output changesbundle2-output-capture=True# enable evolutionevolution=allevolution.effect-flags = yes[extensions]# we need to strip some changeset for some test caseshgext.strip=[alias]# fix date used to create obsolete markers.debugobsolete=debugobsolete -d '0 0'[extensions]hgext.strip=EOFecho"evolve=$(echo$(dirname$TESTDIR))/hgext3rd/evolve/">>$HGRCPATHmkcommit(){echo"$1">"$1"hgadd"$1"hgci-m"$1"}getid(){hglog--hidden--template'{node}\n'--rev"$1"}setuprepos(){echocreatingtestrepofortestcase$1mkdir$1cd$1echo-pulldesthginitpushdestcdpushdestmkcommitOhgphase--public.cd..echo-mainhgclone-qpushdestmainecho-pushdesthgclone-qmainpulldestecho'cd into `main` and proceed with env setup'}inspect_obsmarkers(){# This exist as its own function to help the evolve extension reuse the tests as is.# The evolve extensions version will includes more advances query (eg:# related to obsmarkers discovery) to this.echo'obsstore content'echo'================'hgdebugobsoleteecho'obshashtree'echo'==========='hgdebugobsrelsethashtreeecho'obshashrange'echo'============'hgdebugobshashrange--subranges--rev'head()'}dotest(){# dotest TESTNAME [TARGETNODE] [PUSHFLAGS+]## test exchange for the given test case.## This function performs push and pull in all directions through all# protocols and display the resulting obsolescence markers on all sides.testcase=$1shifttarget="$1"if[$#-gt0];thenshiftfitargetnode=""desccall=""cd$testcaseecho"## Running testcase $testcase"if[-n"$target"];thendesccall="desc("\'"$target"\'")"targetnode="`hg -R main id -qr \"$desccall\"`"echo"# testing echange of \"$target\" ($targetnode)"fiecho"## initial state"echo"# obstore: main"hg-Rmaindebugobsolete|sortecho"# obstore: pushdest"hg-Rpushdestdebugobsolete|sortecho"# obstore: pulldest"hg-Rpulldestdebugobsolete|sortif[-n"$target"];thenecho"## pushing \"$target\""frommaintopushdesthg-Rmainpush-r"$desccall"$@pushdestelseecho"## pushing from main to pushdest"hg-Rmainpushpushdest$@fiecho"## post push state"echo"# obstore: main"hg-Rmaindebugobsolete|sortecho"# obstore: pushdest"hg-Rpushdestdebugobsolete|sortecho"# obstore: pulldest"hg-Rpulldestdebugobsolete|sortif[-n"$target"];thenecho"## pulling \"$targetnode\""frommainintopulldesthg-Rpulldestpull-r$targetnode$@mainelseecho"## pulling from main into pulldest"hg-Rpulldestpullmain$@fiecho"## post pull state"echo"# obstore: main"hg-Rmaindebugobsolete|sortecho"# obstore: pushdest"hg-Rpushdestdebugobsolete|sortecho"# obstore: pulldest"hg-Rpulldestdebugobsolete|sortcd..}