mercurial/error.py
author Siddharth Agarwal <sid0@fb.com>
Wed, 18 Feb 2015 16:45:16 -0800
changeset 24137 dcfdfd63bde4
parent 24120 a450e0a2ba0a
child 24190 903c7e8c97ad
permissions -rw-r--r--
error.LookupError: rename 'message' property to something else At least some installs of Python 2.6+ complain with: mercurial/error.py:26: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 This patch renames the property away from 'message' so that Python no longer complains.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8226
8b2cd04a6e97 put license and copyright info into comment blocks
Martin Geisler <mg@lazybytes.net>
parents: 8225
diff changeset
     1
# error.py - Mercurial exceptions
8b2cd04a6e97 put license and copyright info into comment blocks
Martin Geisler <mg@lazybytes.net>
parents: 8225
diff changeset
     2
#
8b2cd04a6e97 put license and copyright info into comment blocks
Martin Geisler <mg@lazybytes.net>
parents: 8225
diff changeset
     3
# Copyright 2005-2008 Matt Mackall <mpm@selenic.com>
8b2cd04a6e97 put license and copyright info into comment blocks
Martin Geisler <mg@lazybytes.net>
parents: 8225
diff changeset
     4
#
8b2cd04a6e97 put license and copyright info into comment blocks
Martin Geisler <mg@lazybytes.net>
parents: 8225
diff changeset
     5
# This software may be used and distributed according to the terms of the
10263
25e572394f5c Update license to GPLv2+
Matt Mackall <mpm@selenic.com>
parents: 9423
diff changeset
     6
# GNU General Public License version 2 or any later version.
7633
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
     7
8227
0a9542703300 turn some comments back into module docstrings
Martin Geisler <mg@lazybytes.net>
parents: 8226
diff changeset
     8
"""Mercurial exceptions.
0a9542703300 turn some comments back into module docstrings
Martin Geisler <mg@lazybytes.net>
parents: 8226
diff changeset
     9
0a9542703300 turn some comments back into module docstrings
Martin Geisler <mg@lazybytes.net>
parents: 8226
diff changeset
    10
This allows us to catch exceptions at higher levels without forcing
0a9542703300 turn some comments back into module docstrings
Martin Geisler <mg@lazybytes.net>
parents: 8226
diff changeset
    11
imports.
0a9542703300 turn some comments back into module docstrings
Martin Geisler <mg@lazybytes.net>
parents: 8226
diff changeset
    12
"""
0a9542703300 turn some comments back into module docstrings
Martin Geisler <mg@lazybytes.net>
parents: 8226
diff changeset
    13
7633
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    14
# Do not import anything here, please
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    15
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    16
class RevlogError(Exception):
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    17
    pass
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    18
23014
f00813325c5a repoview: add a FilteredIndexError class
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23010
diff changeset
    19
class FilteredIndexError(IndexError):
f00813325c5a repoview: add a FilteredIndexError class
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23010
diff changeset
    20
    pass
f00813325c5a repoview: add a FilteredIndexError class
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23010
diff changeset
    21
7633
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    22
class LookupError(RevlogError, KeyError):
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    23
    def __init__(self, name, index, message):
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    24
        self.name = name
24038
10d02cd18604 error: store filename and message on LookupError for later
Martin von Zweigbergk <martinvonz@google.com>
parents: 23415
diff changeset
    25
        self.index = index
24137
dcfdfd63bde4 error.LookupError: rename 'message' property to something else
Siddharth Agarwal <sid0@fb.com>
parents: 24120
diff changeset
    26
        # this can't be called 'message' because at least some installs of
dcfdfd63bde4 error.LookupError: rename 'message' property to something else
Siddharth Agarwal <sid0@fb.com>
parents: 24120
diff changeset
    27
        # Python 2.6+ complain about the 'message' property being deprecated
dcfdfd63bde4 error.LookupError: rename 'message' property to something else
Siddharth Agarwal <sid0@fb.com>
parents: 24120
diff changeset
    28
        self.lookupmessage = message
