diff tests/test-largefiles.t @ 17601:6e2ab601be3f stable

largefiles: delegate to the wrapped clone command This allows the wrapped command's validation code to run (which is currently only to ensure 'noupdate' and 'updaterev' aren't both specified), the copy/pasted unpacking of hg.clone() args to be removed, and any future changes to the base command (however unlikely) to be inherited by largefiles. Unfortunately, the command override can't be swapped entirely for an hg.clone() override because the extra --all-largefiles arg needs to be injected. It also isn't enough to call the wrapped clone command and leave the caching code after it, because the file caching code needs access to the destination repo, which is only available from hg.clone(). An alternative would be to use the dest path in the clone command override to re-obtain a reference to the repo. A slight deviation from the regular hg.clone() function is that the repo is NOT deleted if the caching fails, but that was also the previous behavior. Maybe it should for consistency?
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 09 Sep 2012 12:43:24 -0400
parents 3a1c6b64e052
children ccd28eca37f6 a02c1ffddae9
line wrap: on
line diff
--- a/tests/test-largefiles.t	Sun Sep 09 12:09:53 2012 -0400
+++ b/tests/test-largefiles.t	Sun Sep 09 12:43:24 2012 -0400
@@ -717,6 +717,12 @@
   3 largefiles updated, 0 removed
   $ cd ..
 
+Ensure base clone command argument validation
+
+  $ hg clone -U -u 0 a a-clone-failure
+  abort: cannot specify both --noupdate and --updaterev
+  [255]
+
   $ hg clone --all-largefiles a ssh://localhost/a
   abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
   [255]