Recently, the upstream for media-tv/em28xx-new (in sunrise) created their mercurial repository from scratch again. This made mercurial_fetch() fail with "abort: repository is unrelated" when a clone of the previous repository existed in ${DISTDIR}/hg-src A workaround is to remove the old directory, or setting the following in the ebuild: EHG_PULL_CMD="hg pull --force --quiet" Please consider adding --force to the default EHG_PULL_CMD in mercurial.eclass Reproducible: Always Steps to Reproduce: 1. emerge a package which uses mercurial.eclass 2. create the repository that EGIT_REPO_URI points at from scratch again 3. try to the package emerge again Actual Results: mercurial_fetch() fails with "abort: repository is unrelated" Expected Results: pull from the new repository
correction to comment 0: that should read EHG_REPO_URI in Step 2
As upstream messing in such way with its repository isn't a common thing I'm quite reluctant to do so. In my opinion defaults in eclass should work for most cases, and are ... defaults - to be overridden by ebuilds.
If upstream does not mess with its repository, --force will not make any difference. Do you think there are any cases where this option can break things? The only issue I can think of is two mercurial packages with the same name and in different categories will replace each other's repository on merge (instead of failing), resulting in unnecessary traffic.
I think that upstream messing with their repository is happening seldom enough that --force is not needed - in such cases just remove the current working copy and repository.