7633
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    29
        if isinstance(name, str) and len(name) == 20:
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    30
            from node import short
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    31
            name = short(name)
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    32
        RevlogError.__init__(self, '%s@%s: %s' % (index, name, message))
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    33
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    34
    def __str__(self):
08cabecfa8a8 errors: move revlog errors
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
    35
        return RevlogError.__str__(self)
7636
e3f8c6d6b72e error: move ParseError
Matt Mackall <mpm@selenic.com>
parents: 7633
diff changeset
    36
23015
21c44c1aed87 repoview: add a FilteredLookupError class
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23014
diff changeset
    37
class FilteredLookupError(LookupError):
21c44c1aed87 repoview: add a FilteredLookupError class
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23014
diff changeset
    38
    pass
21c44c1aed87 repoview: add a FilteredLookupError class
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23014
diff changeset
    39
18855
50c922c1b514 hgweb: show correct error message for i18n environment
Takumi IINO <trot.thunder@gmail.com>
parents: 15017
diff changeset
    40
class ManifestLookupError(LookupError):
50c922c1b514 hgweb: show correct error message for i18n environment
Takumi IINO <trot.thunder@gmail.com>
parents: 15017
diff changeset
    41
    pass
50c922c1b514 hgweb: show correct error message for i18n environment
Takumi IINO <trot.thunder@gmail.com>
parents: 15017
diff changeset
    42
11287
b901bb751999 error: change ParseError to CommandError
Matt Mackall <mpm@selenic.com>
parents: 10263
diff changeset
    43
class CommandError(Exception):
7636
e3f8c6d6b72e error: move ParseError
Matt Mackall <mpm@selenic.com>
parents: 7633
diff changeset
    44
    """Exception raised on errors in parsing the command line."""
7637
1d54e2f6c0b7 error: move repo errors
Matt Mackall <mpm@selenic.com>
parents: 7636
diff changeset
    45
18931
3c224e0949de error: introduce new InterventionRequired exception
Augie Fackler <raf@durin42.com>
parents: 18855
diff changeset
    46
class InterventionRequired(Exception):
3c224e0949de error: introduce new InterventionRequired exception
Augie Fackler <raf@durin42.com>
parents: 18855
diff changeset
    47
    """Exception raised when a command requires human intervention."""
3c224e0949de error: introduce new InterventionRequired exception
Augie Fackler <raf@durin42.com>
parents: 18855
diff changeset
    48
11288
2123aad24d56 error: add new ParseError for various parsing errors
Matt Mackall <mpm@selenic.com>
parents: 11287
diff changeset
    49
class Abort(Exception):
2123aad24d56 error: add new ParseError for various parsing errors
Matt Mackall <mpm@selenic.com>
parents: 11287
diff changeset
    50
    """Raised if a command needs to print an error and exit."""
11574
6381fa7bfa53 Abort: add a hint argument, printed in the next line inside parenthesis
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 11292
diff changeset
    51
    def __init__(self, *args, **kw):
6381fa7bfa53 Abort: add a hint argument, printed in the next line inside parenthesis
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 11292
diff changeset
    52
        Exception.__init__(self, *args)
6381fa7bfa53 Abort: add a hint argument, printed in the next line inside parenthesis
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 11292
diff changeset
    53
        self.hint = kw.get('hint')
11288
2123aad24d56 error: add new ParseError for various parsing errors
Matt Mackall <mpm@selenic.com>
parents: 11287
diff changeset
    54
23415
cdbb85489c41 hook: raise a more specialized HookAbort exception when a hook fails
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23016
diff changeset
    55
class HookAbort(Abort):
cdbb85489c41 hook: raise a more specialized HookAbort exception when a hook fails
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23016
diff changeset
    56
    """raised when a validation hook fails, aborting an operation
cdbb85489c41 hook: raise a more specialized HookAbort exception when a hook fails
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23016
diff changeset
    57
cdbb85489c41 hook: raise a more specialized HookAbort exception when a hook fails
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23016
diff changeset
    58
    Exists to allow more specialized catching."""
cdbb85489c41 hook: raise a more specialized HookAbort exception when a hook fails
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23016
diff changeset
    59
    pass
cdbb85489c41 hook: raise a more specialized HookAbort exception when a hook fails
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23016
diff changeset
    60
