a/ForgeHg/forgehg/hg_main.py b/ForgeHg/forgehg/hg_main.py
...
...
52
        ThreadLocalORMSession.flush_all()
52
        ThreadLocalORMSession.flush_all()
53
        cloned_from_project_id = self.config.options.get('cloned_from_project_id')
53
        cloned_from_project_id = self.config.options.get('cloned_from_project_id')
54
        cloned_from_repo_id = self.config.options.get('cloned_from_repo_id')
54
        cloned_from_repo_id = self.config.options.get('cloned_from_repo_id')
55
        init_from_url = self.config.options.get('init_from_url')
55
        init_from_url = self.config.options.get('init_from_url')
56
        if cloned_from_project_id is not None:
56
        if cloned_from_project_id is not None:
57
            with h.push_config(c, project=M.Project.query.get(_id=cloned_from_project_id)):
58
                cloned_from = HM.Repository.query.get(_id=cloned_from_repo_id)
57
            cloned_from = HM.Repository.query.get(_id=cloned_from_repo_id)
59
                allura.tasks.repo_tasks.clone.post(
58
            allura.tasks.repo_tasks.clone.post(
60
                    cloned_from_path=cloned_from.full_fs_path,
59
                cloned_from_path=cloned_from.full_fs_path,
61
                    cloned_from_name=cloned_from.app.config.script_name(),
60
                cloned_from_name=cloned_from.app.config.script_name(),
62
                    cloned_from_url=cloned_from.full_fs_path)
61
                cloned_from_url=cloned_from.full_fs_path)
63
        elif init_from_url:
62
        elif init_from_url:
64
            allura.tasks.repo_tasks.clone.post(
63
            allura.tasks.repo_tasks.clone.post(
65
                cloned_from_path=None,
64
                cloned_from_path=None,
66
                cloned_from_name=None,
65
                cloned_from_name=None,
67
                cloned_from_url=init_from_url)
66
                cloned_from_url=init_from_url)