GSoC Blog Post #4

Another Fortnight gone by, and perhaps this was the time when we got most work done.

This time around I added two new features to mercurial.

They are: The allfiles mode

This would work on a single revision and get all the files that were
there in that revision. So it’s like grepping on a previous state.
Using this with wdir() :: hg grep -r "wdir()" --allfiles is what the
default behaviour is desired for grep.

Link to PR : https://phab.mercurial-scm.org/D3728

 

Then I also added the diff mode: This is a duplicate of the exisitng all flag. Since --all searches diffs, there diff is a better name for it.
The --all flag is still here for backward compatibility reasons.

 

Link to PR : https://phab.mercurial-scm.org/D3763

 

I am working on two more patches right now, will be posting about that in the next blog.

GSoC Blog Post 3

These two weeks I was involved in fixing the `–wdir()`. Yuya had asked me to not create an entire separate if/else block as that might lead to untested code paths.

So I was trying to work out another way. While I was trying to figure out a way to do this I realised the code had changed a bit since my last patch, and it nows throws WdirUnsupported exception. This made my life a bit easier.

After consulting Yuya Nishihara, I caught all the WdirUnsupported exceptions and then treated the changeset objects, file node objects differently that would work.

The patch to this can be found at https://phab.mercurial-scm.org/D3673.

Currently, I am working on adding a mode to grep on unmodified files in a changeset.

More on this on my next post, stay tuned.