~tarmac-control-tower/tarmac/main

« back to all changes in this revision

Viewing changes to tarmac/branch.py

  • Committer: Tarmac Traffic Controller
  • Author(s): Rodney Dawes
  • Date: 2016-01-08 20:17:45 UTC
  • mfrom: (432.1.3 not-bzr-ident)
  • Revision ID: tarmac_traffic_controller-20160108201745-fohl840u4lv7hi0g
Fall back to unique_name for branch config if bzr_identity non-existent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright 2009 Paul Hummer
2
 
# Copyright 2009-2013 Canonical Ltd.
 
2
# Copyright 2009-2013,2015 Canonical Ltd.
3
3
#
4
4
# Tarmac is free software: you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License version 3 as
38
38
        self.lp_branch = lp_branch
39
39
        self.bzr_branch = bzr_branch.Branch.open(self.lp_branch.bzr_identity)
40
40
        if config:
41
 
            self.config = BranchConfig(lp_branch.bzr_identity, config)
 
41
            if lp_branch.bzr_identity in config.branches:
 
42
                self.config = BranchConfig(lp_branch.bzr_identity, config)
 
43
            else:
 
44
                self.config = BranchConfig('lp:' + lp_branch.unique_name,
 
45
                                           config)
42
46
        else:
43
47
            self.config = None
44
48