Welcome Guest, Not a member yet? Register   Sign In
How do you guys use Mercurial
#1

[eluser]mvdg27[/eluser]
Hi guys,

Since CodeIgniter moved from SVN to Mercurial and BitBucket, I got interested in using it for my projects as well. I've checked out several howto's on the topic, and it looks like a very useful tool for a more structured way of developing.

I've done some testing, and I think I'm understanding the workings of BitBucket. But I'm still a bit confused on how to structure my repositories.

What is a smart way of managing the current stable version that occasionally needs bugfixes, and a beta version where we develop new functionality. And say we start building a new forum module for the CMS and also a new photo album, do we then clone the beta repository to work on both new modules, or do we clone the beta repository twice. One for each new module?

In other words, I'd be happy to hear from you guys how you structure your repositories using Mercurial and BitBucket.

Thanks in advance!
#2

[eluser]CroNiX[/eluser]
I don't use Mercurial (except to retrieve CI2), but it is similar to Git from what I understand, which we have been using for years. (we just grab it and commit it to our git repo)

Basically, you create a new branch. Do your new features or whatever on that branch and when you are done, merge them back into your main (stable) branch. There are lots of different workflows depending on how many people you are collaborating with, if any, but that's basically it.
#3

[eluser]mvdg27[/eluser]
Hi CroNIX,

Thanks for your reply. I've been thinking a bit more about it, and I'm now thinking of making a structure like this:

- Stable repo
- Beta repo (fork of Stable)
- Fork of Beta repo 1 (building a forum module)
- Fork of Beta repo 2 (building a photo album module)

But one thing I'm wondering about is this: if we do bugfixes on the Stable repo (like typos etc.), these errors would most probably exist in the Beta repo's as well. Is it true that you would just push them to all of the beta repo's?
#4

[eluser]Nick_MyShuitings[/eluser]
That would be "merging"... I highly suggest a quick read of this webpage by Joel Spolsky: http://hginit.com/

He covers edge cases, setups, how to, and it will only take you about a half of an hour before things start to click for ya.

Best of luck.
#5

[eluser]pickupman[/eluser]
That website is a great read. It is what got me over the hump when switching from subversion.
My work flow is fork(clone) at the revision you need the bug fix for. Fix your code and then pull the fix back into your repo. This is where tagging for versions is a lot better than compared to subversion. If you take a look at tortoise HG with the codeigniter repo, you can see this happening.
I think all of your forward moving versions be kept in the default trunk, and clone/merge in bug fixes. This will allow you to roll back to any revision.
I switched about 3 months ago and it felt really strange at first because of not needing a central server. Bitbucket is kind of like that. You can pull changes from anyone and commit all the time. Handy if you need to back up a little bit and not mess up what you may have committed to the server.
#6

[eluser]frist44[/eluser]
We have a central repo on our dev server. Each developer has the repo on their local machine where testing is done. Everything is pushed to the central repo and tested on the dev server. It's centralized but workable offline. Much nicer than Subversion for our use.
#7

[eluser]mvdg27[/eluser]
@Nick_MyShuitings - That's a great read! Very clarifying, I'm starting to understand it better now.

@pickupman - So basically you create a fork if you are going to do a major bugfix (I guess typo-level bugs can be done directly in the stable repo?). And once you are sure the bug is fixed you send a pull the changes in the bugfix repo into the stable repo. Correct?

@frist44 - Even though we have a small team, this is indeed one of the advantages I'm seeing as well in Mercurial.




Theme © iAndrew 2016 - Forum software by © MyBB