Mercurial > hg
comparison mercurial/localrepo.py @ 5543:a3df02cd4a35
push/pull: abort if we try to visit a missing or empty revlog
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 21 Nov 2007 13:26:18 -0600 |
parents | 61462e7d62ed |
children | bdb81d46b2fb |
comparison
equal
deleted
inserted
replaced
5542:253736bb0dc9 | 5543:a3df02cd4a35 |
---|---|
1708 changedfiles = changedfiles.keys() | 1708 changedfiles = changedfiles.keys() |
1709 changedfiles.sort() | 1709 changedfiles.sort() |
1710 # Go through all our files in order sorted by name. | 1710 # Go through all our files in order sorted by name. |
1711 for fname in changedfiles: | 1711 for fname in changedfiles: |
1712 filerevlog = self.file(fname) | 1712 filerevlog = self.file(fname) |
1713 if filerevlog.count() == 0: | |
1714 raise util.abort(_("empty or missing revlog for %s") % fname) | |
1713 # Toss out the filenodes that the recipient isn't really | 1715 # Toss out the filenodes that the recipient isn't really |
1714 # missing. | 1716 # missing. |
1715 if msng_filenode_set.has_key(fname): | 1717 if msng_filenode_set.has_key(fname): |
1716 prune_filenodes(fname, filerevlog) | 1718 prune_filenodes(fname, filerevlog) |
1717 msng_filenode_lst = msng_filenode_set[fname].keys() | 1719 msng_filenode_lst = msng_filenode_set[fname].keys() |
1792 for chnk in mnfst.group(nodeiter, lookuprevlink_func(mnfst)): | 1794 for chnk in mnfst.group(nodeiter, lookuprevlink_func(mnfst)): |
1793 yield chnk | 1795 yield chnk |
1794 | 1796 |
1795 for fname in changedfiles: | 1797 for fname in changedfiles: |
1796 filerevlog = self.file(fname) | 1798 filerevlog = self.file(fname) |
1799 if filerevlog.count() == 0: | |
1800 raise util.abort(_("empty or missing revlog for %s") % fname) | |
1797 nodeiter = gennodelst(filerevlog) | 1801 nodeiter = gennodelst(filerevlog) |
1798 nodeiter = list(nodeiter) | 1802 nodeiter = list(nodeiter) |
1799 if nodeiter: | 1803 if nodeiter: |
1800 yield changegroup.chunkheader(len(fname)) | 1804 yield changegroup.chunkheader(len(fname)) |
1801 yield fname | 1805 yield fname |