+1 vote
in Other by
I have a local folder, that I know is the tip of my repo, but the .hg folder is not there, is there a way to "connect" this to a repo without having to clone the entire repo again?

What I did was rather than cloning the repo from bitbucket, I clicked download source as zip. But the zip file does not contain the .hg folder, only the source files. So is there a way to connect this local folder back the repo?

I would just run the normal hg clone ... again, however this repo is >8GB and that zip took a long time to download!

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
No, you need the full .hg folder to work in a meaningful way with the repository.

The 8 GB zip file you downloaded was just a single revision. The history is likely to be of a similar size. As an example, the OpenOffice repository has a 2.0 GB working copy and a 2.3 GB repository. So that is a 15% overhead for storing 270,000 changesets! In other words: it's normally better to just clone everything instead of checking out a single revision.

When you run hg clone you're only downloading the .hg folder. Mercurial will then by default checkout the latest revision in the working copy. If it's the checkout step that worries you, then use hg clone -U to get a repo without a checkout. Now move the .hg folder into your existing folder and run

$ hg debugsetparents tip

to tell Mercurial that you've manually copied in the files for the tip revision.

Related questions

+1 vote
asked Feb 1, 2022 in Other by DavidAnderson
+1 vote
asked Jan 30, 2022 in Other by DavidAnderson
...