~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-03 13:48:52 UTC
  • mfrom: (1835 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1836.
  • Revision ID: john@arbash-meinel.com-20060703134852-295eeb195b8e2811
[merge] bzr.dev 1835

Show diffs side-by-side

added added

removed removed

Lines of Context:
345
345
        name_generator = locations_config_filename
346
346
        if (not os.path.exists(name_generator()) and 
347
347
                os.path.exists(branches_config_filename())):
348
 
            warning('Please rename branches.conf to locations.conf')
 
348
            if sys.platform == 'win32':
 
349
                warning('Please rename %s to %s' 
 
350
                         % (branches_config_filename(),
 
351
                            locations_config_filename()))
 
352
            else:
 
353
                warning('Please rename ~/.bazaar/branches.conf'
 
354
                        ' to ~/.bazaar/locations.conf')
349
355
            name_generator = branches_config_filename
350
356
        super(LocationConfig, self).__init__(name_generator)
351
357
        self.location = location
512
518
        return self._get_safe_value('_post_commit')
513
519
 
514
520
    def _get_nickname(self):
515
 
        value = self._get_best_value('_get_nickname')
 
521
        value = self._get_explicit_nickname()
516
522
        if value is not None:
517
523
            return value
518
524
        return self.branch.base.split('/')[-2]
519
525
 
 
526
    def has_explicit_nickname(self):
 
527
        """Return true if a nickname has been explicitly assigned."""
 
528
        return self._get_explicit_nickname() is not None
 
529
 
 
530
    def _get_explicit_nickname(self):
 
531
        return self._get_best_value('_get_nickname')
 
532
 
520
533
    def _log_format(self):
521
534
        """See Config.log_format."""
522
535
        return self._get_best_value('_log_format')
572
585
    """Return per-user configuration ini file filename."""
573
586
    return pathjoin(config_dir(), 'branches.conf')
574
587
 
 
588
 
575
589
def locations_config_filename():
576
590
    """Return per-user configuration ini file filename."""
577
591
    return pathjoin(config_dir(), 'locations.conf')