Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 26587:56b2bcea2529
error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.
For great justice.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 08 Oct 2015 12:55:45 -0700 |
parents | 3a0bb61371c5 |
children | a3fcc8e3136b |
comparison
equal
deleted
inserted
replaced
26586:d51c658d3f04 | 26587:56b2bcea2529 |
---|---|
1058 try: | 1058 try: |
1059 return self._filelog.read(self._filenode) | 1059 return self._filelog.read(self._filenode) |
1060 except error.CensoredNodeError: | 1060 except error.CensoredNodeError: |
1061 if self._repo.ui.config("censor", "policy", "abort") == "ignore": | 1061 if self._repo.ui.config("censor", "policy", "abort") == "ignore": |
1062 return "" | 1062 return "" |
1063 raise util.Abort(_("censored node: %s") % short(self._filenode), | 1063 raise error.Abort(_("censored node: %s") % short(self._filenode), |
1064 hint=_("set censor.policy to ignore errors")) | 1064 hint=_("set censor.policy to ignore errors")) |
1065 | 1065 |
1066 def size(self): | 1066 def size(self): |
1067 return self._filelog.size(self._filerev) | 1067 return self._filelog.size(self._filerev) |
1068 | 1068 |
1118 self._extra = extra.copy() | 1118 self._extra = extra.copy() |
1119 if 'branch' not in self._extra: | 1119 if 'branch' not in self._extra: |
1120 try: | 1120 try: |
1121 branch = encoding.fromlocal(self._repo.dirstate.branch()) | 1121 branch = encoding.fromlocal(self._repo.dirstate.branch()) |
1122 except UnicodeDecodeError: | 1122 except UnicodeDecodeError: |
1123 raise util.Abort(_('branch name not in UTF-8!')) | 1123 raise error.Abort(_('branch name not in UTF-8!')) |
1124 self._extra['branch'] = branch | 1124 self._extra['branch'] = branch |
1125 if self._extra['branch'] == '': | 1125 if self._extra['branch'] == '': |
1126 self._extra['branch'] = 'default' | 1126 self._extra['branch'] = 'default' |
1127 | 1127 |
1128 def __str__(self): | 1128 def __str__(self): |