Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHGaefb75730ea3: convert: don't use type as a variable name
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/convert/git.py (8 lines) |
heads = [] | heads = [] | ||||
for rev in self.revs: | for rev in self.revs: | ||||
rawhead, ret = self.gitrun('rev-parse', '--verify', rev) | rawhead, ret = self.gitrun('rev-parse', '--verify', rev) | ||||
heads.append(rawhead[:-1]) | heads.append(rawhead[:-1]) | ||||
if ret: | if ret: | ||||
raise error.Abort(_('cannot retrieve git head "%s"') % rev) | raise error.Abort(_('cannot retrieve git head "%s"') % rev) | ||||
return heads | return heads | ||||
def catfile(self, rev, type): | def catfile(self, rev, ftype): | ||||
if rev == nodemod.nullhex: | if rev == nodemod.nullhex: | ||||
raise IOError | raise IOError | ||||
self.catfilepipe[0].write(rev+'\n') | self.catfilepipe[0].write(rev+'\n') | ||||
self.catfilepipe[0].flush() | self.catfilepipe[0].flush() | ||||
info = self.catfilepipe[1].readline().split() | info = self.catfilepipe[1].readline().split() | ||||
if info[1] != type: | if info[1] != ftype: | ||||
raise error.Abort(_('cannot read %r object at %s') % (type, rev)) | raise error.Abort(_('cannot read %r object at %s') % (ftype, rev)) | ||||
size = int(info[2]) | size = int(info[2]) | ||||
data = self.catfilepipe[1].read(size) | data = self.catfilepipe[1].read(size) | ||||
if len(data) < size: | if len(data) < size: | ||||
raise error.Abort(_('cannot read %r object at %s: unexpected size') | raise error.Abort(_('cannot read %r object at %s: unexpected size') | ||||
% (type, rev)) | % (ftype, rev)) | ||||
# read the trailing newline | # read the trailing newline | ||||
self.catfilepipe[1].read(1) | self.catfilepipe[1].read(1) | ||||
return data | return data | ||||
def getfile(self, name, rev): | def getfile(self, name, rev): | ||||
if rev == nodemod.nullhex: | if rev == nodemod.nullhex: | ||||
return None, None | return None, None | ||||
if name == '.hgsub': | if name == '.hgsub': |