def defaultcreateopts(ui, createopts=None):
    """Populate the default creation options for a repository.

    A dictionary of explicitly requested creation options can be passed
    in. Missing keys will be populated.
    """
    createopts = dict(createopts or {})
    if b'backend' not in createopts:
        createopts[b'backend'] = ui.config(b'storage', b'new-repo-backend')
    return createopts
