hgext/convert/bzr.py
changeset 11134 33010ff1fd6f
parent 10939 9f6731b03906
child 12063 516b000fbb7e
equal deleted inserted replaced
11133:d7b6aab612b4 11134:33010ff1fd6f
   107             kind = revtree.kind(fileid)
   107             kind = revtree.kind(fileid)
   108         if kind not in supportedkinds:
   108         if kind not in supportedkinds:
   109             # the file is not available anymore - was deleted
   109             # the file is not available anymore - was deleted
   110             raise IOError(_('%s is not available in %s anymore') %
   110             raise IOError(_('%s is not available in %s anymore') %
   111                     (name, rev))
   111                     (name, rev))
       
   112         mode = self._modecache[(name, rev)]
   112         if kind == 'symlink':
   113         if kind == 'symlink':
   113             target = revtree.get_symlink_target(fileid)
   114             target = revtree.get_symlink_target(fileid)
   114             if target is None:
   115             if target is None:
   115                 raise util.Abort(_('%s.%s symlink has no target')
   116                 raise util.Abort(_('%s.%s symlink has no target')
   116                                  % (name, rev))
   117                                  % (name, rev))
   117             return target
   118             return target, mode
   118         else:
   119         else:
   119             sio = revtree.get_file(fileid)
   120             sio = revtree.get_file(fileid)
   120             return sio.read()
   121             return sio.read(), mode
   121 
       
   122     def getmode(self, name, rev):
       
   123         return self._modecache[(name, rev)]
       
   124 
   122 
   125     def getchanges(self, version):
   123     def getchanges(self, version):
   126         # set up caches: modecache and revtree
   124         # set up caches: modecache and revtree
   127         self._modecache = {}
   125         self._modecache = {}
   128         self._revtree = self.sourcerepo.revision_tree(version)
   126         self._revtree = self.sourcerepo.revision_tree(version)