Show More
@@ -1126,14 +1126,13 def copyfiles(src, dst, hardlink=None, p | |||
|
1126 | 1126 | """Copy a directory tree using hardlinks if possible.""" |
|
1127 | 1127 | num = 0 |
|
1128 | 1128 | |
|
1129 | gettopic = lambda: hardlink and _('linking') or _('copying') | |
|
1130 | ||
|
1131 | if os.path.isdir(src): | |
|
1129 | 1132 | if hardlink is None: |
|
1130 | 1133 | hardlink = (os.stat(src).st_dev == |
|
1131 | 1134 | os.stat(os.path.dirname(dst)).st_dev) |
|
1132 | ||
|
1133 | gettopic = lambda: hardlink and _('linking') or _('copying') | |
|
1134 | 1135 | topic = gettopic() |
|
1135 | ||
|
1136 | if os.path.isdir(src): | |
|
1137 | 1136 | os.mkdir(dst) |
|
1138 | 1137 | for name, kind in osutil.listdir(src): |
|
1139 | 1138 | srcname = os.path.join(src, name) |
@@ -1144,6 +1143,11 def copyfiles(src, dst, hardlink=None, p | |||
|
1144 | 1143 | hardlink, n = copyfiles(srcname, dstname, hardlink, progress=nprog) |
|
1145 | 1144 | num += n |
|
1146 | 1145 | else: |
|
1146 | if hardlink is None: | |
|
1147 | hardlink = (os.stat(src).st_dev == | |
|
1148 | os.stat(os.path.dirname(dst)).st_dev) | |
|
1149 | topic = gettopic() | |
|
1150 | ||
|
1147 | 1151 | if hardlink: |
|
1148 | 1152 | try: |
|
1149 | 1153 | oslink(src, dst) |
General Comments 0
You need to be logged in to leave comments.
Login now