11288
2123aad24d56 error: add new ParseError for various parsing errors
Matt Mackall <mpm@selenic.com>
parents: 11287
diff changeset
    61
class ConfigError(Abort):
22359
e3714b927af5 error: use docstrings, not bare strings, for error classes
Mike Edgar <adgar@google.com>
parents: 21747
diff changeset
    62
    """Exception raised when parsing config files"""
8144
fca54469480e ui: introduce new config parser
Matt Mackall <mpm@selenic.com>
parents: 7947
diff changeset
    63
15017
f4522df38c65 wireproto: add out-of-band error class to allow remote repo to report errors
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14761
diff changeset
    64
class OutOfBandError(Exception):
22359
e3714b927af5 error: use docstrings, not bare strings, for error classes
Mike Edgar <adgar@google.com>
parents: 21747
diff changeset
    65
    """Exception raised when a remote repo reports failure"""
15017
f4522df38c65 wireproto: add out-of-band error class to allow remote repo to report errors
Andrew Pritchard <andrewp@fogcreek.com>
parents: 14761
diff changeset
    66
11292
037d910734de error: fix up test-hgrc
Matt Mackall <mpm@selenic.com>
parents: 11288
diff changeset
    67
class ParseError(Exception):
24040
7f375d2de945 error: update docstring on ParseError
Augie Fackler <augie@google.com>
parents: 24038
diff changeset
    68
    """Raised when parsing config files and {rev,file}sets (msg[, pos])"""
11288
2123aad24d56 error: add new ParseError for various parsing errors
Matt Mackall <mpm@selenic.com>
parents: 11287
diff changeset
    69
7637
1d54e2f6c0b7 error: move repo errors
Matt Mackall <mpm@selenic.com>
parents: 7636
diff changeset
    70
class RepoError(Exception):
14761
1a9256cdf10f error: Add a hint argument to RepoError
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 13447
diff changeset
    71
    def __init__(self, *args, **kw):
1a9256cdf10f error: Add a hint argument to RepoError
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 13447
diff changeset
    72
        Exception.__init__(self, *args)
1a9256cdf10f error: Add a hint argument to RepoError
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 13447
diff changeset
    73
        self.hint = kw.get('hint')
7637
1d54e2f6c0b7 error: move repo errors
Matt Mackall <mpm@selenic.com>
parents: 7636
diff changeset
    74
9423
1444a42f6052 Make distinct lookup error for localrepo.lookup
Matt Mackall <mpm@selenic.com>
parents: 8227
diff changeset
    75
class RepoLookupError(RepoError):
1444a42f6052 Make distinct lookup error for localrepo.lookup
Matt Mackall <mpm@selenic.com>
parents: 8227
diff changeset
    76
    pass
1444a42f6052 Make distinct lookup error for localrepo.lookup
Matt Mackall <mpm@selenic.com>
parents: 8227
diff changeset
    77
23016
2bd51e61c65e repoview: add a FilteredRepoLookupError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23015
diff changeset
    78
class FilteredRepoLookupError(RepoLookupError):
2bd51e61c65e repoview: add a FilteredRepoLookupError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23015
diff changeset
    79
    pass
2bd51e61c65e repoview: add a FilteredRepoLookupError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 23015
diff changeset
    80
7637
1d54e2f6c0b7 error: move repo errors
Matt Mackall <mpm@selenic.com>
parents: 7636
diff changeset
    81
class CapabilityError(RepoError):
1d54e2f6c0b7 error: move repo errors
Matt Mackall <mpm@selenic.com>
parents: 7636
diff changeset
    82
    pass
7640
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    83
13447
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 11574
diff changeset
    84
class RequirementError(RepoError):
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 11574
diff changeset
    85
    """Exception raised if .hg/requires has an unknown entry."""
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 11574
diff changeset
    86
    pass
931a72e00efa introduce new RequirementError (issue2649)
Adrian Buehlmann <adrian@cadifra.com>
parents: 11574
diff changeset
    87
