mirror of
https://github.com/tiennm99/styleguide.git
synced 2026-08-05 18:25:00 +00:00
Project prefix directory should work with Hg.
Patch based on one by tomic80.
This commit is contained in:
Vendored
+5
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user