• 
      

    Fix diff path generation when running inside a setview.

    Review Request #15148 — Created July 3, 2026 and updated — Latest diff uploaded

    Information

    RBTools
    master

    Reviewers

    On linux, users can enter a ClearCase view either through the view root
    (/view/<tag>/...) or with cleartool setview. In the setview case,
    cleartool pwv -root returns an empty string, which we stored as the
    root path of the view.

    Every path in the generated diff (the diff headers, the DiffX
    "path" fields, and the versionvault metadata) is computed with
    os.path.relpath() against that root path. With an empty root path,
    relpath() resolves against the current working directory instead,
    producing paths like "../gui2/bin/clearcase/Xmakefile" that depend
    entirely on where the user happened to run rbt.

    The server can never resolve these, resulting in file-not-found errors
    during diff validation. The same change would post fine for a user who
    entered the view through /view/<tag>, which made the failures look
    sporadic.

    We now detect the empty result and use the filesystem root as the view
    root. In a setview, VOBs appear directly under /, so this makes all
    generated paths view-relative again, matching what a /view-based
    workflow produces.

    • Added a unit test for get_local_path() in a setview context.
    • Ran unit tests.

    Commits

    Files