mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 18:32:14 +02:00
filter-repo (python3): f.readline() instead of f.next() and StopIteration
File iterators, at least when opened in binary mode, apparently operately differently in python3. Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
4c05cbe072
commit
12602dae9c
@ -2244,25 +2244,23 @@ class RepoAnalyze(object):
|
|||||||
' --date=short -M -t -c --raw --combined-all-paths')
|
' --date=short -M -t -c --raw --combined-all-paths')
|
||||||
dtp = subprocess.Popen(cmd, shell=True, bufsize=-1, stdout=subprocess.PIPE)
|
dtp = subprocess.Popen(cmd, shell=True, bufsize=-1, stdout=subprocess.PIPE)
|
||||||
f = dtp.stdout
|
f = dtp.stdout
|
||||||
try:
|
line = f.readline()
|
||||||
line = f.next()
|
if not line:
|
||||||
except StopIteration:
|
|
||||||
raise SystemExit(_("Nothing to analyze; repository is empty."))
|
raise SystemExit(_("Nothing to analyze; repository is empty."))
|
||||||
cont = bool(line)
|
cont = bool(line)
|
||||||
graph = AncestryGraph()
|
graph = AncestryGraph()
|
||||||
while cont:
|
while cont:
|
||||||
commit = line.rstrip()
|
commit = line.rstrip()
|
||||||
parents = f.next().split()
|
parents = f.readline().split()
|
||||||
date = f.next().rstrip()
|
date = f.readline().rstrip()
|
||||||
|
|
||||||
# We expect a blank line next; if we get a non-blank line then
|
# We expect a blank line next; if we get a non-blank line then
|
||||||
# this commit modified no files and we need to move on to the next.
|
# this commit modified no files and we need to move on to the next.
|
||||||
# If there is no line, we've reached end-of-input.
|
# If there is no line, we've reached end-of-input.
|
||||||
try:
|
line = f.readline()
|
||||||
line = f.next().rstrip()
|
if not line:
|
||||||
cont = True
|
|
||||||
except StopIteration:
|
|
||||||
cont = False
|
cont = False
|
||||||
|
line = line.rstrip()
|
||||||
|
|
||||||
# If we haven't reached end of input, and we got a blank line meaning
|
# If we haven't reached end of input, and we got a blank line meaning
|
||||||
# a commit that has modified files, then get the file changes associated
|
# a commit that has modified files, then get the file changes associated
|
||||||
|
Loading…
Reference in New Issue
Block a user