Check for git or hg repository

def find_repo_type(self):
        """Check for git or hg repository"""
        is_git = self.call(['git', 'rev-parse', '--is-inside-work-tree'],
                           devnull=True)
        if is_git != 0:
            if self.debug:
                click.echo('not git')
            is_hg = self.call(['hg', '-q', 'stat'], devnull=True)
            if is_hg != 0:
                if self.debug:
                    click.echo('not hg')
                exit(1)
            else:
                self.vc_name = 'hg'