Mercurial > hg
comparison hgext/convert/gnuarch.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 | baea47cafe75 |
children | aaa33ec3c951 |
comparison
equal
deleted
inserted
replaced
26586:d51c658d3f04 | 26587:56b2bcea2529 |
---|---|
6 # This software may be used and distributed according to the terms of the | 6 # This software may be used and distributed according to the terms of the |
7 # GNU General Public License version 2 or any later version. | 7 # GNU General Public License version 2 or any later version. |
8 | 8 |
9 from common import NoRepo, commandline, commit, converter_source | 9 from common import NoRepo, commandline, commit, converter_source |
10 from mercurial.i18n import _ | 10 from mercurial.i18n import _ |
11 from mercurial import encoding, util | 11 from mercurial import encoding, util, error |
12 import os, shutil, tempfile, stat | 12 import os, shutil, tempfile, stat |
13 from email.Parser import Parser | 13 from email.Parser import Parser |
14 | 14 |
15 class gnuarch_source(converter_source, commandline): | 15 class gnuarch_source(converter_source, commandline): |
16 | 16 |
40 self.execmd = 'baz' | 40 self.execmd = 'baz' |
41 else: | 41 else: |
42 if util.findexe('tla'): | 42 if util.findexe('tla'): |
43 self.execmd = 'tla' | 43 self.execmd = 'tla' |
44 else: | 44 else: |
45 raise util.Abort(_('cannot find a GNU Arch tool')) | 45 raise error.Abort(_('cannot find a GNU Arch tool')) |
46 | 46 |
47 commandline.__init__(self, ui, self.execmd) | 47 commandline.__init__(self, ui, self.execmd) |
48 | 48 |
49 self.path = os.path.realpath(path) | 49 self.path = os.path.realpath(path) |
50 self.tmppath = None | 50 self.tmppath = None |
133 def getheads(self): | 133 def getheads(self): |
134 return self.parents[None] | 134 return self.parents[None] |
135 | 135 |
136 def getfile(self, name, rev): | 136 def getfile(self, name, rev): |
137 if rev != self.lastrev: | 137 if rev != self.lastrev: |
138 raise util.Abort(_('internal calling inconsistency')) | 138 raise error.Abort(_('internal calling inconsistency')) |
139 | 139 |
140 if not os.path.lexists(os.path.join(self.tmppath, name)): | 140 if not os.path.lexists(os.path.join(self.tmppath, name)): |
141 return None, None | 141 return None, None |
142 | 142 |
143 return self._getfile(name, rev) | 143 return self._getfile(name, rev) |
144 | 144 |
145 def getchanges(self, rev, full): | 145 def getchanges(self, rev, full): |
146 if full: | 146 if full: |
147 raise util.Abort(_("convert from arch do not support --full")) | 147 raise error.Abort(_("convert from arch do not support --full")) |
148 self._update(rev) | 148 self._update(rev) |
149 changes = [] | 149 changes = [] |
150 copies = {} | 150 copies = {} |
151 | 151 |
152 for f in self.changes[rev].add_files: | 152 for f in self.changes[rev].add_files: |
285 # Commit revision origin when dealing with a branch or tag | 285 # Commit revision origin when dealing with a branch or tag |
286 if 'Continuation-of' in catlog: | 286 if 'Continuation-of' in catlog: |
287 self.changes[rev].continuationof = self.recode( | 287 self.changes[rev].continuationof = self.recode( |
288 catlog['Continuation-of']) | 288 catlog['Continuation-of']) |
289 except Exception: | 289 except Exception: |
290 raise util.Abort(_('could not parse cat-log of %s') % rev) | 290 raise error.Abort(_('could not parse cat-log of %s') % rev) |
291 | 291 |
292 def _parsechangeset(self, data, rev): | 292 def _parsechangeset(self, data, rev): |
293 for l in data: | 293 for l in data: |
294 l = l.strip() | 294 l = l.strip() |
295 # Added file (ignore added directory) | 295 # Added file (ignore added directory) |