comparison foodtruck/scm/git.py @ 777:8d633ca59bc5

admin: Fixes for the Git support.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 04 Jul 2016 00:22:30 -0700
parents 9f391ab1b4e0
children
comparison
equal deleted inserted replaced
776:3799621cd25b 777:8d633ca59bc5
14 self.git = cfg.get('exe', 'git') 14 self.git = cfg.get('exe', 'git')
15 15
16 def getStatus(self): 16 def getStatus(self):
17 res = RepoStatus() 17 res = RepoStatus()
18 st_out = self._run('status', '-s') 18 st_out = self._run('status', '-s')
19 print(st_out)
20 for line in st_out.split('\n'): 19 for line in st_out.split('\n'):
21 print(line)
22 if not line: 20 if not line:
23 continue 21 continue
24 if line.startswith('?? '): 22 if line.startswith('?? '):
25 path = line[3:].strip() 23 path = line[3:].strip()
26 if path[-1] == '/': 24 if path[-1] == '/':
29 f for f in glob.glob(path + '**', recursive=True) 27 f for f in glob.glob(path + '**', recursive=True)
30 if f[-1] != '/'] 28 if f[-1] != '/']
31 else: 29 else:
32 res.new_files.append(path) 30 res.new_files.append(path)
33 elif line.startswith(' M '): 31 elif line.startswith(' M '):
34 res.edited_files.append(path[3:]) 32 res.edited_files.append(line[3:])
35 print(res.__dict__)
36 return res 33 return res
37 34
38 def _doCommit(self, paths, message, author): 35 def _doCommit(self, paths, message, author):
39 self._run('add', *paths) 36 self._run('add', *paths)
40 37