Embedding a github repository inside a mercurial (kiln) repository – how integrated is it?

Summarised Question:

Are github-hosted sub repositories within a mercurial/kiln repository possible, and if so are they automatically updated/cloned when the parent mercurial repository is operated on by a hg clone or hg commit command?

  • How can I get the SHA of a GitHub commit in Java?
  • How can I upload fresh code at github?
  • How to trigger jenkins every time a repository is created on github org?
  • Pip installing from github installs only __init__.py file
  • Create a branch for a new feature on local branch only or on both local and remote branches?
  • Redirecting git/github project to fork?
  • Detailed Question:

    Following on from my question that was answered so excellently here , some of my third party code is in folders I downloaded a while ago from opensource efforts on github. Since at that stage I was not using version control, those folders where just standard folders that now been incorporated as sub repositories in mercurial.

    This is obviously not ideal, as for one thing, new versions of the libraries may have bug fixes, or new features I wish to use in the future. I also may need to locally customise some of the libraries.

    I can see from reading this link that it possible to have mercurial “know” about those git server urls (and revisions), so I can then have mercurial clone the github hosted libraries direct from their parent repos.

    Am I right in saying that when I clone the parent (mercurial) repos, those files will be pulled from github, without having to separately manage this using git?

    What is also not clear is, if I were to do this, and it transpired that code might need to be customized from within that github-cloned repository, would I need to use git to manage revisions of the local files, or would mercurial do that by proxy? eg id I were to hg commit -S would mercurial invoke git on my behalf to handle that?

  • How to use git with ssh on github https repository addresses?
  • Somehow managed to push a different repository onto Github
  • In Git, can you retrieve the date when you pulled a certain commit from the repo?
  • git push update issue
  • GIT: How can I do a pull request when I've already commited to my master branch?
  • Okay to push directly to gh-pages branch without pushing to master branch?
  • One Solution collect form web for “Embedding a github repository inside a mercurial (kiln) repository – how integrated is it?”

    Am I right in saying that when I clone the parent (mercurial) repos, those files will be pulled from github, without having to separately manage this using git?

    Yes, clone of a Mercurial repository that contain subrepositories will trigger a clone of the subrepos too. It really happens on update. Mercurial notices the .hgsub file and issues the needed hg clone and git clone commands for you. It uses the information in .hgsubstate to know exactly what revision to checkout.

    The subrepositories can be hosted anywhere. For a Git subrepository declared like

    foo = [git]https://github.com/user/repo.git
    

    Mercurial will simply issue the corresponding clone command:

    git clone https://github.com/user/repo.git foo
    

    It’s then your reponsibility to later go into the foo repo and use Git to fetch new commits as necessary. After you fetch/pull new commits, you can make a top-level commit to record the new state of the subrepo in the .hgsubstate file. Use hg summary to see if a subrepo is dirty in this sense.

    […] would I need to use git to manage revisions of the local files, or would mercurial do that by proxy? eg id I were to hg commit -S would mercurial invoke git on my behalf to handle that?

    When you edit files and make a top-level hg commit, Mercurial will make sure to commit the subrepo first (if you use hg commit -S or if ui.commitsubrepos=True). If you make a top-level push, then Mercurial will always push the subrepos first so that you always have a consistent set of changes on your server.

    Git Baby is a git and github fan, let's start git clone.