Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
69b9e306
Commit
69b9e306
authored
Sep 09, 2009
by
Mathias Goldau
Browse files
now mercurial should also be properly handled by our brainlinter
parent
5511fbc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
tools/brainlint.py
tools/brainlint.py
+11
-3
No files found.
tools/brainlint.py
View file @
69b9e306
...
...
@@ -551,7 +551,6 @@ class FileInfo:
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
...
...
@@ -564,8 +563,17 @@ class FileInfo:
prefix
=
os
.
path
.
commonprefix
([
root_dir
,
project_dir
])
return
fullname
[
len
(
prefix
)
+
1
:]
# Not SVN? Try to find a git top level directory by searching up from the
# current path.
# Maybe its a Mercurial repository
root_dir
=
os
.
path
.
dirname
(
fullname
)
while
(
root_dir
!=
os
.
path
.
dirname
(
root_dir
)
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
,
".hg"
)):
prefix
=
os
.
path
.
commonprefix
([
root_dir
,
project_dir
])
return
fullname
[
len
(
prefix
)
+
1
:]
# Not SVN or Mercurial? Try to find a git 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"
))):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment