Board index » cppbuilder » Be Careful Copying Projects

Be Careful Copying Projects

Once in a while, for sanity, I just make a complete copy
of an entire development directory.  [Yes, I realize this
is *not* the recommended method of version control!]

So, let's say I have a project in directory "New".  I
drag the entire "New" directory to copy itself at the
same level.  I then have 2 directories, "New" and
"Copy of New", both of which contain identical copies
of .cpp files, .h files, and all other files in the
project, and each can be built independently.

However, if I bring up BCB3, and load the project file
from "Copy of New", the code editor shows that I am
editing "..\New\Project1.cpp", rather than the
Project1.cpp that is in "Copy of New".

Is this normal behavior?  I did not create "links" to
the files, but actually physically copied each file.
Apparently, the project knows about the pathname to
each file, not just the "leaf" name, and I assume that
by copying the entire project, it still "thinks" that
the files are located in "New".  Sure, it makes sense.

Again, I am to blame for using this scheme for backup
copies and to keep old versions around, but it can be
very dangerous.  I could innocently go back and start
hacking up what appears to be an older version (because
I loaded the project from the older version), while
in reality I would be editing my current files!

One sad workaround seems to be to physically do a
"Remove from Project" for each file, then do an "Add
to Project" for each file in the archived directory.

 

Re:Be Careful Copying Projects


Quote
Jim Kopet wrote in message <76tva4$b3...@forums.borland.com>...
>Once in a while, for sanity, I just make a complete copy
>of an entire development directory.  [Yes, I realize this
>is *not* the recommended method of version control!]

>So, let's say I have a project in directory "New".  I
>drag the entire "New" directory to copy itself at the
>same level.  I then have 2 directories, "New" and
>"Copy of New", both of which contain identical copies
>of .cpp files, .h files, and all other files in the
>project, and each can be built independently.

>However, if I bring up BCB3, and load the project file
>from "Copy of New", the code editor shows that I am
>editing "..\New\Project1.cpp", rather than the
>Project1.cpp that is in "Copy of New".

Are you sure that it is the project, and not the code editor, that is
keeping track of the full path name?  Try closing the entire code editor and
reopening it.
--
Phil Colbert
Technology Manager
Integrated Actuarial Services, Inc.

Re:Be Careful Copying Projects


On Tue, 5 Jan 1999 13:15:54 -0800, "Jim Kopet" <ko...@nettaxi.com>
wrote:

Quote
>Once in a while, for sanity, I just make a complete copy
>of an entire development directory.  [Yes, I realize this
>is *not* the recommended method of version control!]

>So, let's say I have a project in directory "New".  I
>drag the entire "New" directory to copy itself at the
>same level.  I then have 2 directories, "New" and
>"Copy of New", both of which contain identical copies
>of .cpp files, .h files, and all other files in the
>project, and each can be built independently.

>However, if I bring up BCB3, and load the project file
>from "Copy of New", the code editor shows that I am
>editing "..\New\Project1.cpp", rather than the
>Project1.cpp that is in "Copy of New".

Check the .bpr file. It may have relative paths
or absolute paths. If there are absolute paths replace
them with relative paths.
Gerard

Re:Be Careful Copying Projects


In your "Copy of New" directory delete the .dsk file (its the desktop
file that saves how Builder should be set up for that particular project
and where the files are located). I do the same thing and discovered the
problem after making an "experimental" directory, doing some experiments
and discovering that the experiments where now part of what used to be
working code. Some more experimenting lead me to the .dsk file. You will
need to re-setup your project preferences (size of edit window, size of
object inspector etc.) a minor inconvienence.

hope this helps - Mike -

Quote
Jim Kopet wrote:
> Once in a while, for sanity, I just make a complete copy
> of an entire development directory.  [Yes, I realize this
> is *not* the recommended method of version control!]

> So, let's say I have a project in directory "New".  I
> drag the entire "New" directory to copy itself at the
> same level.  I then have 2 directories, "New" and
> "Copy of New", both of which contain identical copies
> of .cpp files, .h files, and all other files in the
> project, and each can be built independently.

> However, if I bring up BCB3, and load the project file
> from "Copy of New", the code editor shows that I am
> editing "..\New\Project1.cpp", rather than the
> Project1.cpp that is in "Copy of New".

> Is this normal behavior?  I did not create "links" to
> the files, but actually physically copied each file.
> Apparently, the project knows about the pathname to
> each file, not just the "leaf" name, and I assume that
> by copying the entire project, it still "thinks" that
> the files are located in "New".  Sure, it makes sense.

> Again, I am to blame for using this scheme for backup
> copies and to keep old versions around, but it can be
> very dangerous.  I could innocently go back and start
> hacking up what appears to be an older version (because
> I loaded the project from the older version), while
> in reality I would be editing my current files!

> One sad workaround seems to be to physically do a
> "Remove from Project" for each file, then do an "Add
> to Project" for each file in the archived directory.

Re:Be Careful Copying Projects


Quote
Jim Kopet wrote:
> Once in a while, for sanity, I just make a complete copy
> of an entire development directory.  [Yes, I realize this
> is *not* the recommended method of version control!]

> So, let's say I have a project in directory "New".  I
> drag the entire "New" directory to copy itself at the
> same level.  I then have 2 directories, "New" and
> "Copy of New", both of which contain identical copies
> of .cpp files, .h files, and all other files in the
> project, and each can be built independently.

> However, if I bring up BCB3, and load the project file
> from "Copy of New", the code editor shows that I am
> editing "..\New\Project1.cpp", rather than the
> Project1.cpp that is in "Copy of New".

> Is this normal behavior?  I did not create "links" to
> the files, but actually physically copied each file.
> Apparently, the project knows about the pathname to
> each file, not just the "leaf" name, and I assume that
> by copying the entire project, it still "thinks" that
> the files are located in "New".  Sure, it makes sense.

> Again, I am to blame for using this scheme for backup
> copies and to keep old versions around, but it can be
> very dangerous.  I could innocently go back and start
> hacking up what appears to be an older version (because
> I loaded the project from the older version), while
> in reality I would be editing my current files!

> One sad workaround seems to be to physically do a
> "Remove from Project" for each file, then do an "Add
> to Project" for each file in the archived directory.

Haven't tried it but in Kent & Ken's book, Kent says that the minimum
files needed for a project are the .CPP, .H, .DFM, and the .MAK files.
So maybe only copy these to your Copy of New directory.

anth...@ciphile.com

Re:Be Careful Copying Projects


I looked in my project directory but there was no ".dsk" file there. I've
also been using temporary directories with copies of my project's source,
for experimenting purposes, and BCB always opened files from the right
directory. Is there something in Project Setup that turns the .dsk file
option on?

Tonu Lukk

Quote
Mike Thorn <thor...@rivertrade.com> wrote in message

news:369353DA.A3E617D5@rivertrade.com...
Quote
>In your "Copy of New" directory delete the .dsk file (its the desktop

Other Threads