# HG changeset patch # User Greg Ward # Date 1437935929 14400 # Node ID 47bc97e1c46f96177813965b01477f8cd65f6ed2 # Parent d88ce26e0946d3909dec6b13ef66813bf2ad4e6c Drop support for Mercurial <= 1.5. It doesn't work, and who cares anymore? diff -r d88ce26e0946 -r 47bc97e1c46f hgfastimport/hgimport.py --- 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).