##// END OF EJS Templates
copy: propagate errors properly
Matt Mackall -
r5606:447ea621 default
parent child Browse files
Show More
@@ -292,7 +292,6 b' def copy(ui, repo, pats, opts):'
292 # hgsep => pathname that uses "/" to separate directories
292 # hgsep => pathname that uses "/" to separate directories
293 # ossep => pathname that uses os.sep to separate directories
293 # ossep => pathname that uses os.sep to separate directories
294 cwd = repo.getcwd()
294 cwd = repo.getcwd()
295 errors = 0
296 copied = []
295 copied = []
297 targets = {}
296 targets = {}
298
297
@@ -358,8 +357,7 b' def copy(ui, repo, pats, opts):'
358 else:
357 else:
359 ui.warn(_('%s: cannot copy - %s\n') %
358 ui.warn(_('%s: cannot copy - %s\n') %
360 (relsrc, inst.strerror))
359 (relsrc, inst.strerror))
361 errors += 1
360 return True # report a failure
362 return
363 if ui.verbose or not exact:
361 if ui.verbose or not exact:
364 ui.status(_('copying %s to %s\n') % (relsrc, reltarget))
362 ui.status(_('copying %s to %s\n') % (relsrc, reltarget))
365 targets[abstarget] = abssrc
363 targets[abstarget] = abssrc
@@ -473,9 +471,11 b' def copy(ui, repo, pats, opts):'
473 if not copylist:
471 if not copylist:
474 raise util.Abort(_('no files to copy'))
472 raise util.Abort(_('no files to copy'))
475
473
474 errors = 0
476 for targetpath, srcs in copylist:
475 for targetpath, srcs in copylist:
477 for abssrc, relsrc, exact in srcs:
476 for abssrc, relsrc, exact in srcs:
478 copyfile(abssrc, relsrc, targetpath(abssrc), exact)
477 if copyfile(abssrc, relsrc, targetpath(abssrc), exact):
478 errors += 1
479
479
480 if errors:
480 if errors:
481 ui.warn(_('(consider using --after)\n'))
481 ui.warn(_('(consider using --after)\n'))
General Comments 0
You need to be logged in to leave comments. Login now