[svn merge][r424] Added support for Git submodules.

This commit is contained in:
Romain Failliot 2016-07-08 23:00:58 -04:00
parent e85f059d70
commit 15e441f172
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,4 @@
- add support for Git submodules
- added Akom Chotiphantawanon's Thai translation - added Akom Chotiphantawanon's Thai translation
- updated Python highlighting for Python 3 grammar - updated Python highlighting for Python 3 grammar
- added a preference and command line option to specify the version control system search order - added a preference and command line option to specify the version control system search order

View File

@ -1861,7 +1861,7 @@ class _Git:
def getFolderTemplate(self, prefs, names): def getFolderTemplate(self, prefs, names):
# build command # build command
args = [ prefs.getString('git_bin'), 'status', '--porcelain', '-s', '--untracked-files=no' ] args = [ prefs.getString('git_bin'), 'status', '--porcelain', '-s', '--untracked-files=no', '--ignore-submodules=all' ]
# build list of interesting files # build list of interesting files
pwd, isabs = os.path.abspath(os.curdir), False pwd, isabs = os.path.abspath(os.curdir), False
for name in names: for name in names:
@ -1963,9 +1963,15 @@ def _get_git_repo(path, prefs):
except (IOError, OSError, WindowsError): except (IOError, OSError, WindowsError):
# working tree not found # working tree not found
pass pass
p = _find_parent_dir_with(path, '.git') # search for .git direcotry (project) or .git file (submodule)
if p: while True:
return _Git(p) name = os.path.join(path, '.git')
if os.path.isdir(name) or os.path.isfile(name):
return _Git(path)
newpath = os.path.dirname(path)
if newpath == path:
break
path = newpath
# Mercurial support # Mercurial support
class _Hg: class _Hg: