mercurial/util.py
changeset 11251 c61442f6d106
parent 11232 97f6d2a02c1f
child 11256 94b7b3a1ae1b
--- a/mercurial/util.py	Mon May 31 21:43:03 2010 +0200
+++ b/mercurial/util.py	Mon May 31 13:47:51 2010 +0200
@@ -453,12 +453,14 @@
         hardlink = (os.stat(src).st_dev ==
                     os.stat(os.path.dirname(dst)).st_dev)
 
+    num = 0
     if os.path.isdir(src):
         os.mkdir(dst)
         for name, kind in osutil.listdir(src):
             srcname = os.path.join(src, name)
             dstname = os.path.join(dst, name)
-            hardlink = copyfiles(srcname, dstname, hardlink)
+            hardlink, n = copyfiles(srcname, dstname, hardlink)
+            num += n
     else:
         if hardlink:
             try:
@@ -468,8 +470,9 @@
                 shutil.copy(src, dst)
         else:
             shutil.copy(src, dst)
+        num += 1
 
-    return hardlink
+    return hardlink, num
 
 class path_auditor(object):
     '''ensure that a filesystem path contains no banned components.