7640
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    88
class LockError(IOError):
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    89
    def __init__(self, errno, strerror, filename, desc):
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    90
        IOError.__init__(self, errno, strerror, filename)
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    91
        self.desc = desc
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    92
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    93
class LockHeld(LockError):
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    94
    def __init__(self, errno, filename, desc, locker):
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    95
        LockError.__init__(self, errno, 'Lock held', filename, desc)
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    96
        self.locker = locker
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    97
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    98
class LockUnavailable(LockError):
7197812e8d44 error: move lock errors
Matt Mackall <mpm@selenic.com>
parents: 7637
diff changeset
    99
    pass
7641
d2f753830f80 error: move UnexpectedOutput (now ResponseError)
Matt Mackall <mpm@selenic.com>
parents: 7640
diff changeset
   100
d2f753830f80 error: move UnexpectedOutput (now ResponseError)
Matt Mackall <mpm@selenic.com>
parents: 7640
diff changeset
   101
class ResponseError(Exception):
d2f753830f80 error: move UnexpectedOutput (now ResponseError)
Matt Mackall <mpm@selenic.com>
parents: 7640
diff changeset
   102
    """Raised to print an error with part of output and exit."""
d2f753830f80 error: move UnexpectedOutput (now ResponseError)
Matt Mackall <mpm@selenic.com>
parents: 7640
diff changeset
   103
7643
9a1ea6587557 error: move UnknownCommand and AmbiguousCommand
Matt Mackall <mpm@selenic.com>
parents: 7641
diff changeset
   104
class UnknownCommand(Exception):
9a1ea6587557 error: move UnknownCommand and AmbiguousCommand
Matt Mackall <mpm@selenic.com>
parents: 7641
diff changeset
   105
    """Exception raised if command is not in the command table."""
9a1ea6587557 error: move UnknownCommand and AmbiguousCommand
Matt Mackall <mpm@selenic.com>
parents: 7641
diff changeset
   106
9a1ea6587557 error: move UnknownCommand and AmbiguousCommand
Matt Mackall <mpm@selenic.com>
parents: 7641
diff changeset
   107
class AmbiguousCommand(Exception):
9a1ea6587557 error: move UnknownCommand and AmbiguousCommand
Matt Mackall <mpm@selenic.com>
parents: 7641
diff changeset
   108
    """Exception raised if command shortcut matches more than one command."""
9a1ea6587557 error: move UnknownCommand and AmbiguousCommand
Matt Mackall <mpm@selenic.com>
parents: 7641
diff changeset
   109
7644
182b7114d35a error: move SignalInterrupt
Matt Mackall <mpm@selenic.com>
parents: 7643
diff changeset
   110
# derived from KeyboardInterrupt to simplify some breakout code
182b7114d35a error: move SignalInterrupt
Matt Mackall <mpm@selenic.com>
parents: 7643
diff changeset
   111
class SignalInterrupt(KeyboardInterrupt):
182b7114d35a error: move SignalInterrupt
Matt Mackall <mpm@selenic.com>
parents: 7643
diff changeset
   112
    """Exception raised on SIGTERM and SIGHUP."""
7646
e62a456b8dc5 error: move SignatureError
Matt Mackall <mpm@selenic.com>
parents: 7644
diff changeset
   113
e62a456b8dc5 error: move SignatureError
Matt Mackall <mpm@selenic.com>
parents: 7644
diff changeset
   114
class SignatureError(Exception):
e62a456b8dc5 error: move SignatureError
Matt Mackall <mpm@selenic.com>
parents: 7644
diff changeset
   115
    pass
21184
28d76afa1568 bundle2: fix raising errors during heads checking
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18931
diff changeset
   116
28d76afa1568 bundle2: fix raising errors during heads checking
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18931
diff changeset
   117
class PushRaced(RuntimeError):
28d76afa1568 bundle2: fix raising errors during heads checking
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18931
diff changeset
   118
    """An exception raised during unbundling that indicate a push race"""
28d76afa1568 bundle2: fix raising errors during heads checking
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 18931
diff changeset
   119
21618
7568f5c1c801 bundle2: move exception classes into the error module
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21184
diff changeset
   120
# bundle2 related errors
7568f5c1c801 bundle2: move exception classes into the error module
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21184
diff changeset
   121
