/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/fastimport/idmapfile.py

  • Committer: Martin
  • Date: 2017-06-05 20:48:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6658.
  • Revision ID: gzlist@googlemail.com-20170605204831-20accykspjcrx0a8
Apply 2to3 dict fixer and clean up resulting mess using view helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    :param filename: name of the file to save the data to
30
30
    :param revision_ids: a dictionary of commit ids to revision ids.
31
31
    """
32
 
    f = open(filename, 'wb')
33
 
    try:
34
 
        for commit_id, rev_id in revision_ids.iteritems():
35
 
            f.write("%s %s\n" % (commit_id, rev_id))
36
 
        f.flush()
37
 
    finally:
38
 
        f.close()
 
32
    with open(filename, 'wb') as f:
 
33
        for commit_id in revision_ids:
 
34
            f.write("%s %s\n" % (commit_id, revision_ids[commit_id]))
39
35
 
40
36
 
41
37
def load_id_map(filename):