Skip to main content

Utilities to normalize working with different Version Control Systems

Project description

Summary

vcsinfo gathers information about a source tree, supporting Git, Mercurial, and Perforce working directories.

Installation

pip install vcsinfo

Usage

Example usage using the vcsinfo project itself (git backend):

import vcsinfo

data = vcsinfo.detect_vcs(my_path)
data.name  # project name: 'vcsinfo'
data.branch  # branch name: 'main'
data.id  # native commit identification: '4bb323148e43543247afe066db0dbac0fcf45537'
data.upstream_repo  # upstream repo url: 'git@github.com/adobe/vcsinfo.git'
data.user  # user who performed the commit: 'saville'
data.id_short  # a short representation of the id: '4bb323'
data.number  # same as id if commits have increasing numbers, otherwise simulated an increasing commit number: 77
data.modified  # none if no local modifications, otherwise the epoch seconds of the most recently modified file: 1629746987
data.release  # string representing the current state of the branch: '77.I4bb323.M1629746987'
data.id_string  # string providing a unique id of branch and release: 'main-77.I4bb323.M1629746987'

# Retrieves a tuple of lists of modified changes in the changeset, see code
# for return format
data.status()

# List the files known to the VCS
data.list_files()

# Retrieves VCS information as a dict, optionally including full file information
data.info()
data.info(include_files=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vcsinfo-2.0.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

vcsinfo-2.0.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file vcsinfo-2.0.0.tar.gz.

File metadata

  • Download URL: vcsinfo-2.0.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for vcsinfo-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8341ed1f6ad7fb822183cf2f6411f4997d42c820a791056b41d111e743c2744b
MD5 1f99c38e9ea1010d32552d5097c92d82
BLAKE2b-256 c5900e723c92ef58952400e29796b760d5288932395848a629ba664197deae60

See more details on using hashes here.

File details

Details for the file vcsinfo-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: vcsinfo-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for vcsinfo-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d221d74fb9432da88f6f46938bf07996c4d99fe0d70fb07e009413c8b0e42ef
MD5 7629d8f5f56fffb5e92dc35ef1c80d18
BLAKE2b-256 0f5a7280a2327d696bc2f74f927921d22f9c2e7633497adffad65a8e91cb1633

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page