3 ms·
OK I just finished the first block (Subversion Reeducation) and one of the main points he makes is In Mercurial, every developer has their own repository, livin
by ams6110 17y ago
OK I just finished the first block (Subversion Reeducation) and one of the main points he makes is In Mercurial, every developer has their own repository, living on their desktop
But if you read the subversion book, or any other good tutorials, you know that developers using svn can just as well make their own private branches
So under branches/ I can have bob/ sue/ alice/ and they can have copies of trunk (or other branches) to their hearts content.
So why is this a big "win" for Mercurial?
(Will read the other sections later, no time now)
- anthonyb 17y agoIt's a win for DVCS in general, not just Hg. A couple of use cases off the top of my head: * I can take my repository on the train/bus/wherever and still commit. * If I'm working with someone who needs to use my 'buggy' code I can push just to their repository (or they can pull from mine). * I can have my own workflow and create as many branches, checkouts, etc. as I need. Of course, the example that he gives there is bizarre - effectively the Hg equivalent of hanging onto your code for 6 weeks and then merging all at once...
- nkassis 17y ago2 and 3 are easily done in SVN also. 2 is basically merging your changes in personal branch to the personal branch of another user. 3. Well your branch in SVN is your domain, do what you want. I think the main advantage is really for larger groups. Having 3000 branches in the linux repo would be unmanageable. Also, private branches are something SVN can't do to my knowledge. If I want to hack on a git repo without anyone knowing, it's easy. But there's many advantages to GIT/Mercurial over SVN/* aside from the "everyone has a repo". I love git but currently use SVN due to legacy and keyword expansion at work and it's not that bad.
- ecoffey 17y agoHere is how I (try) and explain it to my coworkers when they say "svn branches as well". You are right. Svn can branch. Can. But branching in svn is always a dangerous proposition. There are a lot of mechanics involved with branching it right initially, making sure that branch is properly tracking Trunk (you have to constantly merge from Trunk down into the branch to hedge the bets on eventually merging that branch back into Trunk). Properly merging a big branch into Trunk is also an undertaking, and more importantly, it requires the whole team to know its happening and "Be careful checking stuff in for I AM MERGING". Also branches in svn aren't private. Anyone can see them. They are private by convention sure. So compare all that workflow with a DVCS. The branching is free. It happens all the time and you never notice it. The merging is smarter, because it has to be, and the history is more complete, because it has to be to enable the merging. When you do consciously branch it's a quicker, more robust operation. Doing big scary feature branch merges isn't as scary since they're happening privately before you push back to the (culturally defined) central repo. Yes you still have to merge from "trunk" to branch in DVCS but, again, it's a baked in feature since thats how you pull changes from someone else (for example in git you fetch changes from the central repo into remotes/master and then merge them into your master. Same operation as merging master into feature branch, or branch into master). Yes you can walk to San Francisco from New York. But you can also Fly. That's the end of my rant. Obviously it's based on my experiences with these tools and not yours. Just trying to give some context and justification.
- stevelosh 17y agoYou're ignoring the "living on their desktop" part. Sure, you can make "private" branches (not actually private) with SVN, but they're still on the server. That means: 1. You can't commit to them (or check out from them) when you're offline. 2. Commits, checkouts, diffs against older revisions, etc are slower when you are online. 3. Bisecting would be painful because of point 2. 4. You can't make a bunch of commits and fold/reorder them with something like the HistEdit extension because someone may have seen them.