1. Augie Fackler
  2. hgsubversion

Commits

Sean Farley  committed 56f426d

util: add resave bool parameter to load

This parameter is needed as a stopgap so that tests can use the common
util.load method without having to change the format of the file. It isn't used
now but will be in upcoming patches.

  • Participants
  • Parent commits 4cdb0e9
  • Branches default

Comments (0)

Files changed (1)

File hgsubversion/util.py

View file
     json.dump(_convert(data, _scrub), f)
     f.close()
 
-def load(file_path, default=None):
+def load(file_path, default=None, resave=True):
     """Deserialize some data from a path.
     """
     data = default
 
         # convert the file to json immediately
         f.close()
-        dump(data, file_path)
+        if resave:
+            dump(data, file_path)
     return data
 
 def parseurl(url, heads=[]):