Mercurial > hg > hg-fastimport
diff hgfastimport/hgimport.py @ 68:47bc97e1c46f
Drop support for Mercurial <= 1.5.
It doesn't work, and who cares anymore?
| author | Greg Ward <greg@gerg.ca> |
|---|---|
| date | Sun, 26 Jul 2015 14:38:49 -0400 |
| parents | ae32828c68d7 |
| children | 5dc3ab8142d5 |
line wrap: on
line diff
--- a/hgfastimport/hgimport.py Sun Jul 26 12:42:36 2015 -0400 +++ b/hgfastimport/hgimport.py Sun Jul 26 14:38:49 2015 -0400 @@ -29,9 +29,6 @@ from fastimport import processor, parser -# convertor source objects had a getmode() method up to Mercurial 1.5, -# but in 1.6 it was merged with getfile() -HAVE_GETMODE = hasattr(converthg.mercurial_source, 'getmode') class fastimport_source(common.converter_source): """Interface between the fastimport processor below and Mercurial's @@ -59,29 +56,11 @@ allheads.extend(branchheads) return allheads - # Mercurial <= 1.5 - if HAVE_GETMODE: - def getfile(self, name, fileid): - """Return file contents as a string. rev is the identifier returned - by a previous call to getchanges(). - """ - if fileid is None: # deleted file - raise IOError - return self.processor.getblob(fileid) - - def getmode(self, name, fileid): - """Return file mode, eg. '', 'x', or 'l'. rev is the identifier - returned by a previous call to getchanges(). - """ - return self.processor.getmode(name, fileid) - - # Mercurial >= 1.6 - else: - def getfile(self, name, fileid): - if fileid is None: # deleted file - raise IOError - return (self.processor.getblob(fileid), - self.processor.getmode(name, fileid)) + def getfile(self, name, fileid): + if fileid is None: # deleted file + raise IOError + return (self.processor.getblob(fileid), + self.processor.getmode(name, fileid)) def getchanges(self, commitid): """Returns a tuple of (files, copies).
