parameters: (self)
return_statement: return fullname
docstring: FullName after removing the local path to the repository.
  
      If we have a real absolute path name here we can try to do something smart:
      detecting the root of the checkout and truncating /path/to/checkout from
      the name so that we get header guards that don't include things like
      "C:\Documents and Settings\..." or "/home/username/..." in them and thus
      people on different computers who have checked the source out to different
      locations won't see bogus errors.
docstring_summary: FullName after removing the local path to the repository.
docstring_tokens: FullName after removing the local path to the repository .
function: def RepositoryName(self):
      """FullName after removing the local path to the repository.
  
      If we have a real absolute path name here we can try to do something smart:
      detecting the root of the checkout and truncating /path/to/checkout from
      the name so that we get header guards that don't include things like
      "C:\Documents and Settings\..." or "/home/username/..." in them and thus
      people on different computers who have checked the source out to different
      locations won't see bogus errors.
      """
      fullname = self.FullName()
  
      if os.path.exists(fullname):
        project_dir = os.path.dirname(fullname)
  
        if os.path.exists(os.path.join(project_dir, ".svn")):
          # If there's a .svn file in the current directory, we recursively look
          # up the directory tree for the top of the SVN checkout
          root_dir = project_dir
          one_up_dir = os.path.dirname(root_dir)
          while os.path.exists(os.path.join(one_up_dir, ".svn")):
            root_dir = os.path.dirname(root_dir)
            one_up_dir = os.path.dirname(one_up_dir)
  
          prefix = os.path.commonprefix([root_dir, project_dir])
          return fullname[len(prefix) + 1:]
  
        # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by
        # searching up from the current path.
        root_dir = os.path.dirname(fullname)
        while (root_dir != os.path.dirname(root_dir) and
               not os.path.exists(os.path.join(root_dir, ".git")) and
               not os.path.exists(os.path.join(root_dir, ".hg")) and
               not os.path.exists(os.path.join(root_dir, ".svn"))):
          root_dir = os.path.dirname(root_dir)
  
        if (os.path.exists(os.path.join(root_dir, ".git")) or
            os.path.exists(os.path.join(root_dir, ".hg")) or
            os.path.exists(os.path.join(root_dir, ".svn"))):
          prefix = os.path.commonprefix([root_dir, project_dir])
          return fullname[len(prefix) + 1:]
  
      # Don't know what to do; header guard warnings may be wrong...
      return fullname
function_tokens: def RepositoryName ( self ) : fullname = self . FullName ( ) if os . path . exists ( fullname ) : project_dir = os . path . dirname ( fullname ) if os . path . exists ( os . path . join ( project_dir , ".svn" ) ) : # If there's a .svn file in the current directory, we recursively look # up the directory tree for the top of the SVN checkout root_dir = project_dir one_up_dir = os . path . dirname ( root_dir ) while os . path . exists ( os . path . join ( one_up_dir , ".svn" ) ) : root_dir = os . path . dirname ( root_dir ) one_up_dir = os . path . dirname ( one_up_dir ) prefix = os . path . commonprefix ( [ root_dir , project_dir ] ) return fullname [ len ( prefix ) + 1 : ] # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by # searching up from the current path. root_dir = os . path . dirname ( fullname ) while ( root_dir != os . path . dirname ( root_dir ) and not os . path . exists ( os . path . join ( root_dir , ".git" ) ) and not os . path . exists ( os . path . join ( root_dir , ".hg" ) ) and not os . path . exists ( os . path . join ( root_dir , ".svn" ) ) ) : root_dir = os . path . dirname ( root_dir ) if ( os . path . exists ( os . path . join ( root_dir , ".git" ) ) or os . path . exists ( os . path . join ( root_dir , ".hg" ) ) or os . path . exists ( os . path . join ( root_dir , ".svn" ) ) ) : prefix = os . path . commonprefix ( [ root_dir , project_dir ] ) return fullname [ len ( prefix ) + 1 : ] # Don't know what to do; header guard warnings may be wrong... return fullname