diff mercurial/hg.py @ 11251:c61442f6d106

clone: print number of linked/copied files on --debug
author Adrian Buehlmann <adrian@cadifra.com>
date Mon, 31 May 2010 13:47:51 +0200
parents 5593ff6d1e5a
children 94b7b3a1ae1b
line wrap: on
line diff
--- a/mercurial/hg.py	Mon May 31 21:43:03 2010 +0200
+++ b/mercurial/hg.py	Mon May 31 13:47:51 2010 +0200
@@ -278,6 +278,7 @@
                 raise
 
             hardlink = None
+            num = 0
             for f in src_repo.store.copylist():
                 src = os.path.join(src_repo.sharedpath, f)
                 dst = os.path.join(dest_path, f)
@@ -288,7 +289,12 @@
                     if dst.endswith('data'):
                         # lock to avoid premature writing to the target
                         dest_lock = lock.lock(os.path.join(dstbase, "lock"))
-                    hardlink = util.copyfiles(src, dst, hardlink)
+                    hardlink, n = util.copyfiles(src, dst, hardlink)
+                    num += n
+            if hardlink:
+                ui.debug("linked %d files\n" % num)
+            else:
+                ui.debug("copied %d files\n" % num)
 
             # we need to re-init the repo after manually copying the data
             # into it