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, ".git")) and
|
||||||
not os.path.exists(os.path.join(root_dir, ".hg"))):
|
not os.path.exists(os.path.join(root_dir, ".hg"))):
|
||||||
root_dir = os.path.dirname(root_dir)
|
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"))):
|
if (os.path.exists(os.path.join(root_dir, ".git")) or
|
||||||
prefix = os.path.commonprefix([root_dir, project_dir])
|
os.path.exists(os.path.join(root_dir, ".hg"))):
|
||||||
return fullname[len(prefix) + 1:]
|
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...
|
# Don't know what to do; header guard warnings may be wrong...
|
||||||
return fullname
|
return fullname
|
||||||
|
|
Loading…
Reference in New Issue
Block a user