Print this page
9867 pbchk exception_lists only work from top srcdir

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/scripts/git-pbchk.py
          +++ new/usr/src/tools/scripts/git-pbchk.py
↓ open down ↓ 190 lines elided ↑ open up ↑
 191  191      def relpath(path, here):
 192  192          c = os.path.abspath(os.path.join(root, path)).split(os.path.sep)
 193  193          s = os.path.abspath(here).split(os.path.sep)
 194  194          l = len(os.path.commonprefix((s, c)))
 195  195          return os.path.join(*[os.path.pardir] * (len(s)-l) + c[l:])
 196  196  
 197  197      def ret(select=None):
 198  198          if not select:
 199  199              select = lambda x: True
 200  200  
 201      -        for f in git_file_list(parent, paths):
 202      -            f = relpath(f, '.')
      201 +        for abspath in git_file_list(parent, paths):
      202 +            path = relpath(abspath, '.')
 203  203              try:
 204      -                res = git("diff %s HEAD %s" % (parent, f))
      204 +                res = git("diff %s HEAD %s" % (parent, path))
 205  205              except GitError, e:
 206      -                # This ignores all the errors that can be thrown. Usually, this means
 207      -                # that git returned non-zero because the file doesn't exist, but it
 208      -                # could also fail if git can't create a new file or it can't be
 209      -                # executed.  Such errors are 1) unlikely, and 2) will be caught by other
 210      -                # invocations of git().
      206 +                # This ignores all the errors that can be thrown. Usually, this
      207 +                # means that git returned non-zero because the file doesn't
      208 +                # exist, but it could also fail if git can't create a new file
      209 +                # or it can't be executed.  Such errors are 1) unlikely, and 2)
      210 +                # will be caught by other invocations of git().
 211  211                  continue
 212  212              empty = not res.readline()
 213      -            if (os.path.isfile(f) and not empty and select(f) and not exclude(f)):
 214      -                yield f
      213 +            if (os.path.isfile(path) and not empty and
      214 +                select(path) and not exclude(abspath)):
      215 +                yield path
 215  216      return ret
 216  217  
 217  218  
 218  219  def comchk(root, parent, flist, output):
 219  220      output.write("Comments:\n")
 220  221  
 221  222      return Comments.comchk(git_comments(parent), check_db=True,
 222  223                             output=output)
 223  224  
 224  225  
↓ open down ↓ 192 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX