libfossil
fsl_ckup_state Struct Reference

State to be passed to fsl_ckup_f() implementations via calls to fsl_repo_ckout() and fsl_ckout_update(). More...

#include "checkout.h"

Collaboration diagram for fsl_ckup_state:

Data Fields

void * callbackState
 Optional client-dependent state for use in the fsl_ckup_f() callback.
bool dryRun
 True if the current checkout/update is running in dry-run mode, else false.
fsl_repo_extract_state const * extractState
 The core SCM state for the just-extracted file.
fsl_ckup_fchange_e fileChangeType
 Vaguely describes the type of change the current call into the fsl_ckup_f() represents.
fsl_ckup_rm_state_e fileRmInfo
 Indicates whether the file was removed by the process:
fsl_time_t mtime
 If fsl_repo_ckout()'s or fsl_ckout_update()'s options specified that the mtime should be set on each updated file, this holds that time.
fsl_int_t size
 The size of the extracted file, in bytes.

Detailed Description

State to be passed to fsl_ckup_f() implementations via calls to fsl_repo_ckout() and fsl_ckout_update().

Definition at line 1676 of file checkout.h.

Field Documentation

◆ callbackState

void* fsl_ckup_state::callbackState

Optional client-dependent state for use in the fsl_ckup_f() callback.

This is copies from the corresponding fsl_ckup_opt::callbackState member.

Definition at line 1701 of file checkout.h.

◆ dryRun

bool fsl_ckup_state::dryRun

True if the current checkout/update is running in dry-run mode, else false.

See fsl_ckup_opt::dryRun for details.

Definition at line 1767 of file checkout.h.

◆ extractState

fsl_repo_extract_state const* fsl_ckup_state::extractState

The core SCM state for the just-extracted file.

Note that its content member will be NULL: the content is not passed on via this interface because it is only loaded for files which require overwriting.

An update process may synthesize content for extractState->fCard which do not 100% reflect the file on disk. Of primary note here:

1) fCard->uuid will refer to the hash of the updated-to version, as opposed to the hash of the on-disk file (which may differ due to having local edits merged in).

2) For the update process, fCard->priorName will be NULL unless the file was renamed between the original and updated-to versions, in which case priorName will refer to the original version's name.

Definition at line 1695 of file checkout.h.

◆ fileChangeType

fsl_ckup_fchange_e fsl_ckup_state::fileChangeType

Vaguely describes the type of change the current call into the fsl_ckup_f() represents.

The full range of values is not valid for all operations. Specifically:

Checkout only uses:

FSL_CKUP_FCHANGE_NONE FSL_CKUP_FCHANGE_UPDATED FSL_CKUP_FCHANGE_RM

For update operations all (or most) values are potentially possible.

If this has a value of FSL_CKUP_FCHANGE_RM, this->fileRmInfo will provide a bit more detail.

Definition at line 1720 of file checkout.h.

◆ fileRmInfo

fsl_ckup_rm_state_e fsl_ckup_state::fileRmInfo

Indicates whether the file was removed by the process:

  • FSL_CKUP_RM_NOT = Was not removed.
  • FSL_CKUP_RM_KEPT = Was removed from the checked-out version but left in the filesystem because the confirmer said to.
  • FSL_CKUP_RM = Was removed from the checkout and the filesystem.

When this->dryRun is true, this specifies whether the file would have been removed.

Definition at line 1735 of file checkout.h.

◆ mtime

fsl_time_t fsl_ckup_state::mtime

If fsl_repo_ckout()'s or fsl_ckout_update()'s options specified that the mtime should be set on each updated file, this holds that time.

If the file existed and was not overwritten, it is set to that file's time. Else it is set to the current time (which may differ by a small fraction of a second from the file-write time because we avoid stat()'ing it again after writing). If this->fileRmInfo indicates that a file was removed, this might (depending on availability of the file in the filesystem at the time) be set to 0.

When running in dry-run mode, this value may be 0, as we may not have a file in place which we can stat() to get it, nor a db entry from which to fetch it.

This option is ignored for merge operations.

Definition at line 1754 of file checkout.h.

◆ size

fsl_int_t fsl_ckup_state::size

The size of the extracted file, in bytes.

If the file was removed from the filesystem (or removal was at least attempted) then this is set to -1.

Definition at line 1761 of file checkout.h.


The documentation for this struct was generated from the following file: