Commits

Sean Farley committed 9ec3c2e

util: banish pickle to compathacks

Comments (0)

Files changed (2)

hgsubversion/compathacks.py

         return set(repo.branchmap())
     except AttributeError:
         return set(repo.branchtags())
+
+def pickle_load(f):
+    import cPickle as pickle
+    f.seek(0)
+    return pickle.load(f)

hgsubversion/util.py

-import cPickle as pickle
+import compathacks
 import errno
 import re
 import os
         f.close()
     except ValueError:
         # Ok, JSON couldn't be loaded, so we'll try the old way of using pickle
-        f.seek(0)
-        data = pickle.load(f)
+        data = compathacks.pickle_load(f)
 
         # convert the file to json immediately
         f.close()