Mercurial > hg
diff hgext/convert/subversion.py @ 11134:33010ff1fd6f
convert: merge sources getmode() into getfile()
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 09 May 2010 21:52:34 +0200 |
parents | d7b6aab612b4 |
children | 94afe7bc87a9 |
line wrap: on
line diff
--- a/hgext/convert/subversion.py Sun May 09 21:49:57 2010 +0200 +++ b/hgext/convert/subversion.py Sun May 09 21:52:34 2010 +0200 @@ -371,19 +371,10 @@ return self.heads - def getfile(self, file, rev): - data, mode = self._getfile(file, rev) - self.modecache[(file, rev)] = mode - return data - - def getmode(self, file, rev): - return self.modecache[(file, rev)] - def getchanges(self, rev): if self._changescache and self._changescache[0] == rev: return self._changescache[1] self._changescache = None - self.modecache = {} (paths, parents) = self.paths[rev] if parents: files, self.removed, copies = self.expandpaths(rev, paths, parents) @@ -826,10 +817,10 @@ raise util.Abort(_('svn: branch has no revision %s') % to_revnum) raise - def _getfile(self, file, rev): + def getfile(self, file, rev): # TODO: ra.get_file transmits the whole file instead of diffs. if file in self.removed: - raise IOError() + raise IOError() mode = '' try: new_module, revnum = self.revsplit(rev)[1:] @@ -1100,12 +1091,11 @@ # Apply changes to working copy for f, v in files: try: - data = source.getfile(f, v) + data, mode = source.getfile(f, v) except IOError: self.delete.append(f) else: - e = source.getmode(f, v) - self.putfile(f, e, data) + self.putfile(f, mode, data) if f in copies: self.copies.append([copies[f], f]) files = [f[0] for f in files]