diff mercurial/archival.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 1a781a986611
children d3f1b7ee5e70
line wrap: on
line diff
--- a/mercurial/archival.py	Mon Oct 05 22:49:24 2015 -0700
+++ b/mercurial/archival.py	Thu Oct 08 12:55:45 2015 -0700
@@ -55,7 +55,7 @@
     if prefix.startswith('./'):
         prefix = prefix[2:]
     if prefix.startswith('../') or os.path.isabs(lpfx) or '/../' in prefix:
-        raise util.Abort(_('archive prefix contains illegal components'))
+        raise error.Abort(_('archive prefix contains illegal components'))
     return prefix
 
 exts = {
@@ -292,7 +292,7 @@
 
     if kind == 'files':
         if prefix:
-            raise util.Abort(_('cannot give prefix when archiving to files'))
+            raise error.Abort(_('cannot give prefix when archiving to files'))
     else:
         prefix = tidyprefix(dest, kind, prefix)
 
@@ -303,7 +303,7 @@
         archiver.addfile(prefix + name, mode, islink, data)
 
     if kind not in archivers:
-        raise util.Abort(_("unknown archive type '%s'") % kind)
+        raise error.Abort(_("unknown archive type '%s'") % kind)
 
     ctx = repo[node]
     archiver = archivers[kind](dest, mtime or ctx.date()[0])