openmicroscopy/snoopycrimecop — pull request #143 by sbesson (2014-02-06 23:06:21+00:00)
Title: Merge commands filter refactor

This PR does not add any new features but refactors the entire filtering logic for all the `scc` commands involving filtering. The main features of this changes set are the following:
- separation of filter parsing and logging logic
- dynamic definition of include/exclude filters (initialised to `{}`)
- refactoring of the submodule PR inclusion/exclusion logic, e.g `-Iuser/repo#nr` is now stored under the `user/repo` key of the `include` filter
- reduce code complexity and nesting

This PR also provides the foundation for future inclusions of non-PR branches in `scc merge` /cc @chris-allan

To test this PR, check all the tests are passing. Also check the logic of the main filtering command `scc merge`, `scc set-commit-status` and `scc travis-merge` is not altered. /cc @knabar

Example
```
sebastien@jrs-macbookpro-25399:openmicroscopy (dev_5_0) $ python ../snoopycrimecop/scc/main.py merge dev_5_0 --info -E exclude -E openmicroscopy/ome-documentation#646 -E openmicroscopy/bioformats#888 -E openmicroscopy/bioformats#889 -S success-only -I user:imunro -I pr:2055
2014-02-06 23:01:32,431 [ scc.merge] INFO Listing PRs based on dev_5_0 opened by any public member of the organization
2014-02-06 23:01:32,431 [ scc.merge] INFO Excluding openmicroscopy/bioformats PRs 888, 889
2014-02-06 23:01:32,432 [ scc.merge] INFO Excluding openmicroscopy/ome-documentation PRs 646
2014-02-06 23:01:32,432 [ scc.merge] INFO Excluding PRs labelled as exclude
2014-02-06 23:01:32,432 [ scc.merge] INFO Including PRs 2055
2014-02-06 23:01:32,432 [ scc.merge] INFO Including PRs opened by imunro
2014-02-06 23:01:32,432 [ scc.merge] INFO Excluding PR without successful status
2014-02-06 23:02:45,732 [ scc.merge] INFO Repository: openmicroscopy/openmicroscopy
2014-02-06 23:02:45,732 [ scc.merge] INFO Candidate PRs:
2014-02-06 23:02:45,732 [ scc.merge] INFO # PR 2055 mtbc 'fix #11877: move import logs to upload jobs instead of annotations'
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 2069 manics 'Insight manifest changes for webstart #11772'
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 2071 joshmoore 'Final in-place fixes'
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 2073 joshmoore 'Fix dual dirs in the mac zip for insight'
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 2074 jburel 'Ij insight fixed'
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 2075 joshmoore 'Separate PluginLoggerImpl from LoggerImpl'
2014-02-06 23:02:45,733 [ scc.merge] INFO
2014-02-06 23:02:45,733 [ scc.merge] INFO Repository: openmicroscopy/bioformats
2014-02-06 23:02:45,733 [ scc.merge] INFO Excluded PRs:
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 889 joshmoore 'Logback conversion' (pr: 889)
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 893 melissalinkert 'Test compile targets with Travis' (status: failure)
2014-02-06 23:02:45,733 [ scc.merge] INFO Candidate PRs:
2014-02-06 23:02:45,733 [ scc.merge] INFO # PR 887 imunro 'Implement pre-loading for .sdt files in the interest of performance.'
2014-02-06 23:02:45,734 [ scc.merge] INFO # PR 890 melissalinkert 'CZI: make sure that SubBlocks are correctly initialized in openBytes'
2014-02-06 23:02:45,734 [ scc.merge] INFO # PR 892 melissalinkert 'Update JPEGTurboServiceImpl.java (rebased onto dev_5_0)'
2014-02-06 23:02:45,734 [ scc.merge] INFO
2014-02-06 23:02:45,734 [ scc.merge] INFO Repository: ome/scripts
2014-02-06 23:02:45,734 [ scc.merge] INFO
2014-02-06 23:02:45,734 [ scc.merge] INFO Repository: openmicroscopy/ome-documentation
2014-02-06 23:02:45,734 [ scc.merge] INFO Excluded PRs:
2014-02-06 23:02:45,734 [ scc.merge] INFO # PR 646 sbesson 'Improve server-template description in advanced configuration' (pr: 646)
2014-02-06 23:02:45,734 [ scc.merge] INFO Candidate PRs:
2014-02-06 23:02:45,734 [ scc.merge] INFO # PR 640 ximenesuk 'Update docs for import and logging fixes'
2014-02-06 23:02:45,734 [ scc.merge] INFO
```