Version Control, part 2

General discussion related to "Everything".
Post Reply
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Version Control, part 2

Post by NotNull »

As it is not allowed to post screenshots (or other pictures) in the development forum, that thread will be continued here.
Some screenshots of what I've build so far (scripts come later as I just discovered a -cosmetic- bug).

The scripts will backup 'projects' in some folder (in my case c:\develop) to a backup location (I tested with c:\backup\develop).
Every time you backup those projects, it will only copy new or changed files to this backup location.
That is done in a folder structure similar to c:\backup\develop\project1\<timestamp>\path\to\your files.
That way you can always go "back in time" to the *exact* state it was in at the moment of <timestamp>, without copying a file multiple times to the backup location (if it hadn't changed).

Whenever you made some changes to your project that are worth saving for later, you start the (PowerShell) script that will take of it all.
After starting, it will ask for each changed project to describe it. That is convenient if you want to restore files (more on that later)

A few screenshots will probably make it more clear.

Start the PowerShell script to start the backup process. That will show you this dialog:
2018-11-23 22_28_41-Demo Project - Select category.png
2018-11-23 22_28_41-Demo Project - Select category.png (10.81 KiB) Viewed 2237 times
After selecting a category of your changes, you are asked to describe the changes:
2018-11-23 22_30_40-Demo Project _ Describe the changes.png
2018-11-23 22_30_40-Demo Project _ Describe the changes.png (3.46 KiB) Viewed 2237 times
That's all. If there are more projects that changed since last time you ran the script, you will be asked the same questions for that project. The titlebar of the dialog boxes tell you which project you are describing.

In the end, this is what you will see:
2018-11-23 22_32_11-PS (2).png
2018-11-23 22_32_11-PS (2).png (42.81 KiB) Viewed 2237 times
That's all for backup.


Restore: Start another PowerShell script:
2018-11-23 22_33_14-Project to restore.png
2018-11-23 22_33_14-Project to restore.png (16.09 KiB) Viewed 2237 times
2018-11-23 22_34_02-Select time.png
2018-11-23 22_34_02-Select time.png (19.16 KiB) Viewed 2237 times
After that, you will see a window you might recognize: Everything!
In Everything, select the files you want to restore and press <Enter>
2018-11-23 22_51_06-_Select files to restore ...._.png
2018-11-23 22_51_06-_Select files to restore ...._.png (18.01 KiB) Viewed 2237 times
Now select the folder where you want these files to 'land'. The c:\develop\projectname folder is pre-selected, but you can restore your files to any other location too. Be careful: existing files will be overwritten without further asking.
2018-11-23 22_53_38-Browse For Folder.png
2018-11-23 22_53_38-Browse For Folder.png (10.74 KiB) Viewed 2237 times

And that's it. The selected files are restored. Last screenshot to show that the files are actually restored:
2018-11-23 22_56_05-PS (2).png
2018-11-23 22_56_05-PS (2).png (32.85 KiB) Viewed 2237 times

As said, scripts will follow later ..
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Version Control, part 2

Post by NotNull »

Forgot to post the scripts ...

Don't think anyone will ever take a look at it (let alone use it), but it's good to have an off-site backup ;)

Recipe:
- extract zip to empty folder
- Add Everything.exe (needed for monitoring filesystem changes ànd for selecting files to restore)
- Change the settings in both Snap-In.ps1 and Snap-Out.ps1

Now you can interactively backup and restore 'projects' with those 2 scripts.

Run Snap-In.ps1 unattended (for scheduled tasks etc) with command:
Powershell.exe -File "C:\Path\To\Your\Snap-In.ps1" -AutoSave


EDIT: Updated to version 2.2 (was 2.1)
Attachments
Snap-In-Out v2.2.zip
(11.34 KiB) Downloaded 231 times
Post Reply