mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-29 23:55:48 +01:00
gitrange(): store parentrevs method
By calling the methods through a variable the code is significantly faster. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
@@ -476,6 +476,8 @@ def gitrange(repo, a, b):
|
||||
if a == b:
|
||||
return []
|
||||
|
||||
pfunc = repo.changelog.parentrevs
|
||||
|
||||
positive = []
|
||||
pending = set([b.rev()])
|
||||
negative = set([a.rev()])
|
||||
@@ -483,7 +485,7 @@ def gitrange(repo, a, b):
|
||||
if not pending:
|
||||
break
|
||||
|
||||
parents = [p for p in repo.changelog.parentrevs(cur) if p >= 0]
|
||||
parents = [p for p in pfunc(cur) if p >= 0]
|
||||
|
||||
if cur in pending:
|
||||
positive.append(cur)
|
||||
|
||||
Reference in New Issue
Block a user