class BundleValueError(ValueError):
21621
b6eb56a9335d bundle2: introduce a ``params`` attribute to BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21620
diff changeset
   122
    """error raised when bundle2 cannot be processed"""
21620
6eaa71b2a3cc bundle2: introduce a parttype attribute to BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21618
diff changeset
   123
23010
73f394f4affc bundle2: add an UnsupportedPartError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22595
diff changeset
   124
class UnsupportedPartError(BundleValueError):
21627
3e8bcc90f07c bundle2: support None parttype in BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21621
diff changeset
   125
    def __init__(self, parttype=None, params=()):
21620
6eaa71b2a3cc bundle2: introduce a parttype attribute to BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21618
diff changeset
   126
        self.parttype = parttype
21621
b6eb56a9335d bundle2: introduce a ``params`` attribute to BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21620
diff changeset
   127
        self.params = params
21627
3e8bcc90f07c bundle2: support None parttype in BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21621
diff changeset
   128
        if self.parttype is None:
3e8bcc90f07c bundle2: support None parttype in BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21621
diff changeset
   129
            msg = 'Stream Parameter'
3e8bcc90f07c bundle2: support None parttype in BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21621
diff changeset
   130
        else:
3e8bcc90f07c bundle2: support None parttype in BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21621
diff changeset
   131
            msg = parttype
21621
b6eb56a9335d bundle2: introduce a ``params`` attribute to BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21620
diff changeset
   132
        if self.params:
b6eb56a9335d bundle2: introduce a ``params`` attribute to BundleValueError
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21620
diff changeset
   133
            msg = '%s - %s' % (msg, ', '.join(self.params))
21747
fecead61d222 error: restore python 2.4 compatibility for BundleValueError
Brendan Cully <brendan@kublai.com>
parents: 21627
diff changeset
   134
        ValueError.__init__(self, msg)
21618
7568f5c1c801 bundle2: move exception classes into the error module
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21184
diff changeset
   135
7568f5c1c801 bundle2: move exception classes into the error module
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21184
diff changeset
   136
class ReadOnlyPartError(RuntimeError):
7568f5c1c801 bundle2: move exception classes into the error module
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21184
diff changeset
   137
    """error raised when code tries to alter a part being generated"""
7568f5c1c801 bundle2: move exception classes into the error module
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21184
diff changeset
   138
    pass
7568f5c1c801 bundle2: move exception classes into the error module
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21184
diff changeset
   139
22595
244478687edd error: add CensoredNodeError, will be thrown when content deliberately erased
Mike Edgar <adgar@google.com>
parents: 22359
diff changeset
   140
class CensoredNodeError(RevlogError):
244478687edd error: add CensoredNodeError, will be thrown when content deliberately erased
Mike Edgar <adgar@google.com>
parents: 22359
diff changeset
   141
    """error raised when content verification fails on a censored node"""
244478687edd error: add CensoredNodeError, will be thrown when content deliberately erased
Mike Edgar <adgar@google.com>
parents: 22359
diff changeset
   142
244478687edd error: add CensoredNodeError, will be thrown when content deliberately erased
Mike Edgar <adgar@google.com>
parents: 22359
diff changeset
   143
    def __init__(self, filename, node):
244478687edd error: add CensoredNodeError, will be thrown when content deliberately erased
Mike Edgar <adgar@google.com>
parents: 22359
diff changeset
   144
        from node import short
244478687edd error: add CensoredNodeError, will be thrown when content deliberately erased
Mike Edgar <adgar@google.com>
parents: 22359
diff changeset
   145
        RevlogError.__init__(self, '%s:%s' % (filename, short(node)))
24120
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   146
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   147
class CensoredBaseError(RevlogError):
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   148
    """error raised when a delta is rejected because its base is censored
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   149
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   150
    A delta based on a censored revision must be formed as single patch
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   151
    operation which replaces the entire base with new content. This ensures
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   152
    the delta may be applied by clones which have not censored the base.
a450e0a2ba0a revlog: in addgroup, reject ill-formed deltas based on censored nodes
Mike Edgar <adgar@google.com>
parents: 24040
diff changeset
   153
    """