Recent

Author Topic: moving project, extending, forking off  (Read 1641 times)

Weiss

  • Full Member
  • ***
  • Posts: 126
moving project, extending, forking off
« on: September 22, 2023, 09:48:55 pm »
How to branch off a new project from an old one? I need to leave old project untouched, it is more or less complete.

Apparently simply "save project as" is not the way. I did, and all the units, but new units call old forms. I am in a bit of a mess already.

For example, why new project (old one but under new name) does not have new forms available to the project? Why old project instead has forms under new names available to it. Why new form in old project does not show new components, and shows old form caption when I compile it?

wp

  • Hero Member
  • *****
  • Posts: 11782
Re: moving project, extending, forking off
« Reply #1 on: September 22, 2023, 10:19:05 pm »
If you copy a project in the IDE (by using "save as") the IDE copies only the project file to the new folder but keeps all units at their old place and changes in the new project all references to the old location. To get also the units you'll have to "save as" the units as well. But if you are not careful the IDE will change the references to the copied units, it even allows you to delete the old units. In any case, there is a high chance that you destroy both old and new the projects.

Therefore, I strongly recommend to go another way: Close the IDE and copy the project folder by the OS's file manager to a new folder. This copies all files, and you have two independent projects new. You can work on the new project, but still have the project in the old folder functional for reference.

Another way to copy a project is to use "Project" > "Publish project".

If you already had copied project files to a new folder first restore the old project. Close the IDE and copy all files from the new folder back to their original location. Then open the IDE, open the project options, "Compiler options" > "Paths" and fill all paths pointing into the new directory. Look at the file tree in the project options. Those files listed with a path to the new directory must be deleted and then re-added with their original path.


Weiss

  • Full Member
  • ***
  • Posts: 126
Re: moving project, extending, forking off
« Reply #2 on: September 22, 2023, 10:28:52 pm »
thank you wp. Some damage already done, but not too bad. I got both projects to compile and run, old project has new associations that is all.

I must say, what you recommend - using OS file dialogue to move project - I have done exactly this in the past when I was saving latest stable versions.

Why did I not do same thing this time I don't know. Lesson learned.

DelphiDinosaur

  • New Member
  • *
  • Posts: 15
Re: moving project, extending, forking off
« Reply #3 on: October 13, 2023, 12:40:06 pm »
Agreed. Copying the project's folder in the OS is the way I normally do it (mainly archiving working versions of code).

One thing to watch out for is if you have project files in other directories, e.g:
Projects/ProjectA
Projects/ProjectA-Copy
Projects/SharedFiles

Any changes made in ProjectA-Copy to  files saved in the SharedFiles folder will ripple into ProjectA when it's next recompiled. This may or may not be desirable.

DD.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 790
    • Blog personal
Re: moving project, extending, forking off
« Reply #4 on: October 13, 2023, 10:02:32 pm »
Hi, I use Publish project, from menu project.
It's works fine for me.

/BlueIcaro

 

TinyPortal © 2005-2018