diff hggit/git_handler.py @ 681:acb429c62c28

git_handler.save_map: drop support for Mercurial < 1.9
author Siddharth Agarwal <sid0@fb.com>
date Wed, 19 Feb 2014 16:10:35 -0800
parents baba2cf03d41
children 2cfda7bc4c46
line wrap: on
line diff
--- a/hggit/git_handler.py	Wed Feb 19 16:09:23 2014 -0800
+++ b/hggit/git_handler.py	Wed Feb 19 16:10:35 2014 -0800
@@ -169,10 +169,8 @@
         file = self.repo.opener(self.mapfile, 'w+', atomictemp=True)
         for hgsha, gitsha in sorted(self._map_hg.iteritems()):
             file.write("%s %s\n" % (gitsha, hgsha))
-        # If this complains that NoneType is not callable, then
-        # atomictempfile no longer has either of rename (pre-1.9) or
-        # close (post-1.9)
-        getattr(file, 'rename', getattr(file, 'close', None))()
+        # If this complains, atomictempfile no longer has close
+        file.close()
 
     def load_tags(self):
         self.tags = {}