Using Version Control out of the Astrobe IDE

General discussions about working with the Astrobe IDE and programming ARM Cortex-M0, M3, M4 and M7 microcontrollers.
Post Reply
bscholte
Posts: 19
Joined: Sat Jan 24, 2015 6:15 pm
Location: Austria
Contact:

Using Version Control out of the Astrobe IDE

Post by bscholte » Tue Mar 30, 2021 6:59 pm

We are using SubVersion and version management system on Delphi and would like to use this on the embedded source code as well. The possibility to add menu items in Astrobe v7.0+ gives a very nice way to do this.

1.) Integrating SubVersion
  • We are using TortoiseSVN for Windows. This needs to be installed first.
  • Create a repository with your Oberon MOD files.
  • Create a local WorkDir from this repository
This basically allows the use of SVN from the windows explorer, but doing from the IDE is much more comfortable. For that, add a few lines to the "Tools.ini" file. Assuming that Tortoise was installed to the default location, this ends up as:

Code: Select all

[Command0]
MenuItem=&Open Containing Folder ...
Path=C:\Windows\explorer.exe
Parameters=%FileDir%
WorkingFolder=%FileDir%
ConsoleApp=FALSE
Prompt=FALSE
[Command1]
MenuItem=Open E&xamples Folder ...
Path=C:\Windows\explorer.exe
Parameters=%AstrobeM3%\Examples
WorkingFolder=%AstrobeM3%\Examples
ConsoleApp=FALSE
Prompt=FALSE
[Command2]
MenuItem=&View Map File
Path=c:\Windows\System32\cmd.exe 
Parameters=/c type %FileDir%\%FileRoot%.map
WorkingFolder=%FileDir%
ConsoleApp=TRUE
Prompt=FALSE
[Command3]
MenuItem=SVN &Status
Path=C:\Program Files\TortoiseSVN\bin\svn.exe
Parameters=status -v %FileDir%
WorkingFolder=%FileDir%
ConsoleApp=TRUE
Prompt=FALSE
[Command4]
MenuItem=SVN &Commit
Path=C:\Program Files\TortoiseSVN\bin\svn.exe
Parameters=commit -m "Committed all Changes" %FileDir%
WorkingFolder=%FileDir%
ConsoleApp=TRUE
Prompt=FALSE
[Command5]
Command 3 gives a rundown of the repository in the info panel of the IDE
Command 4 commits the changed local files to repository. (->A similar command can be used to update the local files from the repository, but the files are then not reloaded in the IDE. This might lead to conflicts, so Updates should be done before starting the IDE)

bscholte
Posts: 19
Joined: Sat Jan 24, 2015 6:15 pm
Location: Austria
Contact:

Re: Using Version Control out of the Astrobe IDE

Post by bscholte » Wed Mar 31, 2021 6:56 am

(You live and learn...)
The Commit command defined in the previous post does not allow to change the comments on the changes. This is quite essential. Instead, it would be much better to open the normal TortoiseSVN commit dialog to complete all desired fields.
Luckily, Tortoise is a shell extension which opens all normal dialogs to command line attributes of its main program. In this case, we can call the main program with the arguments given in the snippet below:

Code: Select all

[Command4]
MenuItem=SVN &Commit
Path=C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe
Parameters=/command:commit /path:%FileDir% /logmsg:"Astrobe IDE Changes: "
WorkingFolder=%FileDir%
ConsoleApp=FALSE
Prompt=FALSE
This adds a command to the Astrobe IDE which opens the normal Commit dialog.

Post Reply