Commits

Sean Farley committed 4cdb0e9

svncommands: call util.dump instead of manually writing file

Comments (0)

Files changed (1)

hgsubversion/svncommands.py

     startrev = 0
     sofar = []
     branchinfo = {}
+    youngestpath = os.path.join(svnmetadir, 'lastpulled')
     if partial:
         try:
-            youngestpath = os.path.join(svnmetadir, 'lastpulled')
             foundpartialinfo = False
             if os.path.exists(youngestpath):
                 youngest = util.load(youngestpath)
             ui.status('no metadata available -- doing a full rebuild\n')
 
 
-    lastpulled = open(os.path.join(svnmetadir, 'lastpulled'), 'wb')
     revmap = open(os.path.join(svnmetadir, 'rev_map'), 'w')
     revmap.write('1\n')
     revmap.writelines(sofar)
             else:
                 closed.add(parentctx.rev())
 
-    lastpulled.write(str(youngest) + '\n')
+    util.dump(youngest, youngestpath)
     ui.progress('prepare', None, total=numrevs)
 
     for rev in xrange(startrev, len(repo)):