summaryrefslogtreecommitdiffstats
path: root/tools/vim
diff options
context:
space:
mode:
authorvictorhsieh@chromium.org <victorhsieh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 19:50:49 +0000
committervictorhsieh@chromium.org <victorhsieh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 19:50:49 +0000
commit1cab7568aaace0ae014ca47f1e650fe02547b243 (patch)
treebc724085756a6414c8c2a9b5311ce42229f0329b /tools/vim
parent7db49d0dabc8fd748225a64b43e73b35e5f60aa2 (diff)
downloadchromium_src-1cab7568aaace0ae014ca47f1e650fe02547b243.zip
chromium_src-1cab7568aaace0ae014ca47f1e650fe02547b243.tar.gz
chromium_src-1cab7568aaace0ae014ca47f1e650fe02547b243.tar.bz2
Make .ycm_extra_conf.pyc friendly to git checkout
BUG= Review URL: https://chromiumcodereview.appspot.com/14348028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/vim')
-rw-r--r--tools/vim/chromium.ycm_extra_conf.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/vim/chromium.ycm_extra_conf.py b/tools/vim/chromium.ycm_extra_conf.py
index bdbf157..f3b769d 100644
--- a/tools/vim/chromium.ycm_extra_conf.py
+++ b/tools/vim/chromium.ycm_extra_conf.py
@@ -50,6 +50,10 @@ flags = [
]
+def PathExists(*args):
+ return os.path.exists(os.path.join(*args))
+
+
def FindChromeSrcFromFilename(filename):
"""Searches for the root of the Chromium checkout.
@@ -62,8 +66,9 @@ def FindChromeSrcFromFilename(filename):
(String) Path of 'src/', or None if unable to find.
"""
curdir = os.path.normpath(os.path.dirname(filename))
- while not (os.path.exists(os.path.join(curdir, '.gclient'))
- and os.path.exists(os.path.join(curdir, 'src'))):
+ while not (PathExists(curdir, 'src')
+ and (PathExists(curdir, '.gclient')
+ or PathExists(curdir, 'src', '.git'))):
nextdir = os.path.normpath(os.path.join(curdir, '..'))
if nextdir == curdir:
return None