Fix some bugs in the legacy ClearCase backend.

Review Request #12306 — Created May 29, 2022 and submitted

Information

Review Board
release-4.0.x

Reviewers

This fixes three issues I ran into when running tests against the legacy ClearCase
implementation. Specifically:

  • When running on Python 3, there were some unicode-vs-bytes bugs in the diff parsing.
  • If the diff had incorrectly formatted filenames (which didn't include the vobtag),
    the diff parsing stage could infinite loop. I've added a fallback to ensure we don't
    loop more than a limited number of times.
  • The path normalization for display was calling realpath on a relative path, which
    (on Linux) would end up adding the CWD to the path. I've changed it so we first turn it
    into an absolute path relative to the repo root, run realpath, and then make it
    relative again.

Posted some changes using a dynamic view as the backend. Saw that I could post changes
without any errors, and that paths for files were displayed correctly.

Summary ID
Fix some bugs in the legacy ClearCase backend.
This fixes three issues I ran into when running tests against the legacy ClearCase implementation. Specifically: - When running on Python 3, there were some unicode-vs-bytes bugs in the diff parsing. - If the diff had incorrectly formatted filenames (which didn't include the vobtag), the diff parsing stage could infinite loop. I've added a fallback to ensure we don't loop more than a limited number of times. - The path normalization for display was calling `realpath` on a relative path, which (on Linux) would end up adding the CWD to the path. I've changed it so we first turn it into an absolute path relative to the repo root, run realpath, and then make it relative again. Testing Done: Posted some changes using a dynamic view as the backend. Saw that I could post changes without any errors, and that paths for files were displayed correctly.
6ba0e13903db593e654487e13a2c48823f1ae64c
Description From Last Updated

While here, can we improve the text here?

chipx86chipx86

Let's encode this once outside of the loop.

chipx86chipx86
chipx86
  1. 
      
  2. reviewboard/scmtools/clearcase.py (Diff revision 1)
     
     
     

    While here, can we improve the text here?

  3. reviewboard/scmtools/clearcase.py (Diff revision 1)
     
     

    Let's encode this once outside of the loop.

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

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (f52ee07)
Loading...