mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-11-01 09:05: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:
|
if a == b:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
pfunc = repo.changelog.parentrevs
|
||||||
|
|
||||||
positive = []
|
positive = []
|
||||||
pending = set([b.rev()])
|
pending = set([b.rev()])
|
||||||
negative = set([a.rev()])
|
negative = set([a.rev()])
|
||||||
@@ -483,7 +485,7 @@ def gitrange(repo, a, b):
|
|||||||
if not pending:
|
if not pending:
|
||||||
break
|
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:
|
if cur in pending:
|
||||||
positive.append(cur)
|
positive.append(cur)
|
||||||
|
|||||||
Reference in New Issue
Block a user