News for hackers. Stuff that matters.
Re:Python now uses Mercurial by geekam on Saturday March 05, 2011 @02:49PM (#2292172)
But why are they using Mercurial and not Git? I want to what are the advantaged for them to choose Hg.
Re:Python now uses Mercurial by koenigdavidmj on Saturday March 05, 2011 @02:57PM (#2292196)
http://www.python.org/dev/peps/pep-0374/#why-mercurial-over-...

Basically, they wanted a tool that was equally usable on all platforms, which excluded Git on Windows.

They also wanted something written in Python, of course, although they would have sacrificed that in the interest of pragmatism.

Re:Python now uses Mercurial by pestaa on Saturday March 05, 2011 @03:44PM (#2292362)
In all fairness, I'd like to point out it's quite possible to make Git work on Windows. If one can adjust the path, it is also reachable through the same command line Windows folks are used to.
Re:Python now uses Mercurial by tghw on Saturday March 05, 2011 @04:35PM (#2292516)
Quite possibe to make work and works equally well are not the same thing. Mercurial is a breeze to install on Windows and any other platform, and with TortoiseHg's recent move to Qt, full cross-platform GUI support is also there (right now there are no Mac installers, but there should be some soon).
Re:Python now uses Mercurial by AlecSchueler on Saturday March 05, 2011 @04:11PM (#2292441)
As far as I know, Git was a lot more awkward to use on Windows when they started discussing this move a few years ago.
Re:Python now uses Mercurial by pnathan on Saturday March 05, 2011 @06:00PM (#2292738)
I've found git to be a ---- nightmare to use. Part of that is inexperience, part of that its UX is a turd compared to hg.
Re:Python now uses Mercurial by mckoss on Saturday March 05, 2011 @06:26PM (#2292808)
The last time I looked, Git on Windows required you use a different shell than the native Windows command shell (not that I'm a fan of the crappy Windows shell, but it does make it more awkward and feels less "native").
Re:Python now uses Mercurial by cagey on Saturday March 05, 2011 @08:49PM (#2293187)
I've been using MsysGit (Windows) for about 18 months as a "local vcs" wrapper around a sucky vcs (Accurev). Until the most recent MsysGit release, I used the "git bash" shell exclusively: for each Accurev workspace, I had a CMD shell where I ran builds in the w/s, and a git bash shell where I operate git for that w/s. This was mostly satisfactory (being able to write true bash scripts to automate git a tiny bit was cool), but when working with sometimes a dozen or more workspaces, it can get a little time consuming to locate the respective shell's mate. Anyway, MsysGit has mostly worked quite nicely for my limited purposes. However I am now evaluating hg as a possible replacement for Accurev (I'm running a quasi-import over the weekend). I'm also running a git import in parallel (mostly to compare repo size growth over time), and to do that (in lockstep) I'm running git from a CMD shell; so far I've not had any problems using git in CMD (wait, git's interpretation of the %EDITOR% environment variable in CMD is broken). Why hg, after all my experience with git? As mentioned elsewhere in this discussion: MsysGit (git for Windows) is like a "second class citizen"; it's pretty clear that the git creators have a negative religious attitude about Windows, thus expecting equal functionality and support on Windows is folly. The MsysGit discussion threads reflect a shoestring operation, with overwhelmed developers solely scratching their own itch (fair enough as far as it goes). Whereas hg treats Windows as a first class platform (presumably because it was designed and built with that in mind). I still like git's branching feature (which is why I chose it initially over hg), but between hg and git, hg is IMHO the only pragmatic choice for a "Windows shop".
Re:Python now uses Mercurial by Legion on Saturday March 05, 2011 @11:22PM (#2293447)
Most people that use SVN on Windows seem to use TortoiseSVN instead of a command line.

Similarly, most Windows developers that I encounter who run Git just use TortoiseGit. (And TortoiseHg for Mercurial for that matter).

The whole "Git on Windows" issue? Completely overblown.

Re:Python now uses Mercurial by geekam on Sunday March 06, 2011 @02:45AM (#2293737)
Yea, I do think that being written in Python was a big thing. It would be for me, if I were in their place. :)
Re:Python now uses Mercurial by john2x on Saturday March 05, 2011 @07:01PM (#2292905)
I think it's called Git Bash. It isn't so bad though, you get some working Unix commands with it. Come to think of it, I think it's better than CMD, to an extent.
Re:Python now uses Mercurial by tghw on Saturday March 05, 2011 @05:03PM (#2292594)
I find the way your phrase that question interesting. Git and Mercurial are nearly identical in terms of functionality, to the point that converting back and forth between them is pretty trivial. (Example: here's Git's repository in Mercurial https://mirrors.kilnhg.com/Repo/Mirrors/From-Git/Git)

The only real difference between the two are the ecosystems. Mercurial, being written is Python, is very portable and easily extensible. I feel like, because of that, the tools for Mercurial are better. Git has GitHub, and the incredible open source community they've developed there.

* Note, the rainbow road is due to one of the few differences between Git and Hg: Hg does not allow octopus merges, so the conversion turns them to a sequence of two at a time merges. Also, in the interest of full disclosure, I'm one of the devs on Kiln, so I'm certainly biased towards Hg.

Re:Python now uses Mercurial by js2 on Saturday March 05, 2011 @05:53PM (#2292727)
octopus merges are rare in the git.git repo:

  $ git rev-list --merges --parents --tags | awk '{print (NF-1)}' | sort | uniq -c
  4409 2
    22 3
     5 4
     3 5
     1 6
So there's been a total of 31 octopus merges compared to 4409 typical two-parent merges.
Re:Python now uses Mercurial by burgerbrain on Saturday March 05, 2011 @06:48PM (#2292878)
On the other hand, roughly an entire 2% of merges on linus's linux tree have been octopus merges. Hardly something to scoff at.

      5 10
      6 11
      5 12
      3 13
      2 14
      1 18
  14592 2
      1 20
      1 21
      1 24
    129 3
      1 30
     50 4
     25 5
     21 6
     13 7
     18 8
      7 9
Re:Python now uses Mercurial by lloeki on Sunday March 06, 2011 @08:24AM (#2294154)
Relative occurence numbers don't say much about the need for octopus. Maybe they're rare but when the need arises it proves to be an invaluable feature.
Re:Python now uses Mercurial by jrockway on Saturday March 05, 2011 @06:39PM (#2292853)
How many Octocat merges have there been?
Re:Python now uses Mercurial by geekam on Sunday March 06, 2011 @02:43AM (#2293733)
Wow! Nice to meet you. I wish my work was as interesting as yours.
Re:Python now uses Mercurial by xi on Saturday March 05, 2011 @03:06PM (#2292231)
See http://www.python.org/dev/peps/pep-0374/ for the rationale; but keep in mind it's more than two years old so some of the criticisms may not longer apply.
Re:Python now uses Mercurial by null_ptr on Saturday March 05, 2011 @03:46PM (#2292366)
Why would Git be any better? They're both tools that ultimately accomplish the same thing.
Re:Python now uses Mercurial by Peaker on Saturday March 05, 2011 @05:32PM (#2292665)
git rebase -i, git reset --hard, git checkout <any-refspec>
Re:Python now uses Mercurial by masklinn on Saturday March 05, 2011 @05:37PM (#2292686)
hg histedit, hg revert, hg update -r{any revspec}
Re:Python now uses Mercurial by Peaker on Saturday March 05, 2011 @07:19PM (#2292944)
I meant "git reset --hard" as a prefix for useful <refspecs>.

Can hg set the current branch to point anywhere in time?

Does histedit do exactly what "rebase" does? Does it also work with "--onto" and other rebase features?

Re:Python now uses Mercurial by viraptor on Saturday March 05, 2011 @08:51PM (#2293195)
Regarding resetting: hg up -C <some ref> will give you a clean checkout of that ref, discarding any local changes.
Re:Python now uses Mercurial by jbellis on Saturday March 05, 2011 @09:21PM (#2293251)
(Sorry about the accidental downvote. Arrows + phone got me again.)
Re:Python now uses Mercurial by masklinn on Sunday March 06, 2011 @03:03PM (#2294881)
`histedit` does what `rebase -i` does, `hg rebase` does what `rebase` does.

There are a few limitations to `histedit` compared to `git rebase -i` I think: I believe it's possible to split revisions using `rebase -i`, I don't think that can be done using histedit (it has pick, edit, drop and fold). Histedit also misses the (pretty recent I believe) `exec` action of git's rebase -i.

Re:Python now uses Mercurial by elehack on Saturday March 05, 2011 @11:02PM (#2293417)
hg branches are entirely different from git branches, so resetting them in that way doesn't make sense. The closest approximation - bookmarks - can indeed be reset (hg bookmark -f).

histedit does a variety of things; I'm not sure if it covers all of rebase's branches. Mercurial does also have a rebase facility now as well.

Re:Python now uses Mercurial by prodigal_erik on Sunday March 06, 2011 @07:07AM (#2294050)
Hg seems to have evolved several vaguely similar but isolated optional features (named branches, local branches, bookmarks, patch queues) which I guess means they haven't arrived at one everybody's happy with. Some people even prefer to keep hg branches in cloned repos, which sounds very painful. Git handles all those use cases by binding a ref to a commit and calling it a branch (even stashes are stored as branches, just more difficult to push).
Re:Python now uses Mercurial by masklinn on Sunday March 06, 2011 @03:07PM (#2294888)
> histedit does a variety of things; I'm not sure if it covers all of rebase's branches. Mercurial does also have a rebase facility now as well.

That is correct. In Mercurial, git's `rebase` is (sensibly, as far as I am concerned) split into two different commands: `histedit` handles the history edition within a branch and `rebase` handles the rebasing of a branch on a revision of an other branch.

Re:Python now uses Mercurial by ciupicri on Sunday March 06, 2011 @10:12AM (#2294264)
hg: unknown command 'histedit'
Re:Python now uses Mercurial by cageface on Saturday March 05, 2011 @02:58PM (#2292198)
If nothing else it's because Mercurial itself is written in Python.
Re:Python now uses Mercurial by random42 on Saturday March 05, 2011 @03:46PM (#2292367)
Not true.

While mercurial being written in python is noted[1] , it is made explicitly clear, its not the reason behind the main selection of Hg as the version control.

[1] - http://www.python.org/dev/peps/pep-0374/#why-mercurial-over-...

Re:Python now uses Mercurial by HerberthAmaral on Saturday March 05, 2011 @04:16PM (#2292460)
"First, git's Windows support is the weakest out of the three DVCSs being considered which is unacceptable as Python needs to support development on any platform it runs on."

This is FUD! The support for git on windows is pretty good and there is nothing obstrusive in it. You can use git on Windows fairly well. Sad to see this kind of comment written by smart people.

Re:Python now uses Mercurial by Locke1689 on Saturday March 05, 2011 @04:39PM (#2292525)
Git's Windows support is clearly the weakest since it requires either MinGW or Cygwin. The platform itself is unoptimized for native Windows performance. It may not be terrible but it's certainly the weakest of the DVCSs, as they say.
Re:Python now uses Mercurial by HerberthAmaral on Saturday March 05, 2011 @08:31PM (#2293143)
Yes, but when I read the PEP, sounded like this is the biggest motivation to not use Git.
Re:Python now uses Mercurial by cppsnob on Saturday March 05, 2011 @08:03PM (#2293062)
Because... we all know Windows Python users are stylin with the Windows command shell.

I agree with the grandparent, this decision was political.

Re:Python now uses Mercurial by tghw on Saturday March 05, 2011 @04:44PM (#2292539)
Last time I tried TortoiseGit, adding a file either didn't work or just crashed hard. Mercurial, on the other hand, just got TortoiseHg 2.0, which is a pleasure to work with.

It is true that git works on Windows, but that doesn't mean it works well.

Re:Python now uses Mercurial by davvid on Saturday March 05, 2011 @10:08PM (#2293343)
Just curious, have you ever tried GitCheetah? https://git.wiki.kernel.org/index.php/MSysGit:GitCheetah

I've never experienced the crashes you describe but I've never used Tortoise either. YMMV, I suppose.

Re:Python now uses Mercurial by sixtofour on Saturday March 05, 2011 @04:24PM (#2292485)
"Last-Modified: 2010-01-07 23:33:01 +0100 (Thu, 07 Jan 2010)"
Re:Python now uses Mercurial by wzdd on Saturday March 05, 2011 @04:25PM (#2292488)
The PEP was written in 2008.
Re:Python now uses Mercurial by buster on Sunday March 06, 2011 @03:10AM (#2293770)
I've been working on a prject last year which involved a few developers using Windows. It was a nightmare. Myself using Linux, i had no problem. But git on Windows.. It'd definitely behind other VCS.
Re:Python now uses Mercurial by sid0 on Saturday March 05, 2011 @03:48PM (#2292373)
Because Guido has a taste for good UI. </troll>
Re:Python now uses Mercurial by viraptor on Saturday March 05, 2011 @05:11PM (#2292613)
Trolling aside, that's the only reason I chose hg over git for my projects -> sane approach to the UI. With both of them having more or less the same functionality, UI of git is... inconsistent at the very least.