* don't fail if two files are the same
This commit is contained in:
+4
-2
@@ -106,8 +106,10 @@ class File:
|
|||||||
ctx.ui.info(_("Fetching %s") % uri.get_uri())
|
ctx.ui.info(_("Fetching %s") % uri.get_uri())
|
||||||
fetch_url(uri, transfer_dir)
|
fetch_url(uri, transfer_dir)
|
||||||
else:
|
else:
|
||||||
ctx.ui.info(_("Copying %s to transfer dir") % uri.get_uri())
|
# copy to transfer dir, it's okay if transfer_dir is the same
|
||||||
shutil.copy(uri.get_uri(), transfer_dir)
|
if not os.path.samefile(uri.get_uri(), join(transfer_dir, uri.filename())):
|
||||||
|
ctx.ui.info(_("Copying %s to transfer dir") % uri.get_uri())
|
||||||
|
shutil.copy(uri.get_uri(), transfer_dir)
|
||||||
else:
|
else:
|
||||||
localfile = uri.get_uri() #TODO: use a special function here?
|
localfile = uri.get_uri() #TODO: use a special function here?
|
||||||
if not os.path.exists(localfile):
|
if not os.path.exists(localfile):
|
||||||
|
|||||||
Reference in New Issue
Block a user