Guides/Qt IDE/Snapshots

From J Wiki
< Guides‎ | Qt IDE
Jump to navigation Jump to search

The Qt IDE makes snapshots to track recent changes made to scripts, and optionally of projects. This allow comparisons of old and new versions, and reversion to old versions. Snapshots are complementary to version control systems like Git or Subversion, and track work in progress rather than major code releases.

Snapshot Directories

Snapshots are stored under directory jpath '~snap/.snp'. The snap folder name is set in bin/profile.ijs and can be anywhere on the system. The .snp subdirectory is usually hidden by directory browsers.

Snapshots are stored in subdirectories named as the SHA-1 hash of the source directory:

    jpath '~snap/.snp/',getsha1_jqtide_ jpath '~Redux/core/base'
/own/snap/.snp/d81e383393e7d7abaf92d3d478e80140c34fa616

The contents of each subdirectory will include:

dir.txt          a text file with the source directory name
pyymmdd          folders, e.g. p170705, containing script snapshots for the given date
syymmddnnn       folders, e.g. s170514001, with project snapshots for the date and sequence number

The snapshot directory can be moved, with a corresponding change to ~snap. It can be deleted, which just deletes the snapshots.

Script Snapshots

Any time a file is changed and saved, a copy is written to the snapshot directory. The copy is appended to a file of the same name. Note that scripts are saved whenever the code is run from the Run menu or corresponding shortcut.

Changes made today can be browsed from edit menu Script|Snapshots. At most two days worth of script snapshots are kept.

Project Snapshots

The Edit|Configure|Qt Ide menu lets you set the following parameters:

  • maximum number of project snapshots to keep, default 5 (0=off)
  • snapshot exclusion list, whitespace or comma delimited, e.g. .jpg to exclude jpeg image files

Each snapshot is a copy of the project directory, and includes all files in the directory, except for the exclusion list.

Project Snapshots are made automatically, and can also be made manually. Automatic snapshots are made when a project is opened in the editor, and are made for all projects under the project Folder, as follows:

  • if the snapshot directory does not exist or is empty, make a snapshot and exit
  • if there is a snapshot with today's date, then exit
  • if the current contents of the project match the most recent snapshot, then exit
  • make a snapshot

Manual snapshots can be made by selecting menu Project|Make Snapshot. Snapshots are made only if the current project directory differs from the most recent snapshot.

Compare

Comparisons use Directory Match by default, but can also call an external diff program such as Meld (configure as XDiff in Edit|Configure|Base).

To compare snapshots, select menu Script|Script Snapshots or Project|Project Snapshots.