equal
deleted
inserted
replaced
22 ) |
22 ) |
23 from . import ( |
23 from . import ( |
24 bookmarks as bookmod, |
24 bookmarks as bookmod, |
25 bundle2, |
25 bundle2, |
26 changegroup, |
26 changegroup, |
27 dagutil, |
|
28 discovery, |
27 discovery, |
29 error, |
28 error, |
30 lock as lockmod, |
29 lock as lockmod, |
31 logexchange, |
30 logexchange, |
32 narrowspec, |
31 narrowspec, |
1904 correct parents. |
1903 correct parents. |
1905 """ |
1904 """ |
1906 cl = repo.changelog |
1905 cl = repo.changelog |
1907 mfl = repo.manifestlog |
1906 mfl = repo.manifestlog |
1908 |
1907 |
1909 cldag = dagutil.revlogdag(cl) |
1908 clrev = cl.rev |
1910 # dagutil does not like nullid/nullrev |
1909 |
1911 commonrevs = cldag.internalizeall(common - set([nullid])) | set([nullrev]) |
1910 commonrevs = {clrev(n) for n in common} | {nullrev} |
1912 headsrevs = cldag.internalizeall(heads) |
1911 headsrevs = {clrev(n) for n in heads} |
|
1912 |
1913 if depth: |
1913 if depth: |
1914 revdepth = {h: 0 for h in headsrevs} |
1914 revdepth = {h: 0 for h in headsrevs} |
1915 |
1915 |
1916 ellipsisheads = collections.defaultdict(set) |
1916 ellipsisheads = collections.defaultdict(set) |
1917 ellipsisroots = collections.defaultdict(set) |
1917 ellipsisroots = collections.defaultdict(set) |
1952 relevant_nodes = set() |
1952 relevant_nodes = set() |
1953 visitnodes = [cl.node(m) for m in missing] |
1953 visitnodes = [cl.node(m) for m in missing] |
1954 required = set(headsrevs) | known |
1954 required = set(headsrevs) | known |
1955 for rev in visit: |
1955 for rev in visit: |
1956 clrev = cl.changelogrevision(rev) |
1956 clrev = cl.changelogrevision(rev) |
1957 ps = cldag.parents(rev) |
1957 ps = [prev for prev in cl.parentrevs(rev) if prev != nullrev] |
1958 if depth is not None: |
1958 if depth is not None: |
1959 curdepth = revdepth[rev] |
1959 curdepth = revdepth[rev] |
1960 for p in ps: |
1960 for p in ps: |
1961 revdepth[p] = min(curdepth + 1, revdepth.get(p, depth + 1)) |
1961 revdepth[p] = min(curdepth + 1, revdepth.get(p, depth + 1)) |
1962 needed = False |
1962 needed = False |