Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 17424:e7cfe3587ea4
fix trivial spelling errors
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 15 Aug 2012 22:38:42 +0200 |
parents | b05e517c2236 |
children | 57c6c24b9bc4 |
comparison
equal
deleted
inserted
replaced
17406:fc14953e8e34 | 17424:e7cfe3587ea4 |
---|---|
298 @propertycache | 298 @propertycache |
299 def hiddenrevs(self): | 299 def hiddenrevs(self): |
300 """hiddenrevs: revs that should be hidden by command and tools | 300 """hiddenrevs: revs that should be hidden by command and tools |
301 | 301 |
302 This set is carried on the repo to ease initialisation and lazy | 302 This set is carried on the repo to ease initialisation and lazy |
303 loading it'll probably move back to changelog for efficienty and | 303 loading it'll probably move back to changelog for efficiency and |
304 consistency reason | 304 consistency reason |
305 | 305 |
306 Note that the hiddenrevs will needs invalidations when | 306 Note that the hiddenrevs will needs invalidations when |
307 - a new changesets is added (possible unstable above extinct) | 307 - a new changesets is added (possible unstable above extinct) |
308 - a new obsolete marker is added (possible new extinct changeset) | 308 - a new obsolete marker is added (possible new extinct changeset) |
710 for branch, newnodes in newbranches.iteritems(): | 710 for branch, newnodes in newbranches.iteritems(): |
711 bheads = partial.setdefault(branch, []) | 711 bheads = partial.setdefault(branch, []) |
712 # Remove candidate heads that no longer are in the repo (e.g., as | 712 # Remove candidate heads that no longer are in the repo (e.g., as |
713 # the result of a strip that just happened). Avoid using 'node in | 713 # the result of a strip that just happened). Avoid using 'node in |
714 # self' here because that dives down into branchcache code somewhat | 714 # self' here because that dives down into branchcache code somewhat |
715 # recrusively. | 715 # recursively. |
716 bheadrevs = [self.changelog.rev(node) for node in bheads | 716 bheadrevs = [self.changelog.rev(node) for node in bheads |
717 if self.changelog.hasnode(node)] | 717 if self.changelog.hasnode(node)] |
718 newheadrevs = [self.changelog.rev(node) for node in newnodes | 718 newheadrevs = [self.changelog.rev(node) for node in newnodes |
719 if self.changelog.hasnode(node)] | 719 if self.changelog.hasnode(node)] |
720 ctxisnew = bheadrevs and min(newheadrevs) > max(bheadrevs) | 720 ctxisnew = bheadrevs and min(newheadrevs) > max(bheadrevs) |
730 iterrevs = sorted(newheadrevs) | 730 iterrevs = sorted(newheadrevs) |
731 else: | 731 else: |
732 iterrevs = list(bheadrevs) | 732 iterrevs = list(bheadrevs) |
733 | 733 |
734 # This loop prunes out two kinds of heads - heads that are | 734 # This loop prunes out two kinds of heads - heads that are |
735 # superceded by a head in newheadrevs, and newheadrevs that are not | 735 # superseded by a head in newheadrevs, and newheadrevs that are not |
736 # heads because an existing head is their descendant. | 736 # heads because an existing head is their descendant. |
737 while iterrevs: | 737 while iterrevs: |
738 latest = iterrevs.pop() | 738 latest = iterrevs.pop() |
739 if latest not in bheadrevs: | 739 if latest not in bheadrevs: |
740 continue | 740 continue |
1477 | 1477 |
1478 If you know the branchheadcache was uptodate before nodes were removed | 1478 If you know the branchheadcache was uptodate before nodes were removed |
1479 and you also know the set of candidate new heads that may have resulted | 1479 and you also know the set of candidate new heads that may have resulted |
1480 from the destruction, you can set newheadnodes. This will enable the | 1480 from the destruction, you can set newheadnodes. This will enable the |
1481 code to update the branchheads cache, rather than having future code | 1481 code to update the branchheads cache, rather than having future code |
1482 decide it's invalid and regenrating it from scratch. | 1482 decide it's invalid and regenerating it from scratch. |
1483 ''' | 1483 ''' |
1484 # If we have info, newheadnodes, on how to update the branch cache, do | 1484 # If we have info, newheadnodes, on how to update the branch cache, do |
1485 # it, Otherwise, since nodes were destroyed, the cache is stale and this | 1485 # it, Otherwise, since nodes were destroyed, the cache is stale and this |
1486 # will be caught the next time it is read. | 1486 # will be caught the next time it is read. |
1487 if newheadnodes: | 1487 if newheadnodes: |
1904 # we return an integer indicating remote head count | 1904 # we return an integer indicating remote head count |
1905 # change | 1905 # change |
1906 ret = remote.addchangegroup(cg, 'push', self.url()) | 1906 ret = remote.addchangegroup(cg, 'push', self.url()) |
1907 | 1907 |
1908 if ret: | 1908 if ret: |
1909 # push succeed, synchonize target of the push | 1909 # push succeed, synchronize target of the push |
1910 cheads = outgoing.missingheads | 1910 cheads = outgoing.missingheads |
1911 elif revs is None: | 1911 elif revs is None: |
1912 # All out push fails. synchronize all common | 1912 # All out push fails. synchronize all common |
1913 cheads = outgoing.commonheads | 1913 cheads = outgoing.commonheads |
1914 else: | 1914 else: |
1923 # while trying to push we already computed the following: | 1923 # while trying to push we already computed the following: |
1924 # common = (::commonheads) | 1924 # common = (::commonheads) |
1925 # missing = ((commonheads::missingheads) - commonheads) | 1925 # missing = ((commonheads::missingheads) - commonheads) |
1926 # | 1926 # |
1927 # We can pick: | 1927 # We can pick: |
1928 # * missingheads part of comon (::commonheads) | 1928 # * missingheads part of common (::commonheads) |
1929 common = set(outgoing.common) | 1929 common = set(outgoing.common) |
1930 cheads = [node for node in revs if node in common] | 1930 cheads = [node for node in revs if node in common] |
1931 # and | 1931 # and |
1932 # * commonheads parents on missing | 1932 # * commonheads parents on missing |
1933 revset = self.set('%ln and parents(roots(%ln))', | 1933 revset = self.set('%ln and parents(roots(%ln))', |
2537 # if revlog format changes, client will have to check version | 2537 # if revlog format changes, client will have to check version |
2538 # and format flags on "stream" capability, and use | 2538 # and format flags on "stream" capability, and use |
2539 # uncompressed only if compatible. | 2539 # uncompressed only if compatible. |
2540 | 2540 |
2541 if not stream: | 2541 if not stream: |
2542 # if the server explicitely prefer to stream (for fast LANs) | 2542 # if the server explicitly prefer to stream (for fast LANs) |
2543 stream = remote.capable('stream-preferred') | 2543 stream = remote.capable('stream-preferred') |
2544 | 2544 |
2545 if stream and not heads: | 2545 if stream and not heads: |
2546 # 'stream' means remote revlog format is revlogv1 only | 2546 # 'stream' means remote revlog format is revlogv1 only |
2547 if remote.capable('stream'): | 2547 if remote.capable('stream'): |