On Fri, Dec 14, 2007 at 03:32:40PM -0000, [EMAIL PROTECTED] wrote:

> Author: younes
> Date: Fri Dec 14 16:32:37 2007
> New Revision: 22148
> 
> URL: http://www.lyx.org/trac/changeset/22148
> Log:
> The original support::copy() was overwriting the target file by default. This 
> commit put the code in line with pre-rev 22119 and 22129.

I think that you should remove the second parameter in copyTo() and
always overwrite the copied to file. Otherwise the changed semantic
may lead to other obscure bugs. See also the renameTo() problem.

> 
> Modified:
>     lyx-devel/trunk/src/Mover.cpp
>     lyx-devel/trunk/src/insets/InsetBibtex.cpp
>     lyx-devel/trunk/src/insets/InsetInclude.cpp
> 
> Modified: lyx-devel/trunk/src/Mover.cpp
> URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/Mover.cpp?rev=22148
> ==============================================================================
> --- lyx-devel/trunk/src/Mover.cpp (original)
> +++ lyx-devel/trunk/src/Mover.cpp Fri Dec 14 16:32:37 2007
> @@ -35,7 +35,7 @@
>  bool Mover::do_copy(FileName const & from, FileName const & to,
>                   string const &) const
>  {
> -     return from.copyTo(to);
> +     return from.copyTo(to, true);
>  }
>  
>  
> 
> Modified: lyx-devel/trunk/src/insets/InsetBibtex.cpp
> URL: 
> http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetBibtex.cpp?rev=22148
> ==============================================================================
> --- lyx-devel/trunk/src/insets/InsetBibtex.cpp (original)
> +++ lyx-devel/trunk/src/insets/InsetBibtex.cpp Fri Dec 14 16:32:37 2007
> @@ -179,7 +179,7 @@
>                       FileName const out_file = makeAbsPath(database + ".bib",
>                                       buffer.masterBuffer()->temppath());
>  
> -                     bool const success = in_file.copyTo(out_file);
> +                     bool const success = in_file.copyTo(out_file, true);
>                       if (!success) {
>                               lyxerr << "Failed to copy '" << in_file
>                                      << "' to '" << out_file << "'"
> @@ -238,7 +238,7 @@
>                       base = removeExtension(in_file.mangledFilename());
>                       FileName const out_file(makeAbsPath(base + ".bst",
>                                       buffer.masterBuffer()->temppath()));
> -                     bool const success = in_file.copyTo(out_file);
> +                     bool const success = in_file.copyTo(out_file, true);
>                       if (!success) {
>                               lyxerr << "Failed to copy '" << in_file
>                                      << "' to '" << out_file << "'"
> 
> Modified: lyx-devel/trunk/src/insets/InsetInclude.cpp
> URL: 
> http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetInclude.cpp?rev=22148
> ==============================================================================
> --- lyx-devel/trunk/src/insets/InsetInclude.cpp (original)
> +++ lyx-devel/trunk/src/insets/InsetInclude.cpp Fri Dec 14 16:32:37 2007
> @@ -475,7 +475,7 @@
>               unsigned long const checksum_out = writefile.checksum();
>  
>               if (checksum_in != checksum_out) {
> -                     if (!included_file.copyTo(writefile)) {
> +                     if (!included_file.copyTo(writefile, true)) {
>                               // FIXME UNICODE
>                               LYXERR(Debug::LATEX,
>                                       to_utf8(bformat(_("Could not copy the 
> file\n%1$s\n"
> 
> 
> _______________________________________________
> Cvslog mailing list
> [EMAIL PROTECTED]
> http://www.lyx.org/mailman/listinfo/cvslog
> 

-- 
Enrico

Reply via email to