Monday, September 30, 2013

Create a subrepository in Mercurial!

  1. Pull down the code for the parent-to-be repository into a folder.
  2. Make a new folder within the repository and pull down the child-to-be repository into the new folder. (I did not see an option for "Clone..." beneath the option for "TortoiseHg" when I right-clicked on the folder I made and this was probably so as the folder already sits inside of another repository's folder structure. I got around this by right-clicking on a random folder elsewhere, picking "Clone..." and then setting the values for both Source and Destination appropriately.)
  3. Add a line to the .hgsub file in the root folder of what has been pulled down for the parent-to-be repository like so:
    mysubordinate = http://ourserver01/FogBugz/Kiln/Code/Stuff/Whatever
    ...if the child-to-be repository is pulled down into a folder called "mysubordinate" which sits in the root of the parent-to-be stuff along with the .hgsub file. If you want to nest the child-to-be repository a few folders deep you may do something like this:
    build/mysubordinate = http://ourserver01/FogBugz/Kiln/Code/Stuff/Whatever
    ...herein "build" could be a preexisting folder or a newly made one existing only to buffer the subrepository from the repository a little bit.
  4. Commit the changes to the parent-to-be repository both locally and then to the server.

No comments:

Post a Comment