(corrupt repo, repaired) pushing remote has heads on branch 'default' that are not known locally

Simon King simon at simonking.org.uk
Mon Jul 25 08:37:29 UTC 2016


On Mon, Jul 25, 2016 at 9:13 AM, Uwe Brauer <oub at mat.ucm.es> wrote:
>
> Hi
>
> I have a repo (which is also in bitbucket). I had a corruption in that
> repo, which I was finally able to resolve, following the
> instructions found in the website
>
> https://www.mercurial-scm.org/wiki/RepositoryCorruption#Recovery_using_convert_extension
>
> However after committing some changes I wanted to push that repo and I
> received
>
> searching for changes
> remote has heads on branch 'default' that are not known locally: 1aea182c63f3
> remote has heads on branch 'exam-geo2-2016-parts' that are not known locally: 4289b2
> ad5120
> abort: push creates new remote head 57f89fc534c9!
>
>
> So I run
>
>  hg push -f --new-branches
>
> And everything seemed fine. However I receive still the message (when
> pushing again):
>
> remote has heads on branch 'default' that are not known locally: 1aea182c63f3
>
> What should I do, clone and then try to merge?
>

By using the convert extension, you've created an "alternate history"
of your project - this is what the warning at the beginning of the
section means when it says "Be forewarned that this will result in new
hashes for all revisions and will require all users to re-clone from
the recovered repository".

Depending on exactly how you ran the conversion, the new history might
be *completely* detached from the old history, or it might share the
history up to a certain point before branching off. The repository
that resulted from the conversion may have contained very similar (or
identical) content, but because revision hashes have changed,
mercurial considers them to be different. Since you've pushed them to
your bitbucket repository, that repository now contains both the old
and the new history. You're getting the "remote has heads that are not
known locally" message because your local repository doesn't contain
the old version of the history.

How you resolve this depends on what you use the bitbucket repository
for. If it is just for personal use, perhaps as a backup, then I would
probably rename the bitbucket repository and create a new empty one in
its place. Then you can push the results of the conversion to the new
empty repository. (The renamed one can be deleted once you are
*completely certain* that you don't need anything from it).

Hope that helps,

Simon



More information about the Mercurial mailing list