GSoC Blog post #6

At the beginning of this week, my previous commit was revert and set to config = False, meaning that it is hidden behind that config option. That’s because it was a period of code freeze in mercurial as the next release is due in some days, so unless a feature is completely tested it can’t be released.

Link to the revision:

Next Yuya told me to work on passing multiple revisions with –all-files mode.

I have had some code developments related to it posted on BitBucket.

The work is currently in progress at

This patch needs to handle some edge cases which I am trying to figure out like making it compatible with –diff flag, also this needed to be backed up some testing, which I am writing as of now. This is the final leg of my proposal. Rest remaining is documentation and writing more steps.


GSoC Blog Post #2

So it is two weeks into the coding period and I thankfully haven’t fallen much behind my own set timeline.

The tasks that I had set this week were fixing the--all flag and fix the working directory grep. Thankfully I had done major of this work during/after submission. The fix of the --all was tested and merged and is a part of the stable version of hg now.

Here is the issue it fixed with grep :

Here is the link to my revision that is merged :

The best part of the issue was that fixing it took just changing two lines. The point is that it’s not the number of lines you that matter, it’s the impact that the code has. I must admit that I might have just got this accidentally. And this is the beauty of open source, that issue was open for five years and was one of the bottlenecks of my GSoC project. This reminds me of a quote (Linus Law) “Given enough eyeballs, all bugs are shallow”.

I wrote a detailed blog on this subject you can read more about it :

I had a video chat with my mentors Jordi and Pulkit. We discussed how to go ahead and work on the remaining of the Grep Plan. Jordi pointed out that making grep accept revision ranges and work on the working directory might be challenging. He assigned me this task till the first evaluations.

I already have a patch in the working directory, but there is a lot of scope for improvement on that, I am working currently on making it support the argumentwdir() in the -r flag.

The way I plan to do is catch it as an exception and handle it separately. This was concluded by a discussion with Yuya Nishihara. There are still other problems that I think may lay ahead. I am also having some doubts lately which I had been asking on the #mercurial, and have got suggestions from the community.

In short, the first two weeks as Google Summer of Code student has been great. Looking forward to the upcoming weeks and more commits.

Edit: Here is the link to the patch that I have sent and is currently working on :

Yuya has reviewed and given this comments :

This patch appears to do 3 separate things by adding a big “if” branch.

  • * fix grep -r 'wdir()'
  • * add mode to include unmodified files
  • * change the default
  • It’s probably better to write one (or more) patches for each change, in a way not duplicating code for each combination of possible options.

So I am currently working on breaking into separate patches handling the three things separately!