def unextend_path(self, extended_path):
        if '@@' not in extended_path:
            return HEAD, extended_path

        # Result of regular expression search result is list of tuples. We must
        # flat this to one list. The best way is use list comprehension. b is
        # first because it frequently occure in tuples. Before that remove @@
        # from path.
        unextended_chunks = [
            b or a
            for a, b, foo in self.UNEXTENDED.findall(
                extended_path.replace('@@', ''))
        ]

        if sys.platform.startswith('win'):
            # Properly handle full (with drive letter) and UNC paths
            if unextended_chunks[0].endswith(':'):
                unextended_chunks[0] = '%s\\' % unextended_chunks[0]
            elif unextended_chunks[0] == '/' or unextended_chunks[0] == os.sep:
                unextended_chunks[0] = '\\\\'

        # Purpose of realpath is remove parts like /./ generated by
        # ClearCase when vobs branch was fresh created
        unextended_path = cpath.realpath(
            cpath.join(*unextended_chunks)
        )

        revision = extended_path.rsplit('@@', 1)[1]
        if revision.endswith('CHECKEDOUT'):
            revision = HEAD

        return (revision, unextended_path)
Remove ClearCase revision and branch informations from path.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/scmtools/clearcase.py/ClearCaseTool.unextend_path