Mercurial > hg
comparison mercurial/exchange.py @ 39158:b0c73866c9fb
exchange: don't use dagutil
We were only using it for simple node -> rev and parent revision
lookups. These are exposed via the storage interface and we don't
need to go through dagutil.
Differential Revision: https://phab.mercurial-scm.org/D4303
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 16 Aug 2018 19:23:24 +0000 |
parents | a232e6744ba3 |
children | 130e5df346d5 |
comparison
equal
deleted
inserted
replaced
39157:a98e926b2f5b | 39158:b0c73866c9fb |
---|---|
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 |