~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2086
2086
        self.path = path
2087
2087
 
2088
2088
 
 
2089
class RepositoryUpgradeRequired(UpgradeRequired):
 
2090
 
 
2091
    _fmt = "To use this feature you must upgrade your repository at %(path)s."
 
2092
 
 
2093
 
2089
2094
class LocalRequiresBoundBranch(BzrError):
2090
2095
 
2091
2096
    _fmt = "Cannot perform local-only commits on unbound branches."
2558
2563
        BzrError.__init__(self, bzrdir=bzrdir, display_url=display_url)
2559
2564
 
2560
2565
 
 
2566
class UnsyncedBranches(BzrDirError):
 
2567
 
 
2568
    _fmt = ("'%(display_url)s' is not in sync with %(target_url)s.  See"
 
2569
            " bzr help sync-for-reconfigure.")
 
2570
 
 
2571
    def __init__(self, bzrdir, target_branch):
 
2572
        BzrDirError.__init__(self, bzrdir)
 
2573
        import bzrlib.urlutils as urlutils
 
2574
        self.target_url = urlutils.unescape_for_display(target_branch.base,
 
2575
                                                        'ascii')
 
2576
 
 
2577
 
2561
2578
class AlreadyBranch(BzrDirError):
2562
2579
 
2563
2580
    _fmt = "'%(display_url)s' is already a branch."
2578
2595
    _fmt = "'%(display_url)s' is already a lightweight checkout."
2579
2596
 
2580
2597
 
 
2598
class AlreadyUsingShared(BzrDirError):
 
2599
 
 
2600
    _fmt = "'%(display_url)s' is already using a shared repository."
 
2601
 
 
2602
 
 
2603
class AlreadyStandalone(BzrDirError):
 
2604
 
 
2605
    _fmt = "'%(display_url)s' is already standalone."
 
2606
 
 
2607
 
2581
2608
class ReconfigurationNotSupported(BzrDirError):
2582
2609
 
2583
2610
    _fmt = "Requested reconfiguration of '%(display_url)s' is not supported."
2636
2663
        self.timezone = timezone
2637
2664
 
2638
2665
 
 
2666
class CommandAvailableInPlugin(StandardError):
 
2667
    
 
2668
    internal_error = False
 
2669
 
 
2670
    def __init__(self, cmd_name, plugin_metadata, provider):
 
2671
        
 
2672
        self.plugin_metadata = plugin_metadata
 
2673
        self.cmd_name = cmd_name
 
2674
        self.provider = provider
 
2675
 
 
2676
    def __str__(self):
 
2677
 
 
2678
        _fmt = ('"%s" is not a standard bzr command. \n' 
 
2679
                'However, the following official plugin provides this command: %s\n'
 
2680
                'You can install it by going to: %s'
 
2681
                % (self.cmd_name, self.plugin_metadata['name'], 
 
2682
                    self.plugin_metadata['url']))
 
2683
 
 
2684
        return _fmt
 
2685
 
 
2686
 
 
2687
class NoPluginAvailable(BzrError):
 
2688
    pass    
 
2689
 
 
2690
 
2639
2691
class NotATerminal(BzrError):
2640
2692
 
2641
2693
    _fmt = 'Unable to ask for a password without real terminal.'