view hgsubversion/layouts/persist.py @ 1006:7a3b938825cd

layouts: refactor layout loading and persisting out of svnmeta.py
author David Schleimer <dschleimer@fb.com>
date Wed, 17 Apr 2013 16:14:15 -0700
parents
children c3c4518e00aa
line wrap: on
line source

"""Code for persisting the layout config in various locations.

Basically, if you want to save the layout, this is where you should go
to do it.

"""

import os.path

def layout_to_file(meta_data_dir, layout):
    """Save the given layout to a file under the given meta_data_dir"""

    layoutfile = os.path.join(meta_data_dir, 'layout')
    f = open(layoutfile, 'w')
    f.write(layout)
    f.close()