Implement SVNClient.parse_revision_spec and add tests.

Review Request #5133 — Created Dec. 17, 2013 and submitted

Information

RBTools
master

Reviewers

Implement SVNClient.parse_revision_spec and add tests.

This implements revision parsing for the SVNClient. Like with the current
implementation for Git, you can choose to pass zero, one, or two arguments.

In the case of zero, it returns a special internal string that I'm planning on
using as a notice for the different 'svn diff' invocation syntax that we have
to use for diffing the working directory.

One argument can be either a numeric/symbolic revision, a revision span, or a
changelist name. If the argument has a : in it, it's split and treated as two
arguments. If not, we use 'svn log' to determine if it's a real revision, and
if that fails, 'svn status --cl' to check if it's a changelist. If it's none of
the above, we raise an exception.

With two arguments, the two arguments must be revisions of some sort. Like with
the single argument, we use 'svn log' to turn these into actual numbers.

Unlike the Git implementation, this is not actually used for the diff
generation yet.

Ran unit tests

Description From Last Updated

Got some lines going over 80 chars. Can you check the rest of the additions?

chipx86chipx86

Can we do a sanity check that this is indeed an integer?

chipx86chipx86

Should be one blank line.

chipx86chipx86

Should probaby keep setUp first and put _run_svn by the other _svn_* methods.

chipx86chipx86
chipx86
  1. 
      
  2. rbtools/clients/svn.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    Got some lines going over 80 chars. Can you check the rest of the additions?

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

    Can we do a sanity check that this is indeed an integer?

    1. If it's not, it'll raise ValueError which is caught by the caller.

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

    Should be one blank line.

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

    Should probaby keep setUp first and put _run_svn by the other _svn_* methods.

  6. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (64c3de5).
Loading...