~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Marius Kruger
  • Date: 2008-10-04 00:01:38 UTC
  • mto: This revision was merged to the branch mainline in revision 3809.
  • Revision ID: amanic@gmail.com-20081004000138-lx9l7czfmncy49g8
Silently fall back to local implicit nick if the master is unavailable

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
    def _get_nick(self, possible_transports=None):
152
152
        config = self.get_config()
153
153
        if not config.has_explicit_nickname(): # explicit overrides master
154
 
            master = self.get_master_branch(possible_transports)
155
 
            if master is not None:
156
 
                # return the master branch value
157
 
                config = master.get_config()
 
154
            try:
 
155
                master = self.get_master_branch(possible_transports)
 
156
                if master is not None:
 
157
                    # return the master branch value
 
158
                    config = master.get_config()
 
159
            except errors.BzrError, e:
 
160
                # Silently fall back to local implicit nick if the master is
 
161
                # unavailable
 
162
                mutter("Could not connect to bound branch, "
 
163
                    "falling back to local nick.\n " + str(e))
158
164
        return config.get_nickname()
159
165
 
160
166
    def _set_nick(self, nick):