Commit 156b7928 authored by Kai Willadsen's avatar Kai Willadsen

vc: Clean up valid_repo calls

parent a7b58ac6
......@@ -109,10 +109,7 @@ class Vc(_vc.CachedVc):
working_dir=self.root)
def valid_repo(self):
if _vc.call([self.CMD, "root"], cwd=self.root):
return False
else:
return True
return not _vc.call([self.CMD, "root"], cwd=self.root)
def get_working_directory(self, workdir):
return self.root
......
......@@ -75,10 +75,7 @@ class Vc(_vc.Vc):
def valid_repo(self):
entry_path = os.path.join(self.root, self.VC_DIR, "Entries")
if os.path.exists(entry_path):
return True
else:
return False
return os.path.exists(entry_path)
def get_path_for_repo_file(self, path, commit=None):
if commit is not None:
......
......@@ -70,10 +70,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "resolve"]
def valid_repo(self):
if _vc.call([self.CMD, "query", "tags"], cwd=self.root):
return False
else:
return True
return not _vc.call([self.CMD, "query", "tags"], cwd=self.root)
def get_working_directory(self, workdir):
return self.root
......
......@@ -66,10 +66,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "revert"]
def valid_repo(self):
if _vc.call([self.CMD, "info"], cwd=self.root):
return False
else:
return True
return not _vc.call([self.CMD, "info"], cwd=self.root)
@classmethod
def check_repo_root(self, location):
......
......@@ -258,10 +258,7 @@ class Vc(_vc.CachedVc):
def valid_repo(self):
# TODO: On Windows, this exit code is wrong under the normal shell; it
# appears to be correct under the default git bash shell however.
if _vc.call([self.CMD, "branch"], cwd=self.root):
return False
else:
return True
return not _vc.call([self.CMD, "branch"], cwd=self.root)
def get_working_directory(self, workdir):
if workdir.startswith("/"):
......
......@@ -62,10 +62,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "revert"]
def valid_repo(self):
if _vc.call([self.CMD, "root"], cwd=self.root):
return False
else:
return True
return not _vc.call([self.CMD, "root"], cwd=self.root)
def get_working_directory(self, workdir):
if workdir.startswith("/"):
......
......@@ -134,10 +134,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "resolved"]
def valid_repo(self):
if _vc.call([self.CMD, "list", "tags"], cwd=self.root):
return False
else:
return True
return not _vc.call([self.CMD, "list", "tags"], cwd=self.root)
def get_working_directory(self, workdir):
return self.root
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment