1

I am trying to upload my repositories to Bitbucket. It's a parent repository and a handful of subrepos. One of the subrepos is so big (and my connection is throttled) that Bitbucket times out before it finishes the import. I am hopeful that if I make the subrepo small enough I will be able to upload it to Bitbucket and get the parent repo and subrepos workign from there.

Unfortunately, using hg convert to make the subrepo smaller changes the revision numbers, and the parent repo won't let me use the URL for the smaller version of the subrepo in place of the old (larger) subrepo. Is there a way to make a repository smaller while maintaining compatibility with a parent repository?

When I used hg convert, I removed the largest files (which are all older - and pre-date when I started using this repository as a subrepo) and got rid of some of the history from the subrepo. It worked well and dropped the size of the subrepo on my hard drive from 1.73GB to 328MB. Unfortunately, the parent repo won't switch to the new Bitbucket URL. It gives the error abort: repository is unrelated. The same thing happens when I go into the subrepo and try to edit its hgrc to point to the new URL. I thought the option --config convert.hg.saverev=True was supposed to enable clones of the original repository to utilize the new repository, but it has not worked so far.

Here is the command I used to shrink the subrepo: hg convert --filemap C:/Workspace/myFilemap.txt --config convert.hg.saverev=True --config convert.hg.startrev=acc85c96fe57e1ff1def298bdd6adb3c614d2a92 C:/Workspace/Original/subrepo C:/Workspace/NewRepos/SmallerSubRepo

Any tips on how to fix the hg convert command, or how to use another approach to accomplish the same thing, would be appreciated.

Cathalson
  • 11
  • 3
  • So, I still don't know how to shrink the repo and maintain compatibility with the parent repo. However, I did get the original repo uploaded into Bitbucket so work can move forward. The key there was to not use the Bitbucket _import_ function, and instead to just create a new repo in Bitbucket and then push a clone of the repo from my machine up to it. – Cathalson Feb 05 '18 at 21:13
  • You cannot really shrienk the size of the repo or sub-repos themselves. You can create a new repo via convert which ommits parts of the history - but you'd have to do that probably for both, the parent and the child repo as it changes the hashes of commits. And the parent repo looks for the exact repo and the hashes - thus a converted repo won't cut it - it is necessarily unrelated. – planetmaker Feb 07 '18 at 15:18

0 Answers0