Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 7361:9fe97eea5510
linkrev: take a revision number rather than a hash
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 12 Nov 2008 15:19:14 -0600 |
parents | b9bf36905b55 |
children | 374a6b3ac623 |
comparison
equal
deleted
inserted
replaced
7360:42f1b8cb9a60 | 7361:9fe97eea5510 |
---|---|
1701 has_mnfst_set = {} | 1701 has_mnfst_set = {} |
1702 for n in msng_mnfst_set: | 1702 for n in msng_mnfst_set: |
1703 # If a 'missing' manifest thinks it belongs to a changenode | 1703 # If a 'missing' manifest thinks it belongs to a changenode |
1704 # the recipient is assumed to have, obviously the recipient | 1704 # the recipient is assumed to have, obviously the recipient |
1705 # must have that manifest. | 1705 # must have that manifest. |
1706 linknode = cl.node(mnfst.linkrev(n)) | 1706 linknode = cl.node(mnfst.linkrev(mnfst.rev(n))) |
1707 if linknode in has_cl_set: | 1707 if linknode in has_cl_set: |
1708 has_mnfst_set[n] = 1 | 1708 has_mnfst_set[n] = 1 |
1709 prune_parents(mnfst, has_mnfst_set, msng_mnfst_set) | 1709 prune_parents(mnfst, has_mnfst_set, msng_mnfst_set) |
1710 | 1710 |
1711 # Use the information collected in collect_manifests_and_files to say | 1711 # Use the information collected in collect_manifests_and_files to say |
1767 hasset = {} | 1767 hasset = {} |
1768 # If a 'missing' filenode thinks it belongs to a changenode we | 1768 # If a 'missing' filenode thinks it belongs to a changenode we |
1769 # assume the recipient must have, then the recipient must have | 1769 # assume the recipient must have, then the recipient must have |
1770 # that filenode. | 1770 # that filenode. |
1771 for n in msngset: | 1771 for n in msngset: |
1772 clnode = cl.node(filerevlog.linkrev(n)) | 1772 clnode = cl.node(filerevlog.linkrev(filerevlog.rev(n))) |
1773 if clnode in has_cl_set: | 1773 if clnode in has_cl_set: |
1774 hasset[n] = 1 | 1774 hasset[n] = 1 |
1775 prune_parents(filerevlog, hasset, msngset) | 1775 prune_parents(filerevlog, hasset, msngset) |
1776 | 1776 |
1777 # A function generator function that sets up the a context for the | 1777 # A function generator function that sets up the a context for the |
1890 def identity(x): | 1890 def identity(x): |
1891 return x | 1891 return x |
1892 | 1892 |
1893 def gennodelst(log): | 1893 def gennodelst(log): |
1894 for r in log: | 1894 for r in log: |
1895 n = log.node(r) | 1895 if log.linkrev(r) in revset: |
1896 if log.linkrev(n) in revset: | 1896 yield log.node(r) |
1897 yield n | |
1898 | 1897 |
1899 def changed_file_collector(changedfileset): | 1898 def changed_file_collector(changedfileset): |
1900 def collect_changed_files(clnode): | 1899 def collect_changed_files(clnode): |
1901 c = cl.read(clnode) | 1900 c = cl.read(clnode) |
1902 for fname in c[3]: | 1901 for fname in c[3]: |
1903 changedfileset[fname] = 1 | 1902 changedfileset[fname] = 1 |
1904 return collect_changed_files | 1903 return collect_changed_files |
1905 | 1904 |
1906 def lookuprevlink_func(revlog): | 1905 def lookuprevlink_func(revlog): |
1907 def lookuprevlink(n): | 1906 def lookuprevlink(n): |
1908 return cl.node(revlog.linkrev(n)) | 1907 return cl.node(revlog.linkrev(revlog.rev(n))) |
1909 return lookuprevlink | 1908 return lookuprevlink |
1910 | 1909 |
1911 def gengroup(): | 1910 def gengroup(): |
1912 # construct a list of all changed files | 1911 # construct a list of all changed files |
1913 changedfiles = {} | 1912 changedfiles = {} |