##// END OF EJS Templates
outgoing: add a simple fastpath when there is no common...
marmoute -
r52488:3a6fae3b default
parent child Browse files
Show More
@@ -104,16 +104,28 b' class outgoing:'
104 m = 'commonheads and missingroots arguments are mutually exclusive'
104 m = 'commonheads and missingroots arguments are mutually exclusive'
105 raise error.ProgrammingError(m)
105 raise error.ProgrammingError(m)
106 cl = repo.changelog
106 cl = repo.changelog
107 unfi = repo.unfiltered()
108 ucl = unfi.changelog
109 to_node = ucl.node
107 missing = None
110 missing = None
108 common = None
111 common = None
112 arg_anc = ancestorsof
109 if ancestorsof is None:
113 if ancestorsof is None:
110 ancestorsof = cl.heads()
114 ancestorsof = cl.heads()
111 if missingroots:
115
116 # XXX-perf: do we need all this to be node-list? They would be simpler
117 # as rev-num sets (and smartset)
118 if missingroots == [nodemod.nullrev] or missingroots == []:
119 commonheads = [repo.nullid]
120 common = set()
121 if arg_anc is None:
122 missing = [to_node(r) for r in cl]
123 else:
124 missing_rev = repo.revs('::%ln', missingroots, ancestorsof)
125 missing = [to_node(r) for r in missing_rev]
126 elif missingroots is not None:
112 # TODO remove call to nodesbetween.
127 # TODO remove call to nodesbetween.
113 missing_rev = repo.revs('%ln::%ln', missingroots, ancestorsof)
128 missing_rev = repo.revs('%ln::%ln', missingroots, ancestorsof)
114 unfi = repo.unfiltered()
115 ucl = unfi.changelog
116 to_node = ucl.node
117 ancestorsof = [to_node(r) for r in ucl.headrevs(missing_rev)]
129 ancestorsof = [to_node(r) for r in ucl.headrevs(missing_rev)]
118 parent_revs = ucl.parentrevs
130 parent_revs = ucl.parentrevs
119 common_legs = set()
131 common_legs = set()
General Comments 0
You need to be logged in to leave comments. Login now