comparison hgext/largefiles/basestore.py @ 18546:fb0e8966a4be

largefiles: verify status should be written as status, not as write Make 'hg verify --large -q' quiet when no errors.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 04 Feb 2013 02:46:53 +0100
parents f1700480bef7
children 003730ca254d
comparison
equal deleted inserted replaced
18545:a49b7c9fc246 18546:fb0e8966a4be
94 94
95 def verify(self, revs, contents=False): 95 def verify(self, revs, contents=False):
96 '''Verify the existence (and, optionally, contents) of every big 96 '''Verify the existence (and, optionally, contents) of every big
97 file revision referenced by every changeset in revs. 97 file revision referenced by every changeset in revs.
98 Return 0 if all is well, non-zero on any errors.''' 98 Return 0 if all is well, non-zero on any errors.'''
99 write = self.ui.write
100 failed = False 99 failed = False
101 100
102 write(_('searching %d changesets for largefiles\n') % len(revs)) 101 self.ui.status(_('searching %d changesets for largefiles\n') %
102 len(revs))
103 verified = set() # set of (filename, filenode) tuples 103 verified = set() # set of (filename, filenode) tuples
104 104
105 for rev in revs: 105 for rev in revs:
106 cctx = self.repo[rev] 106 cctx = self.repo[rev]
107 cset = "%d:%s" % (cctx.rev(), node.short(cctx.node())) 107 cset = "%d:%s" % (cctx.rev(), node.short(cctx.node()))
111 failed = True 111 failed = True
112 112
113 numrevs = len(verified) 113 numrevs = len(verified)
114 numlfiles = len(set([fname for (fname, fnode) in verified])) 114 numlfiles = len(set([fname for (fname, fnode) in verified]))
115 if contents: 115 if contents:
116 write(_('verified contents of %d revisions of %d largefiles\n') 116 self.ui.status(
117 % (numrevs, numlfiles)) 117 _('verified contents of %d revisions of %d largefiles\n')
118 % (numrevs, numlfiles))
118 else: 119 else:
119 write(_('verified existence of %d revisions of %d largefiles\n') 120 self.ui.status(
120 % (numrevs, numlfiles)) 121 _('verified existence of %d revisions of %d largefiles\n')
121 122 % (numrevs, numlfiles))
122 return int(failed) 123 return int(failed)
123 124
124 def _getfile(self, tmpfile, filename, hash): 125 def _getfile(self, tmpfile, filename, hash):
125 '''Fetch one revision of one file from the store and write it 126 '''Fetch one revision of one file from the store and write it
126 to tmpfile. Compute the hash of the file on-the-fly as it 127 to tmpfile. Compute the hash of the file on-the-fly as it