original_docstring: Return True if every View line is the same on the left and the right.
docstring: Return True if every View line is the same on the left and the right.
docstring_tokens: Return True if every View line is the same on the left and the right .
code: def clientspec_is_vanilla():
          'Return True if every View line is the same on the left and the right.'
          # We also want to accept a clientspec which has the same prefix
          # on every line on the right. E.g.
          #    //depot/dir1  /client/pre/fix/dir1
          # is acceptable if every mapping has /client/pre/fix
  
          # (This is to accomodate Autobuild clientspecs, which locate the workspace at autobuild/client)
          # (Turns out ABR has non-vanilla clientspecs even aside from the
          # prefix. Just give it an escape.)
          import o4_config
          if o4_config.allow_nonflat_clientspec():
              return True
  
          client = pyforce_client()
          cname = client['Client']
          view = [
              v[1:].split(' //' + cname)
              for k, v in client.items()
              if k.startswith('View') and not v.startswith('-//')
          ]
  
          # Get the prefix (possibly zero-length) from the first entry.
          # If the first doesn't even match, it'll be empty, but then will
          # fail the match anyway.
          left, right = view[0]
          prefix = right[:-len(left)]
  
          for left, right in view:
              if prefix + left != right:
                  return False
          return True
code_tokens: def clientspec_is_vanilla ( ) : import o4_config if o4_config . allow_nonflat_clientspec ( ) : return True client = pyforce_client ( ) cname = client [ 'Client' ] view = [ v [ 1 : ] . split ( ' //' + cname ) for k , v in client . items ( ) if k . startswith ( 'View' ) and not v . startswith ( '-//' ) ] left , right = view [ 0 ] prefix = right [ : - len ( left ) ] for left , right in view : if prefix + left != right : return False return True
short_docstring: Return True if every View line is the same on the left and the right.
short_docstring_tokens: Return True if every View line is the same on the left and the right .
comment: 'Return True if every View line is the same on the left and the right.'$SEP$# We also want to accept a clientspec which has the same prefix$SEP$# on every line on the right. E.g.$SEP$#    //depot/dir1  /client/pre/fix/dir1$SEP$# is acceptable if every mapping has /client/pre/fix$SEP$# (This is to accomodate Autobuild clientspecs, which locate the workspace at autobuild/client)$SEP$# (Turns out ABR has non-vanilla clientspecs even aside from the$SEP$# prefix. Just give it an escape.)$SEP$# Get the prefix (possibly zero-length) from the first entry.$SEP$# If the first doesn't even match, it'll be empty, but then will$SEP$# fail the match anyway.