def refs(self): # no refs yet returns an error in normal operations rc, refs = shell.read(self.log, 'git', 'show-ref', '--head', error=False) if not rc: return [tuple(x.split()) for x in refs.strip().split('\n')] return None
def listContentFiles(self): _, files = shell.read(self.log, 'git', 'ls-files', '--exclude-standard', '-z') # --exclude-standard does not apply to .gitignore or .gitmodules # make sure that no .git metadata files are included in the # content that might be exported to CVS return [x for x in files.split('\0') if x and not os.path.basename(x).startswith('.git')]
def logmessages(self, since, until): options = self.ctx.getGitLogOptions(self.repo, until) if options is None: options = [] else: options = shlex.split(options) options = ['git', 'log'] + options + ['%s..%s' % (since, until)] _, messages = shell.read(self.log, *options) return messages
def logmessages(self, since, until): options = self.ctx.getGitLogOptions(self.repo, until) if options is None: options = [] else: options = shlex.split(options) options = ['git', 'log'] + options + ['%s..%s' %(since, until)] _, messages = shell.read(self.log, *options) return messages
def listContentFiles(self): _, files = shell.read(self.log, 'git', 'ls-files', '--exclude-standard', '-z') # --exclude-standard does not apply to .gitignore or .gitmodules # make sure that no .git metadata files are included in the # content that might be exported to CVS return [ x for x in files.split('\0') if x and not os.path.basename(x).startswith('.git') ]
def status(self): _, output = shell.read(self.log, 'git', 'status', '--porcelain') return output
def branch(self): _, branch = shell.read(self.log, 'git', 'symbolic-ref', '--short', '-q', 'HEAD') return branch
def branches(self): _, branches = shell.read(self.log, 'git', 'branch', '-a') if branches: return set(x[2:].split()[0] for x in branches.split('\n') if x) return set()
def logmessages(self, since, until): _, messages = shell.read(self.log, 'git', 'log', '%s..%s' %(since, until)) return messages
def statusIgnored(self): _, output = shell.read(self.log, 'git', 'status', '--porcelain', '--ignored') return output