mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Project prefix directory should work with Hg.
Patch based on one by tomic80.
This commit is contained in:
parent
7ead64485b
commit
42e59b0ce7
9
cpplint/cpplint.py
vendored
9
cpplint/cpplint.py
vendored
|
@ -719,10 +719,11 @@ class FileInfo:
|
|||
not os.path.exists(os.path.join(root_dir, ".git")) and
|
||||
not os.path.exists(os.path.join(root_dir, ".hg"))):
|
||||
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"))):
|
||||
prefix = os.path.commonprefix([root_dir, project_dir])
|
||||
return fullname[len(prefix) + 1:]
|
||||
|
||||
if (os.path.exists(os.path.join(root_dir, ".git")) or
|
||||
os.path.exists(os.path.join(root_dir, ".hg"))):
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user