Sunday, June 24, 2012

Gsoc: Patch Index Week 5

 This week I worked on support for directories in patch index changes, testing the correlation between patch index and existing commands, and some minor refactoring.

Implementation of directory support in changes
 Patch index changes uses patch index to filter out the unrelated patches of the repository. A patch that does not modify any selected file gets filtered out. A file will be selected if it had a path that is a subpath of the given directory at any point in the repository history.

Tests on correlation:
I have tested for correlation on changes with files using the below script. I ran the script on darcs screened repository, and found that it succeeded on all files. A similar script for annotate has also succeeded.
Changes on directories fails to give the same output, with a simple example given below: In the above example, the patch index version fails to give the middle two patches. This is so because the file a was never under dir2 at any point in repository history. An implementation which checks if the file was in the given directory's history will solve this issue.
  However, I found that the patch index version was as slow(and sometimes slower) as the current version for src of screened. I suggest that we either:

  •  Use patch index only on small directories, and fix the above bug
  •  Change implementation of patch index, so that it directly stores the relevant patches of a directory
Testing annotate on directories proved to be difficult. This is because patch-index annotate can give all the output of current annotate and still fail. Annotate on directories could fail for a particular file or sub directory, giving an unknown as a corresponding patch. Somehow, patch index annotate may succeed for a file even when current annotate fails. The current output format makes it difficult to filter out the "wrong" cases.

I have also tested the correlation when various options are passed. I yet have to find a case where a patch-index command gives a different output when compared with the current command (when applied on a file).

For the next week, I plan to get the code up to mid term inspection. My mentors gave me the following criteria:

  1. that it does what is intended
  2. that it supports all of the options
  3. that the code itself is of push-to-mainline quality
  4. and there are adequate tests
I am to give priority to the first goal of the project (automatic update of patch index). For now, this means
  • implementing --patch-index and --no-patch-index for all relevant commands
  • fixing a bug where patch index was assumed to exist when loading patch index
  • some refactors
  • more tests
I am now using the rebased repo created by Eric. Find my fork here.

No comments:

Post a Comment