File versioning
File versioning
Hello!
I have a suggestion I would like you to think about it.
For example I have a source file test_file.pb.
I then change something and I press CTRL-S to save the file. And then I change something else and again I press CTRL-S.
It would be nice to have something like file versioning*.
After I would press the CTRL-S combination for the first time my original test_file.pb would be renamed to test_file.pb.1** and the new version would be saved as test_file.pb. After my second CTRL-S this current test_file.pb. would be saved as test_file.pb.2 and the new file would be named test_file.pb.
In this way I would have some backup of my work. I would just copy/rename the version that was good.
Thoughts?
Thanks.
Saso
* I worked on OpenVMS (VAX, ALPHA) for more than 20 years so I know this is very useful.
I know that PureBasic supports 'Session history'. Maybe this could be useful, too for some people. (this could be turned on/off in the settings)
** PB would scan the file system and check for the highest version number so it does not replace an existing file.
I have a suggestion I would like you to think about it.
For example I have a source file test_file.pb.
I then change something and I press CTRL-S to save the file. And then I change something else and again I press CTRL-S.
It would be nice to have something like file versioning*.
After I would press the CTRL-S combination for the first time my original test_file.pb would be renamed to test_file.pb.1** and the new version would be saved as test_file.pb. After my second CTRL-S this current test_file.pb. would be saved as test_file.pb.2 and the new file would be named test_file.pb.
In this way I would have some backup of my work. I would just copy/rename the version that was good.
Thoughts?
Thanks.
Saso
* I worked on OpenVMS (VAX, ALPHA) for more than 20 years so I know this is very useful.
I know that PureBasic supports 'Session history'. Maybe this could be useful, too for some people. (this could be turned on/off in the settings)
** PB would scan the file system and check for the highest version number so it does not replace an existing file.
Re: File versioning
Try out the built-in Session History which tracks changes up to 1 month.
If that is not sufficient, then write a Tool code that triggers your flavor of Version Control.
I prefer Fossil, which stores all changes in a single SQLite database and gives you a web page gui for timelines & diffs, email, forum, wiki, etc.
If that is not sufficient, then write a Tool code that triggers your flavor of Version Control.
I prefer Fossil, which stores all changes in a single SQLite database and gives you a web page gui for timelines & diffs, email, forum, wiki, etc.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: File versioning
Code: Select all
on create/save file($name)
del $name.9
ren $name.8 $name.9
ren $name.7 $name.8
ren $name.6 $name.7
ren $name.5 $name.6
ren $name.4 $name.5
ren $name.3 $name.4
ren $name.2 $name.3
ren $name.1 $name.2
ren $name $name.1
save $name
Re: File versioning
It defaults to one month, but you can also disable the limit or change the duration in the Prefs. My history is set to 365 days.skywalk wrote:Try out the built-in Session History which tracks changes up to 1 month.
Re: File versioning
Can even be set to "Keep all history".
Good to know
Good to know

Re: File versioning
Save as new version (filename + "_num" + ext) should be mandatory in ALL software by now. 
I would also like to semi-hijack and reiterate a FR I had, that it would be great if the tokens %BUILDCOUNT and %COMPILECOUNT could be used in a filename, and they autoupdated to reflect each version saved.
I already wrote my own tools for simple source control because I dont actually find the built in session history that useful. (EDIT: however it did save my ass once, so...
)

I would also like to semi-hijack and reiterate a FR I had, that it would be great if the tokens %BUILDCOUNT and %COMPILECOUNT could be used in a filename, and they autoupdated to reflect each version saved.
I already wrote my own tools for simple source control because I dont actually find the built in session history that useful. (EDIT: however it did save my ass once, so...

Seems like it may be useful to me soon, thx.skywalk wrote:I prefer Fossil, which stores all changes in a single SQLite database and gives you a web page gui for timelines & diffs, email, forum, wiki, etc.
Proud supporter of PB! * Musician * C64/6502 Freak
Re: File versioning
Not sure how well this will coordinate with Session History, but this is what I do for my About version display:
The PB constants are taken at compile time, so you can tell how many times you have compiled between saved exe's.
Code: Select all
#UpdaterThisVersion = "Beta"
Version$ = #UpdaterThisVersion
Version$ + FormatDate(".%yy.%mm.%dd.", #PB_Compiler_Date) + Str(#PB_Editor_BuildCount)
- Michael Vogel
- Addict
- Posts: 2797
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: File versioning
What about writing an own purebasic program which will be added as a tool into the IDE?
By assigning the shortcut Ctrl+S it would be triggered to save the source code as wanted, make backups and so on - it could even modify the source code by adding a comment with the actual version number etc.
By assigning the shortcut Ctrl+S it would be triggered to save the source code as wanted, make backups and so on - it could even modify the source code by adding a comment with the actual version number etc.
Re: File versioning
Well, version control is an established and optimized function that does not make sense to reattempt. It would be more efficient to develop pb tool code that would trigger check in/check out of git or fossil repositories. 

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: File versioning
Thank you all. First sorry for a late reply - I've been out of the country for a few days.
@Bitblazer: great. But the newest version should have highest version.
@tenaja: very good tips. Thanks.
Saso
@Bitblazer: great. But the newest version should have highest version.
@tenaja: very good tips. Thanks.
Saso