Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py

Issue 2801393002: Remove remaining references to SVN. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # 2 #
3 # Copyright (C) 2009, 2010, 2012 Google Inc. All rights reserved. 3 # Copyright (C) 2009, 2010, 2012 Google Inc. All rights reserved.
4 # Copyright (C) 2009 Torch Mobile Inc. 4 # Copyright (C) 2009 Torch Mobile Inc.
5 # Copyright (C) 2009 Apple Inc. All rights reserved. 5 # Copyright (C) 2009 Apple Inc. All rights reserved.
6 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) 6 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
7 # 7 #
8 # Redistribution and use in source and binary forms, with or without 8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions are 9 # modification, are permitted provided that the following conditions are
10 # met: 10 # met:
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 the name so that we get header guards that don't include things like 583 the name so that we get header guards that don't include things like
584 "C:\Documents and Settings\..." or "/home/username/..." in them and thus 584 "C:\Documents and Settings\..." or "/home/username/..." in them and thus
585 people on different computers who have checked the source out to differe nt 585 people on different computers who have checked the source out to differe nt
586 locations won't see bogus errors. 586 locations won't see bogus errors.
587 """ 587 """
588 fullname = self.full_name() 588 fullname = self.full_name()
589 589
590 if os.path.exists(fullname): 590 if os.path.exists(fullname):
591 project_dir = os.path.dirname(fullname) 591 project_dir = os.path.dirname(fullname)
592 592
593 if os.path.exists(os.path.join(project_dir, '.svn')): 593 # Try to find a git top level directory by searching up from the cur rent path.
594 # If there's a .svn file in the current directory, we
595 # recursively look up the directory tree for the top
596 # of the SVN checkout
597 root_dir = project_dir
598 one_up_dir = os.path.dirname(root_dir)
599 while os.path.exists(os.path.join(one_up_dir, '.svn')):
600 root_dir = os.path.dirname(root_dir)
601 one_up_dir = os.path.dirname(one_up_dir)
602
603 prefix = os.path.commonprefix([root_dir, project_dir])
604 return fullname[len(prefix) + 1:]
605
606 # Not SVN? Try to find a git top level directory by
607 # searching up from the current path.
608 root_dir = os.path.dirname(fullname) 594 root_dir = os.path.dirname(fullname)
609 while (root_dir != os.path.dirname(root_dir) 595 while (root_dir != os.path.dirname(root_dir)
610 and not os.path.exists(os.path.join(root_dir, '.git'))): 596 and not os.path.exists(os.path.join(root_dir, '.git'))):
611 root_dir = os.path.dirname(root_dir) 597 root_dir = os.path.dirname(root_dir)
612 if os.path.exists(os.path.join(root_dir, '.git')): 598 if os.path.exists(os.path.join(root_dir, '.git')):
613 prefix = os.path.commonprefix([root_dir, project_dir]) 599 prefix = os.path.commonprefix([root_dir, project_dir])
614 return fullname[len(prefix) + 1:] 600 return fullname[len(prefix) + 1:]
615 601
616 # Don't know what to do; header guard warnings may be wrong... 602 # Don't know what to do; header guard warnings may be wrong...
617 return fullname 603 return fullname
(...skipping 2877 matching lines...) Expand 10 before | Expand all | Expand 10 after
3495 3481
3496 def check(self, lines): 3482 def check(self, lines):
3497 _process_lines(self.file_path, self.file_extension, lines, 3483 _process_lines(self.file_path, self.file_extension, lines,
3498 self.handle_style_error, self.min_confidence) 3484 self.handle_style_error, self.min_confidence)
3499 3485
3500 3486
3501 # FIXME: Remove this function (requires refactoring unit tests). 3487 # FIXME: Remove this function (requires refactoring unit tests).
3502 def process_file_data(filename, file_extension, lines, error, min_confidence, fs =None): 3488 def process_file_data(filename, file_extension, lines, error, min_confidence, fs =None):
3503 checker = CppChecker(filename, file_extension, error, min_confidence, fs) 3489 checker = CppChecker(filename, file_extension, error, min_confidence, fs)
3504 checker.check(lines) 3490 checker.check(lines)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698