Change Tracking

From SweepMe! Wiki
Jump to navigation Jump to search

Pro feature, available from SweepMe! 1.5.7.8.

Change Tracking keeps a local version history of the SweepMe! public folder, e.g. your custom drivers, CustomFunction scripts, sequences and configuration files. Whenever a measurement is started or SweepMe! is closed, all changes are saved as a snapshot. Later, you can see when something changed and restore any earlier state. No external repository and no extra software is needed.

Enabling Change Tracking

  1. Open File → Options… and select the tab Change Tracking.
  2. Click Enable (Pro). SweepMe! indexes all files of the public folder and saves the first snapshot ("Enabled SweepMe! Change Tracking"). This can take a moment the first time.

Click Disable to switch Change Tracking off. The history is kept and continues when you enable Change Tracking again.

If no SweepMe! Pro license is active, Change Tracking is switched off automatically.

When snapshots are taken

Event Message of the snapshot
A measurement is started Run started
SweepMe! is closed Closed SweepMe!
Button Snapshot in the tab Change Tracking Manual Snapshot

A snapshot is only created if something has changed since the last one.

What is tracked

All files in the SweepMe! public folder (see Folder system), e.g. custom drivers, custom modules, CustomFunction scripts, sequences, calibration files and configuration files.

Not tracked are:

  • measurement data (folder Measurement) and screenshots (folder Screenshots),
  • files that SweepMe! generates automatically, such as run.ini of drivers and modules, and __pycache__ folders,
  • log files such as debug.log.

Only files in the default folders are covered. Files in a custom data or sequence path or in user-defined source paths (File → Options… → Paths (Pro)) are not tracked.

Viewing and restoring snapshots

When Change Tracking is enabled, the tab Change Tracking shows the snapshots under View snapshots: with the columns Date / Time, Message, Author and Commit. Select the history with Branch:. Usually there is only one branch, save/1.

The latest 50 snapshots are shown. Right-click the list and select Load more commits or Load all commits to see older ones.

To restore a snapshot:

  1. Right-click it and select Restore to Folder….
  2. Choose a folder outside the SweepMe! public folder.
  3. SweepMe! extracts all files of that snapshot into a new subfolder named sweepme_<date>_.

Your current files are not changed, so you can compare the files and copy back only what you need.

Link to measurement data

When a measurement starts with Change Tracking enabled, the short hash of the snapshot is written into the sequence file in the legacy format (.set) that is saved together with the measurement data, as a line # Repository hash: .... So you can find out later which version of your drivers and scripts produced a data set. The .seq file does not contain the hash.

Notes

  • The public folder becomes a git repository (folder .git). You can inspect it with any git tool, but do not commit to it yourself.
  • If the public folder already is a git repository that was not created by SweepMe!, Change Tracking cannot be enabled, to avoid conflicts.
  • Change Tracking works across different Windows user accounts (from SweepMe! 1.5.7.9).

See also