Commits

Sean Farley committed 2922f48

util: add a method to load data from a file

Comments (0)

Files changed (1)

hgsubversion/util.py

     pickle.dump(data, f)
     f.close()
 
+def load(file_path):
+    """pickle load some data from a path.
+    """
+    data = None
+    if os.path.exists(file_path):
+        f = open(file_path)
+        data = pickle.load(f)
+        f.close()
+    return data
+
 def parseurl(url, heads=[]):
     checkout = None
     svn_url, (_junk, heads) = hg.parseurl(url, heads)