Mercurial > hg
comparison hgext/convert/git.py @ 36332:aefb75730ea3
convert: don't use type as a variable name
Differential Revision: https://phab.mercurial-scm.org/D2358
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 19 Feb 2018 23:47:53 +0530 |
parents | ab11af15a149 |
children | ce566e0f73d0 |
comparison
equal
deleted
inserted
replaced
36331:e218830f6f0a | 36332:aefb75730ea3 |
---|---|
166 heads.append(rawhead[:-1]) | 166 heads.append(rawhead[:-1]) |
167 if ret: | 167 if ret: |
168 raise error.Abort(_('cannot retrieve git head "%s"') % rev) | 168 raise error.Abort(_('cannot retrieve git head "%s"') % rev) |
169 return heads | 169 return heads |
170 | 170 |
171 def catfile(self, rev, type): | 171 def catfile(self, rev, ftype): |
172 if rev == nodemod.nullhex: | 172 if rev == nodemod.nullhex: |
173 raise IOError | 173 raise IOError |
174 self.catfilepipe[0].write(rev+'\n') | 174 self.catfilepipe[0].write(rev+'\n') |
175 self.catfilepipe[0].flush() | 175 self.catfilepipe[0].flush() |
176 info = self.catfilepipe[1].readline().split() | 176 info = self.catfilepipe[1].readline().split() |
177 if info[1] != type: | 177 if info[1] != ftype: |
178 raise error.Abort(_('cannot read %r object at %s') % (type, rev)) | 178 raise error.Abort(_('cannot read %r object at %s') % (ftype, rev)) |
179 size = int(info[2]) | 179 size = int(info[2]) |
180 data = self.catfilepipe[1].read(size) | 180 data = self.catfilepipe[1].read(size) |
181 if len(data) < size: | 181 if len(data) < size: |
182 raise error.Abort(_('cannot read %r object at %s: unexpected size') | 182 raise error.Abort(_('cannot read %r object at %s: unexpected size') |
183 % (type, rev)) | 183 % (ftype, rev)) |
184 # read the trailing newline | 184 # read the trailing newline |
185 self.catfilepipe[1].read(1) | 185 self.catfilepipe[1].read(1) |
186 return data | 186 return data |
187 | 187 |
188 def getfile(self, name, rev): | 188 def getfile(self, name, rev): |