patch for hard link options

Troy Benjegerdes hozer at hozed.org
Tue Sep 20 12:21:34 CDT 2005


--- commands.py.orig    2005-09-20 12:08:29.000000000 -0500
+++ commands.py 2005-09-20 12:15:50.000000000 -0500
@@ -505,6 +505,8 @@
         abspath = os.path.abspath(source)
         copyfile = (os.stat(dest).st_dev == other.dev()
                     and getattr(os, 'link', None) or shutil.copy2)
+        if opts['nohardlink']:
+               copyfile = shutil.copy2
         if copyfile is not shutil.copy2:
             ui.note("cloning by hardlink\n")
         # we use a lock here because because we're not nicely ordered
@@ -1290,7 +1292,8 @@
         (clone,
          [('U', 'noupdate', None, 'skip update after cloning'),
           ('e', 'ssh', "", 'ssh command'),
-          ('', 'remotecmd', "", 'remote hg command')],
+          ('', 'remotecmd', "", 'remote hg command'),
+          ('c', 'nohardlink', None, "Don't clone via hard links")],
          'hg clone [OPTIONS] SOURCE [DEST]'),
     "^commit|ci":
         (commit,



More information about the Mercurial mailing list