ClearCase: Select latest version as base if there is a merge from it. Fail otherwise.

Review Request #5619 — Created March 13, 2014 and discarded

Information

RBTools
master
ce81958...

Reviewers

In ClearCase it is only possible to commit changes to the LATEST version. The new code checks for cases where the CHECKEDOUT version is not LATEST and notifies the user that a merge is needed.

The new code also makes LATEST the base version for the changeset instead of the original, hiding the changes that are already under version control (and hopefully already reviewed).

Tested rbt post manually.

Using it in production for the last month.

Description From Last Updated

Can we do one string and one format operation? Adjacent string literals will get concatenated without using + operators (like …

daviddavid

These could be combined: self._versions, self._arrows = self._load_vtree(path)

daviddavid

This should call re.escape on the path before formatting it into the regex. This should also prefix the string with …

daviddavid

This should prefix the string with r (r"\s..."). I also don't see any format characters in the string, so the …

daviddavid

Since this is called by something outside of this class, it should be called latest_from_branch (no underscore).

daviddavid

This should probably call re.escape on branch, in case the branch name has regex special characters in it.

daviddavid

Since this is called by something outside of this class, it should be called merge_arrows_towards (no underscore).

daviddavid
david
  1. Most of these comments are style-related. I don't understand clearcase well enough to really know how correct this is (or whether it will regress other usage). Can you comment the Vtree methods more to explain what's going on?

  2. rbtools/clients/clearcase.py (Diff revision 1)
     
     
     
     
     
    Show all issues

    Can we do one string and one format operation? Adjacent string literals will get concatenated without using + operators (like in C). Please also change "try" to "tried".

    die("Error: you tried to post changes that you cannot check-in.\n"
        "Merge from the LATEST version to clear this error.\n"
        "Offending version: %s@@%s\n"
        "Latest version:    %s@@%s\n"
        % (path, previous, path, latest))
    
  3. rbtools/clients/clearcase.py (Diff revision 1)
     
     
     
     
    Show all issues

    These could be combined:

    self._versions, self._arrows = self._load_vtree(path)
    
  4. rbtools/clients/clearcase.py (Diff revision 1)
     
     
    Show all issues

    This should call re.escape on the path before formatting it into the regex.

    This should also prefix the string with r (`r"{0}...").

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

    This should prefix the string with r (r"\s...").

    I also don't see any format characters in the string, so the .format() call is useless.

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

    Since this is called by something outside of this class, it should be called latest_from_branch (no underscore).

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

    This should probably call re.escape on branch, in case the branch name has regex special characters in it.

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

    Since this is called by something outside of this class, it should be called merge_arrows_towards (no underscore).

  9. 
      
DR
Review request changed
Status:
Discarded
Change Summary:
Discarding due to performance reasons. Getting the revision tree from ClearCase seems like a time-consuming operation.