Recommended way to coordinate versions of multiple dependent mercurial repositories?
Asked Answered
T

1

6

Well, after many hours of reading and trial and error, it has finally hit me. Mercurial doesn't really want to do SubRepos...at least not with TortoiseHg and Bitbucket. If I am mistaken, and you don't want a down vote for a rude response similar to "of course it works, didn't you read the official docs", then please provide a simple example of how to do so via TortoiseHg latest that will successfully push to Bitbucket. Maybe a open source project that utilizes mercurial and bitbucket and subrepos?

All that said, if we keep our class libraries in seperate repos, and the recommended approach is to not use subrepos ("as a last resort"), what is the recommended way to capture a version for all dependent mercurial repos whereby i can quickly jump all dependency repos to the correct version for bug fixes and the like.

I suspect I would use Tags to tag a version. So, is the recommended way to manually go to all libraries and tag each repo with the common version tag and then revert back to that tag for all assemblies, manually?

Please refrain from all the of the technical jargon about the complexities of workflow management. There is a ton of great reading regarding this on SO. I am hoping for a simple single main exe project with a few DLL class libraries.

Tandratandy answered 18/12, 2012 at 13:49 Comment(5)
Sounds like a need for a Mercurial extension to handle referenced (but not sub-) repositories, to me.Left
I've provided a simple example here: bitbucket.org/SteveKaye/mainrepo I don't have any problems cloning, updating and pushing it from the main repo.Cerement
@SteveKaye Thank you for this simple example. Can you review my steps to see if I'm doing something in the wrong order? 1) Created MainRepo folder (right-click -> create repository here) 2) Committed Changes 3) Created inside MainRepo a folder called SubRepo (right-click -> create repository here) 4) Commited Changes to SubRepo 5) Repeated 3 and 4 for SubRepo2 6) In TortoiseHg, added SubRepo and SubRepo2 as SubRepos 7) Committed Changes to MainRepo 8) Push to BitBucket... repository is unrelated In BitBucket, I started with new repositories. This would have been the initial push to BitbucketTandratandy
@SteveKaye Thank you again for the example. I found that TortoiseHg was formatting the .hgsub file like this "subrepo = subrepo" instead of like your example "subrepo = ../subrepo". In the Windows world...the "../" suggests it is going up one level from the .hgsub file which is not the case. I have my subrepo directories setup like yours. I believe I have a working version. Thanks so much!Tandratandy
I haven't had reason to try it myself, but it's sounded like some people have been having good experiences with the guestrepo extension as an alternative to subrepos. Perhaps it doesn't have as many issues with hosting provider support? bitbucket.org/selinc/guestrepoAbettor
T
2

Thanks to @SteveKaye, I have a working solution. When using TortoiseHg to "Add a subrepository", TortoiseHg was formatting the .hgsub file like this

subrepo = subrepo

instead of like his example

subrepo = ../subrepo

If someone would like to comment why the relative "../" is required, that would be great. My directory structure is the following:

MainRepo/
         .hgsub
         SubRepo/
         SubRepo2/

if "../SubRepo" is relative to .hgsub, wouldn't the ../ go up one directory and then look for the folder called SubRepo? Oh well, I can conform :) or be corrected if ../

Having Steve's example helped me to see what was off.

Tandratandy answered 18/12, 2012 at 22:58 Comment(1)
I've added an answer to your first question that should explain this.Cerement

© 2022 - 2024 — McMap. All rights reserved.