Add SCMClient.parse_revision_spec and implement/use it in GitClient.

Review Request #5124 — Created Dec. 16, 2013 and submitted

Information

RBTools
master

Reviewers

Add SCMClient.parse_revision_spec and implement/use it in GitClient.

As part of redoing the revision-range syntax for rbt post, I've decided to
add a method to SCMClient that can take in an array of revisions and "parse"
them, returning a dictionary with 'base', 'tip', and optional 'parent_base'
keys. This method does all the hard work of separating out the passed-in
revisions and detecting whether or not a parent diff is required.

This method is currently only implemented for the GitClient. I've added a bunch
of unit tests to make sure it returns the right revisions, and also refactored
the diff generation code to use it for both the diff and
diff_between_revisions methods.

  • Ran unit tests.
  • Posted this change with the new code.
Description From Last Updated

Should be on the same line.

chipx86chipx86

Two blank lines.

chipx86chipx86

Can you add some docstrings? I want to work toward getting RBTools more heavily documented.

chipx86chipx86

Two blank lines.

chipx86chipx86

Can you add periods?

chipx86chipx86

Same line.

chipx86chipx86

Excess blank line.

chipx86chipx86

Here too.

chipx86chipx86

Here too.

chipx86chipx86

Missing period at the end of the sentence.

chipx86chipx86

Should be one line.

chipx86chipx86

"of" probably shouldn't be there.

chipx86chipx86

Missing period.

chipx86chipx86
chipx86
  1. Some of these comments are about older code, but might as well fix them since they're being moved around.

  2. rbtools/clients/__init__.py (Diff revision 1)
     
     
     
    Show all issues

    Should be on the same line.

  3. rbtools/clients/errors.py (Diff revision 1)
     
     
     
     
    Show all issues

    Two blank lines.

  4. rbtools/clients/errors.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    Can you add some docstrings? I want to work toward getting RBTools more heavily documented.

  5. rbtools/clients/errors.py (Diff revision 1)
     
     
     
     
    Show all issues

    Two blank lines.

  6. rbtools/clients/git.py (Diff revision 1)
     
     
     
    Show all issues

    Same line.

  7. rbtools/clients/git.py (Diff revision 1)
     
     
     
     
    Show all issues

    Excess blank line.

  8. rbtools/clients/git.py (Diff revision 1)
     
     
     
     
    Show all issues

    Here too.

  9. rbtools/clients/git.py (Diff revision 1)
     
     
     
     
    Show all issues

    Here too.

  10. rbtools/clients/git.py (Diff revision 1)
     
     
    Show all issues

    Missing period at the end of the sentence.

  11. rbtools/clients/git.py (Diff revision 1)
     
     
     
     
    Show all issues

    Should be one line.

    1. It's a choice between this or being > 80 columns.

  12. rbtools/clients/git.py (Diff revision 1)
     
     
    Show all issues

    "of" probably shouldn't be there.

  13. rbtools/clients/git.py (Diff revision 1)
     
     
    Show all issues

    Missing period.

  14. 
      
david
chipx86
  1. One more thing, then ship it.

  2. rbtools/clients/errors.py (Diff revisions 1 - 2)
     
     
     
     
     
     
     
    Show all issues

    Can you add periods?

  3. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (0297873).