[PATCH 3 of 4 STABLE] largefiles: don't convert dest=None to dest=hg.defaultdest() in clone command

Matt Harbison matt_harbison at yahoo.com
Sun Sep 9 18:41:37 CDT 2012


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1347206993 14400
# Branch stable
# Node ID 3c40365f112d4c9621c8031de0aac39e0a98baff
# Parent  e72073a72d11a4874c396af4c03a394fa7d9ce42
largefiles: don't convert dest=None to dest=hg.defaultdest() in clone command

A status message is output if hg.clone() determines the default destination
because None was provided.  The previous code never passed None to hg.clone().

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -715,12 +715,13 @@
     return result
 
 def overrideclone(orig, ui, source, dest=None, **opts):
-    if dest is None:
-        dest = hg.defaultdest(source)
-    if opts.get('all_largefiles') and not hg.islocal(dest):
+    d = dest
+    if d is None:
+        d = hg.defaultdest(source)
+    if opts.get('all_largefiles') and not hg.islocal(d):
             raise util.Abort(_(
             '--all-largefiles is incompatible with non-local destination %s' %
-            dest))
+            d))
     result = hg.clone(ui, opts, source, dest,
                       pull=opts.get('pull'),
                       stream=opts.get('uncompressed'),
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -689,6 +689,16 @@
   commit: (clean)
   update: 8 new changesets (update)
 
+  $ mkdir xyz
+  $ cd xyz
+  $ hg clone ../a
+  destination directory: a
+  updating to branch default
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  getting changed largefiles
+  3 largefiles updated, 0 removed
+  $ cd ..
+
   $ hg clone --all-largefiles a ssh://localhost/a
   abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
   [255]


More information about the Mercurial-devel mailing list