Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GitPlugin: get rid of unecessary readlines() calls

  • Loading branch information...
commit d9e57d4d268fc699f90d802e43b20e9f08631802 1 parent d8f6c4a
@hvr authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 tracext/git/PyGIT.py
View
14 tracext/git/PyGIT.py
@@ -238,7 +238,7 @@ def get_rev_cache(self):
new_tags = set([])
youngest = None
oldest = None
- for revs in self.repo.rev_parse("--tags").readlines():
+ for revs in self.repo.rev_parse("--tags"):
new_tags.add(revs.strip())
# helper for reusing strings
@@ -248,7 +248,7 @@ def __rev_reuse(rev):
return __rev_seen.setdefault(rev, rev)
rev = ord_rev = 0
- for revs in self.repo.rev_list("--parents", "--all").readlines():
+ for revs in self.repo.rev_list("--parents", "--all"):
revs = revs.strip().split()
revs = map(__rev_reuse, revs)
@@ -464,7 +464,7 @@ def fullrev(self, srev):
def get_branches(self):
"returns list of (local) branches, with active (= HEAD) one being the first item"
result=[]
- for e in self.repo.branch("-v", "--no-abbrev").readlines():
+ for e in self.repo.branch("-v", "--no-abbrev"):
(bname,bsha)=e[1:].strip().split()[:2]
if e.startswith('*'):
result.insert(0,(bname,bsha))
@@ -473,7 +473,7 @@ def get_branches(self):
return result
def get_tags(self):
- return [e.strip() for e in self.repo.tag("-l").readlines()]
+ return [e.strip() for e in self.repo.tag("-l")]
def ls_tree(self, rev, path=""):
rev = str(rev) # paranoia
@@ -588,14 +588,14 @@ def history(self, sha, path, limit=None):
if limit is None:
limit = -1
for rev in self.repo.rev_list("--max-count=%d" % limit,
- str(sha), "--", path).readlines():
+ str(sha), "--", path):
yield rev.strip()
def history_timerange(self, start, stop):
for rev in self.repo.rev_list("--reverse",
"--max-age=%d" % start,
"--min-age=%d" % stop,
- "--all").readlines():
+ "--all"):
yield rev.strip()
def rev_is_anchestor_of(self, rev1, rev2):
@@ -607,7 +607,7 @@ def rev_is_anchestor_of(self, rev1, rev2):
def blame(self, commit_sha, path):
in_metadata = False
- for line in self.repo.blame("-p", "--", path, str(commit_sha)).readlines():
+ for line in self.repo.blame("-p", "--", path, str(commit_sha)):
assert line
if in_metadata:
in_metadata = not line.startswith('\t')
Please sign in to comment.
Something went wrong with that request. Please try again.