~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Vincent Ladeuil
  • Date: 2010-09-16 16:43:05 UTC
  • mto: (5502.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 5504.
  • Revision ID: v.ladeuil+lp@free.fr-20100916164305-vartuzc0yalkw4fn
Ensures we fallback to the default policy if a bogus one is specified.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1343
1343
        # but that's all we have (for now). It will find the option in
1344
1344
        # locations,conf or bazaar.conf though) -- vila 20100916
1345
1345
        conf = self._tree.branch.get_config()
1346
 
        orphan_policy = conf.get_user_option('bzrlib.transform.orphan_policy')
 
1346
        conf_var_name = 'bzrlib.transform.orphan_policy'
 
1347
        orphan_policy = conf.get_user_option(conf_var_name)
 
1348
        default_policy = orphaning_registry.default_key
1347
1349
        if orphan_policy is None:
1348
 
            orphan_policy = orphaning_registry.default_key
 
1350
            orphan_policy = default_policy
 
1351
        if orphan_policy not in orphaning_registry:
 
1352
            trace.warning('%s (from %s) is not a known policy, defaulting to %s'
 
1353
                          % (orphan_policy, conf_var_name, default_policy))
 
1354
            orphan_policy = default_policy
1349
1355
        handle_orphan = orphaning_registry.get(orphan_policy)
1350
1356
        handle_orphan(self, trans_id, parent_id)
1351
1357