SVN and CVS no longer create diffs relative to current working directory.

Review Request #6388 — Created Oct. 1, 2014 and submitted

brennie
RBTools
master
929f614...
rbtools, students

CVS and SVN now change to the root directory of the repository for
performing diffs (before changing back).

Add the _get_repository_root method to CVSClient that determines
the root directory of the current CVS repository. It does this by
reading the CVS/Repository file in the current directory and
determining the working direcotry's depth relative to the CVSRoot;
that is the number of directories to traverse up to find the
repository root.

The base_dir parameter of all rbtools.utils.diffs method is no
longer optional because all SCMTools that utilize it require
specifying the root of the repository.

Unit tests pass.
The diffs are generated correctly.

Description From Last Updated

In order to make this exception-safe, this should probably be: try: diff = execute(...) finally: os.chdir(cwd)

daviddavid

try/finally here, too.

daviddavid

Don't add these lines.

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
  2. 
      
david
  1. 
      
  2. rbtools/clients/cvs.py (Diff revision 2)
     
     
     
     
     

    In order to make this exception-safe, this should probably be:

    try:
        diff = execute(...)
    finally:
        os.chdir(cwd)
    
  3. rbtools/clients/svn.py (Diff revision 2)
     
     
     

    try/finally here, too.

  4. rbtools/clients/svn.py (Diff revision 2)
     
     
     

    Don't add these lines.

  5. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/clients/cvs.py
        rbtools/clients/svn.py
        rbtools/utils/diffs.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.6.x (31aabc4)
Loading...