aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage/vcs/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/storage/vcs/base.py')
-rw-r--r--libbe/storage/vcs/base.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py
index 0521e90..813905c 100644
--- a/libbe/storage/vcs/base.py
+++ b/libbe/storage/vcs/base.py
@@ -430,7 +430,7 @@ class VCS (libbe.storage.base.VersionedStorage):
Get the file contents as they were in a given revision.
Revision==None specifies the current revision.
"""
- if revision != None:
+ if revision is not None:
raise libbe.storage.base.InvalidRevision(
'The %s VCS does not support revision specifiers' % self.name)
path = os.path.join(self.repo, path)
@@ -553,7 +553,7 @@ class VCS (libbe.storage.base.VersionedStorage):
-1
"""
if not hasattr(self, '_parsed_version') \
- or self._parsed_version == None:
+ or self._parsed_version is None:
num_part = self.version().split(' ')[0]
self._parsed_version = []
for num in num_part.split('.'):
@@ -598,7 +598,7 @@ class VCS (libbe.storage.base.VersionedStorage):
return -1
def installed(self):
- if self.version() != None:
+ if self.version() is not None:
return True
return False
@@ -769,7 +769,7 @@ class VCS (libbe.storage.base.VersionedStorage):
self._cached_path_id.remove_id(id)
def _ancestors(self, id=None, revision=None):
- if id==None:
+ if id is None:
path = self.be_dir
else:
path = self.path(id, revision, relpath=False)
@@ -794,7 +794,7 @@ class VCS (libbe.storage.base.VersionedStorage):
self._u_rel_path(path), revision)
listdir = lambda path : self._vcs_listdir(
self._u_rel_path(path), revision)
- if id==None:
+ if id is None:
path = self.be_dir
else:
path = self.path(id, revision, relpath=False)
@@ -813,7 +813,7 @@ class VCS (libbe.storage.base.VersionedStorage):
if c is None: continue
cpath = os.path.join(path, c)
children[i] = self._u_path_to_id(cpath)
- return [c for c in children if c != None]
+ return [c for c in children if c is not None]
def _get(self, id, default=libbe.util.InvalidObject, revision=None):
try:
@@ -1017,7 +1017,7 @@ class VCS (libbe.storage.base.VersionedStorage):
'/a.b/c/.be'
"""
if root is None:
- assert self.repo != None, "VCS not rooted"
+ assert self.repo is not None, "VCS not rooted"
root = self.repo
return os.path.abspath(os.path.join(root, path))
@@ -1138,7 +1138,7 @@ if libbe.TESTING:
dp = os.path.realpath(self.dirname)
vcs_name = self.Class.name
self.assertTrue(
- dp == rp or rp == None,
+ dp == rp or rp is None,
"%(vcs_name)s VCS root in wrong dir (%(dp)s %(rp)s)" % vars())
class VCS_get_user_id_TestCase(VCSTestCase):
@@ -1151,7 +1151,7 @@ if libbe.TESTING:
if user_id is None:
return
name,email = libbe.ui.util.user.parse_user_id(user_id)
- if email != None:
+ if email is not None:
self.assertTrue('@' in email, email)
def make_vcs_testcase_subclasses(vcs_class, namespace):