Say your workflow involves one central repository, and several Kiln branches/forks, where you do most of your work. What are the basic procedures you should be using to make sure things don’t get out of sync?
First, you don’t really have to worry much about getting out of sync. The only risk that increases with time is a greater likelihood that you will have a conflicted merge of some kind. But that isn’t really a bad thing, it just means that you will have to make some decisions about what to do when you merge your changes with the changes that happened in the parent. The merge you ultimately perform is still going to be tracked by source control, which means you can roll it back and do it over. And no matter how long you wait, you can still perform the merge on your machine, build, and test before pushing it back to your branch or the parent.
That said, there are some guidelines/procedures that I use when I’m working in a Kiln branch/fork, using Mercurial:
- If I am working on something that is short-lived (two weeks or less) in an active project (lots of development happening in the parent), I generally fetch from the parent each day before I start working. For things that are longer lived, I usually have a sense of when to pull (big update made in the parent that I see in an activity filter) or when I am getting ready to merge back in. It’s more of a judgement call in this case.
- I never push code to the parent unless it is complete and ready for use by others. That means I’ve tested it as best I can, and I’m confident that it isn’t going to break things for other people.
- I think the previous answer addresses your second and third question, but to put a finer point on it, it doesn’t really matter how many branches/forks you have, you shouldn’t push to the parent unless guideline 2 has been satisfied.
As for keeping my branch/fork up to date, it is pretty straight forward:
- Commit and push any outstanding work from your local repository to your “branch repository”/fork on the server.
hg ci -m "Commit message here"
- Fetch (an hg extension installed by default if you install the Kiln Client) any changes from the parent repository.
hg fetch https://your.kilnhg.com/Repo/your/parent/repo
Fetch will automatically attempt a merge if it is needed, and as long as there are no conflicts, it will commit the merge for you. If there are conflicts, you will need to address them and commit the merge once you’re done.
- Build/Test my code, and then push to my branch/fork
Once this is done, your local repository, Kiln “branch repository”/fork, and Kiln parent repository will all be in sync. You can actually push back to your parent repository right now without conflicts (assuming no one has pushed to the parent repository while you were syncing things up).
hg push https://your.kilnhg.com/Repo/your/parent/repo
You can use the same procedure to sync between multiple branches/forks. The difference would be that anywhere I’ve used the
https://your.kilnhg.com/Repo/your/parent/repo, you would use