mercurial/commands.py
changeset 11557 57bdc2239535
parent 11551 4484a7b661f2
child 11615 6dbdf5c5c5bd
--- a/mercurial/commands.py	Wed Jul 14 20:41:01 2010 +0200
+++ b/mercurial/commands.py	Wed Jul 14 20:25:31 2010 +0200
@@ -196,20 +196,7 @@
     if os.path.realpath(dest) == repo.root:
         raise util.Abort(_('repository root cannot be destination'))
 
-    def guess_type():
-        exttypes = {
-            'tar': ['.tar'],
-            'tbz2': ['.tbz2', '.tar.bz2'],
-            'tgz': ['.tgz', '.tar.gz'],
-            'zip': ['.zip'],
-        }
-
-        for type, extensions in exttypes.items():
-            if util.any(dest.endswith(ext) for ext in extensions):
-                return type
-        return None
-
-    kind = opts.get('type') or guess_type() or 'files'
+    kind = opts.get('type') or archival.guesskind(dest) or 'files'
     prefix = opts.get('prefix')
 
     if dest == '-':