• 
      

    Add support for Team Foundation Server repositories.

    Review Request #6646 — Created Nov. 25, 2014 and submitted

    Information

    RBTools
    master
    a34f92e...

    Reviewers

    This change adds a new client for TFS (TFVC). It relies on the presence of the
    'tf' command-line tool, which is available either as part of Visual Studio (on
    Windows) or via the "Team Explorer Everywhere" package (which is a java
    application that can run on just about any platform).

    This is intended for use with the TFS SCMTool which is being developed as part
    of the Power Pack.

    Diffing is done basically by hand, because the 'tf diff[erence]' command is
    kind of crummy, even when calling out to GNU Diff via the TF_DIFF_COMMAND
    environment variable. In particular, when there are added/deleted files, rather
    than including the diff for that file, it just says something like "X is only
    present in revision Y". The diffing logic matches that which is used for the
    post-commit implementation in the TFS SCMTool.

    At the moment, this only supports posting pending changes from the working
    directory. There's the beginning of an implementation for committed change
    ranges, but when there are moved files, there's no way to match up the orig
    file (delete) from the new file (add). I do intend to have it try its best to
    post and only give up if a changeset includes more than one moved file, but
    that will come later. For now, committed changes can be posted via the web UI.

    • Posted review requests that had edited files, added files, deleted files,
      renamed files, and moved+edited files.
    • Verified that binary files were shown correctly.
    • Ran unit tests.
    Description From Last Updated

    Col: 80 E501 line too long (86 > 79 characters)

    reviewbotreviewbot

    I imagine we'd be impacted by the version number, right? Can we scan for directories with those prefixes? Also, the …

    chipx86chipx86

    Col: 80 E501 line too long (84 > 79 characters)

    reviewbotreviewbot

    Do we want to break after we find one?

    chipx86chipx86

    No blank line.

    chipx86chipx86

    No blank line.

    chipx86chipx86

    Same.

    chipx86chipx86

    Same.

    chipx86chipx86

    Summary on the first line.

    chipx86chipx86

    Col: 80 E501 line too long (81 > 79 characters)

    reviewbotreviewbot

    These are unrelated. Blank line here.

    chipx86chipx86

    Same here.

    chipx86chipx86

    We should build as a list and then join, for performance reasons.

    chipx86chipx86

    Col: 80 E501 line too long (80 > 79 characters)

    reviewbotreviewbot

    Blank line here.

    chipx86chipx86

    Missing period.

    chipx86chipx86

    We can do as e now, right?

    chipx86chipx86

    Two blank lines.

    chipx86chipx86

    Col: 1 E302 expected 2 blank lines, found 1

    reviewbotreviewbot

    Should be one line.

    chipx86chipx86

    I think we've had to do this in a few other places as well. How about we add a get_all() …

    chipx86chipx86

    Col: 80 E501 line too long (87 > 79 characters)

    reviewbotreviewbot

    Col: 80 E501 line too long (85 > 79 characters)

    reviewbotreviewbot

    Col: 80 E501 line too long (87 > 79 characters)

    reviewbotreviewbot

    Col: 80 E501 line too long (85 > 79 characters)

    reviewbotreviewbot
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          rbtools/commands/status.py
          rbtools/commands/setup_repo.py
          rbtools/clients/tfs.py
          rbtools/commands/__init__.py
          rbtools/commands/diff.py
          rbtools/commands/post.py
          setup.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          rbtools/commands/status.py
          rbtools/commands/setup_repo.py
          rbtools/clients/tfs.py
          rbtools/commands/__init__.py
          rbtools/commands/diff.py
          rbtools/commands/post.py
          setup.py
      
      
    2. rbtools/clients/tfs.py (Diff revision 1)
       
       
      Show all issues
      Col: 80
       E501 line too long (86 > 79 characters)
      
    3. rbtools/clients/tfs.py (Diff revision 1)
       
       
      Show all issues
      Col: 80
       E501 line too long (84 > 79 characters)
      
    4. rbtools/clients/tfs.py (Diff revision 1)
       
       
      Show all issues
      Col: 80
       E501 line too long (81 > 79 characters)
      
    5. rbtools/clients/tfs.py (Diff revision 1)
       
       
      Show all issues
      Col: 80
       E501 line too long (80 > 79 characters)
      
    6. rbtools/clients/tfs.py (Diff revision 1)
       
       
      Show all issues
      Col: 1
       E302 expected 2 blank lines, found 1
      
    7. 
        
    chipx86
    1. 
        
    2. rbtools/clients/tfs.py (Diff revision 1)
       
       
       
      Show all issues

      I imagine we'd be impacted by the version number, right? Can we scan for directories with those prefixes?

      Also, the backslashes are escaping. We probably want r'...'.

      1. I think so, but I also think MS has a history of changing directory names in unpredictable ways. I think we'd do better to leave this as-is and then see where things are located the next time they release a major version.

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

      Do we want to break after we find one?

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

      No blank line.

      1. I initally had these this way and I found it was really hard to read, since it's a big conditional.

      2. It's inconsistent with all other conditionals throughout RB and RBTools, though. I think it actualy hurts readability, since it looks like an unrelated block of code.

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

      No blank line.

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

      Same.

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

      Same.

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

      Summary on the first line.

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

      These are unrelated. Blank line here.

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

      Same here.

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

      We should build as a list and then join, for performance reasons.

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

      Blank line here.

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

      Missing period.

    14. rbtools/clients/tfs.py (Diff revision 1)
       
       
      Show all issues

      We can do as e now, right?

    15. rbtools/clients/tfs.py (Diff revision 1)
       
       
       
       
      Show all issues

      Two blank lines.

    16. rbtools/clients/tfs.py (Diff revision 1)
       
       
       
       
      Show all issues

      Should be one line.

    17. rbtools/clients/tfs.py (Diff revision 1)
       
       
       
       
       
       
       
       
      Show all issues

      I think we've had to do this in a few other places as well. How about we add a get_all() to ListResource that does this?

      1. I'd prefer to do that cleanup in a separate change.

    18. 
        
    david
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          rbtools/commands/status.py
          rbtools/commands/setup_repo.py
          rbtools/clients/tfs.py
          rbtools/commands/__init__.py
          rbtools/commands/diff.py
          rbtools/commands/post.py
          setup.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          rbtools/commands/status.py
          rbtools/commands/setup_repo.py
          rbtools/clients/tfs.py
          rbtools/commands/__init__.py
          rbtools/commands/diff.py
          rbtools/commands/post.py
          setup.py
      
      
    2. rbtools/clients/tfs.py (Diff revision 2)
       
       
      Show all issues
      Col: 80
       E501 line too long (87 > 79 characters)
      
    3. rbtools/clients/tfs.py (Diff revision 2)
       
       
      Show all issues
      Col: 80
       E501 line too long (85 > 79 characters)
      
    4. 
        
    david
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          rbtools/commands/status.py
          rbtools/commands/setup_repo.py
          rbtools/clients/tfs.py
          rbtools/commands/__init__.py
          rbtools/commands/diff.py
          rbtools/commands/post.py
          setup.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          rbtools/commands/status.py
          rbtools/commands/setup_repo.py
          rbtools/clients/tfs.py
          rbtools/commands/__init__.py
          rbtools/commands/diff.py
          rbtools/commands/post.py
          setup.py
      
      
    2. rbtools/clients/tfs.py (Diff revision 3)
       
       
      Show all issues
      Col: 80
       E501 line too long (87 > 79 characters)
      
    3. rbtools/clients/tfs.py (Diff revision 3)
       
       
      Show all issues
      Col: 80
       E501 line too long (85 > 79 characters)
      
    4. 
        
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (864884b)