I read similar posts by SO, the official Hg guide, many articles and tutorials, and itβs still unclear to me what the best Hg workflow for development by feature. Perhaps some of the articles on the Internet are years old and do not include the latest features from Hg. Obviously, there are also many options for how to approach it.
I am a solo developer working on a project where a request for a fix or function will be presented to me as a task, for example, "Task No. 546 - Change Everything." Some of these tasks take several days, and some tasks are open for several months, and often up to a dozen times at a time. The task is sent to the final site after it is approved by the customer.
The Hg manual seems to recommend having a clone for each function. But having a dozen full copies of the site on my drive seems ... wasteful? I try for it, but I saw other sentences that make more sense. Do people really have a dozen copies of each site on their development machine at the same time?
The name of the branches first sounds as I would like, where I would call the branch "task 546", and then merge it back when it leaves. I see a lot of discussion about the persistence of names and the fact that they have so many branches (although they can be closed). Some people seem to care about this, and some do not. I don't know if Hg is enough to know if I care or not, and what the flaws mean.
Finally, bookmarks seem to be popular in later articles, and it would seem that the best way to use them is to set the bookmark as "task 546" and then merge it back into the main branch by fixing the message with the task number in it to save a link to what was done in the work. I know that you can delete bookmarks, but it is unclear whether I need to do this after the final merge.
So, my idea of ββa combined approach is to:
one repo
three named branches:
- "default" which contains the released version of the site
- "dev" on which I really use development
- "test", in which all tasks considered by the client will be performed.
in the "dev" branch, I would use bookmarks for each of the tasks I'm working on, so I have a head for each task.
My workflow for a task / function would be as follows:
- Update to the main line of the "dev" branch with the name
- Launch a new branch using the tab for the task "task number 123"
- Commit the changes until I am ready for viewing by the client.
- Merge task 123 into the test branch
- Deploy a βtestβ on a test server
- Repeat commit, merge, deployment until ready for release
- When approved, merges with the main line of the "dev" branch with a commit message that includes the task name
- Merge "dev" into the "default" branch.
- Expand the "default" branch on the real server
- Merge "default" into branches of open functions
Thoughts? Can I best have a clone for each function and the live and test repos I click on?
Edit: I see through some links that I should do "default" development, so my first change in my list will be to use the "production" branch instead of the "dev" named branch.