| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b2c3c6d commit 3711934
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -695,37 +695,10 @@ def RepositoryName(self): | |||
| 695 | 695 | locations won't see bogus errors. | |
| 696 | 696 | """ | |
| 697 | 697 | fullname = self.FullName() | |
| 698 | - | ||
| 699 | - if os.path.exists(fullname): | ||
| 700 | - project_dir = os.path.dirname(fullname) | ||
| 701 | - | ||
| 702 | - if os.path.exists(os.path.join(project_dir, ".svn")): | ||
| 703 | - # If there's a .svn file in the current directory, we recursively look | ||
| 704 | - # up the directory tree for the top of the SVN checkout | ||
| 705 | - root_dir = project_dir | ||
| 706 | - one_up_dir = os.path.dirname(root_dir) | ||
| 707 | - while os.path.exists(os.path.join(one_up_dir, ".svn")): | ||
| 708 | - root_dir = os.path.dirname(root_dir) | ||
| 709 | - one_up_dir = os.path.dirname(one_up_dir) | ||
| 710 | - | ||
| 711 | - prefix = os.path.commonprefix([root_dir, project_dir]) | ||
| 712 | - return fullname[len(prefix) + 1:] | ||
| 713 | - | ||
| 714 | - # Not SVN? Try to find a git or hg top level directory by searching up | ||
| 715 | - # from the current path. | ||
| 716 | - root_dir = os.path.dirname(fullname) | ||
| 717 | - while (root_dir != os.path.dirname(root_dir) and | ||
| 718 | - not os.path.exists(os.path.join(root_dir, ".git")) and | ||
| 719 | - not os.path.exists(os.path.join(root_dir, ".hg"))): | ||
| 720 | - root_dir = os.path.dirname(root_dir) | ||
| 721 | - | ||
| 722 | - if (os.path.exists(os.path.join(root_dir, ".git")) or | ||
| 723 | - os.path.exists(os.path.join(root_dir, ".hg"))): | ||
| 724 | - prefix = os.path.commonprefix([root_dir, project_dir]) | ||
| 725 | - return fullname[len(prefix) + 1:] | ||
| 726 | - | ||
| 727 | - # Don't know what to do; header guard warnings may be wrong... | ||
| 728 | - return fullname | ||
| 698 | + # XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory. | ||
| 699 | + toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | ||
| 700 | + prefix = os.path.commonprefix([fullname, toplevel]) | ||
| 701 | + return fullname[len(prefix) + 1:] | ||
| 729 | 702 | ||
| 730 | 703 | def Split(self): | |
| 731 | 704 | """Splits the file into the directory, basename, and extension. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments