OozeMeister
OozeMeister

Reputation: 4859

Mercurial - Clone another repo upon clone

I am currently taking a class where the teacher is collecting our homework by cloning our individual homework repos; we have a new repo per homework assignment. I've been writing a bunch of helper functions and in order to use those functions I've just been copying and pasting into each new homework assignment.

What I want to do is create another repo that holds all of my utility functions so I can maintain a single, up-to-date, codebase. Is there any way that when my teacher clones my homework assignment repo, I can have it also clone my includes repo and include that in the same directory?

I'm looking for a functionality similar to running pip install git+ssh://mygitrepo.git where you can have the setup.py auto install the dependencies.

Upvotes: 2

Views: 44

Answers (1)

Tim Henigan
Tim Henigan

Reputation: 62168

This sounds like a good application of subrepos.

Your helper files could live in a stand-alone repository. Then each assignment could include a link to it. When the teacher clones the assignment and then updates to a specific revision, it automatically clones the subrepo.

Upvotes: 3

Related Questions