Mercurial > hg
comparison hgext/convert/p4.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 | b810b59eca62 |
children | aaa33ec3c951 |
comparison
equal
deleted
inserted
replaced
26586:d51c658d3f04 | 26587:56b2bcea2529 |
---|---|
3 # Copyright 2009, Frank Kingswood <frank@kingswood-consulting.co.uk> | 3 # Copyright 2009, Frank Kingswood <frank@kingswood-consulting.co.uk> |
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 from mercurial import util | 8 from mercurial import util, error |
9 from mercurial.i18n import _ | 9 from mercurial.i18n import _ |
10 | 10 |
11 from common import commit, converter_source, checktool, NoRepo | 11 from common import commit, converter_source, checktool, NoRepo |
12 import marshal | 12 import marshal |
13 import re | 13 import re |
68 r"\$(Id|Header|Date|DateTime|Change|File|Revision|Author)" | 68 r"\$(Id|Header|Date|DateTime|Change|File|Revision|Author)" |
69 r":[^$\n]*\$") | 69 r":[^$\n]*\$") |
70 self.re_keywords_old = re.compile("\$(Id|Header):[^$\n]*\$") | 70 self.re_keywords_old = re.compile("\$(Id|Header):[^$\n]*\$") |
71 | 71 |
72 if revs and len(revs) > 1: | 72 if revs and len(revs) > 1: |
73 raise util.Abort(_("p4 source does not support specifying " | 73 raise error.Abort(_("p4 source does not support specifying " |
74 "multiple revisions")) | 74 "multiple revisions")) |
75 self._parse(ui, path) | 75 self._parse(ui, path) |
76 | 76 |
77 def _parse_view(self, path): | 77 def _parse_view(self, path): |
78 "Read changes affecting the path" | 78 "Read changes affecting the path" |
275 | 275 |
276 return contents, mode | 276 return contents, mode |
277 | 277 |
278 def getchanges(self, rev, full): | 278 def getchanges(self, rev, full): |
279 if full: | 279 if full: |
280 raise util.Abort(_("convert from p4 do not support --full")) | 280 raise error.Abort(_("convert from p4 do not support --full")) |
281 return self.files[rev], self.copies[rev], set() | 281 return self.files[rev], self.copies[rev], set() |
282 | 282 |
283 def getcommit(self, rev): | 283 def getcommit(self, rev): |
284 return self.changeset[rev] | 284 return self.changeset[rev] |
285 | 285 |