changeset 16723:68da5ae6e470

largefiles: don't attempt to clone all largefiles to non-local destinations
author Levi Bard <levi@unity3d.com>
date Sun, 13 May 2012 22:59:22 +0200
parents 3e6d59ae4dc2
children 3e24ce3de5f1
files hgext/largefiles/overrides.py tests/test-largefiles.t
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Sun May 13 14:04:07 2012 +0200
+++ b/hgext/largefiles/overrides.py	Sun May 13 22:59:22 2012 +0200
@@ -704,6 +704,12 @@
     return result
 
 def overrideclone(orig, ui, source, dest=None, **opts):
+    if dest is None:
+        dest = defaultdest(source)
+    if opts.get('all_largefiles') and not hg.islocal(dest):
+            raise util.Abort(_(
+            '--all-largefiles is incompatible with non-local destination %s' %
+            dest))
     result = hg.clone(ui, opts, source, dest,
                       pull=opts.get('pull'),
                       stream=opts.get('uncompressed'),
--- a/tests/test-largefiles.t	Sun May 13 14:04:07 2012 +0200
+++ b/tests/test-largefiles.t	Sun May 13 22:59:22 2012 +0200
@@ -444,6 +444,10 @@
   3 largefiles updated, 0 removed
   8 additional largefiles cached
 
+  $ hg clone --all-largefiles a ssh://localhost/a
+  abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
+  [255]
+
 Test pulling with --all-largefiles flag
 
   $ rm -Rf a-backup