Diff

This module contains methods for comparing instances in the compose/repository hierarchy. Each method returns a Diff instance representing additions, removals, and other changes between the two given instances.

Much like composes, repositories, and packages, recursion into deeper levels of the hierarchy is automatic.

class debrepo.diff.Diff(new_name, old_name, compared=None, added=None, removed=None)[source]

Basic representation of a difference between a new and old version of an object

The new_name and old_name arguments are intended to represent changes in identifier. In cases where this doesn’t make any sense, or it doesn’t matter, the new_name identifier is used.

The compared argument is a list of subcomponents which are shared and have been compared between two instances. This is often a list of Diff instances representing those subcomponents. If an instance has no subcomponents, the field is not used.

The added and removed arguments are lists of subcomponents which appear only in the new and old instances, respectively. If an instance has no subcomponents, they may represent relevant metadata changes, or be left unused.

debrepo.diff.diff_composes(new_compose, old_compose, logindent=0)[source]

Compare two Compose instances and their subcomponents recursively.

Returns a Diff instance with the names of the two composes, lists of added and removed repositories, and a list of Diff instances for compared repositories generated by diff_repos().

debrepo.diff.diff_repos(new_repo, old_repo, logindent=0)[source]

Compare two Repo instances and their subcomponents recursively.

Returns a Diff instance with the names of the two repositories, lists of added and removed distributions, and a list of Diff instances for compared distributions generated by diff_dists().

debrepo.diff.diff_dists(new_dist, old_dist, logindent=0)[source]

Compare two Dist instances and their subcomponents recursively.

Returns a Diff instance with the names of the two distributions, lists of added and removed components, and a list of Diff instances for compared components generated by diff_components().

debrepo.diff.diff_components(new_component, old_component, logindent=0)[source]

Compare two Component instances and their subcomponents recursively.

Returns a Diff instance with the names of the two components, lists of added and removed architectures, and a list of Diff instances for compared architectures generated by diff_arches().

debrepo.diff.diff_arches(new_arch, old_arch, logindent=0)[source]

Compare two Arch instances and their subcomponents recursively.

Returns a Diff instance with the names of the two architectures, lists of added and removed packages, and a map of source (parent) package names to Diff instances containing the new changelog minus the old in the compared attribute and the new and old version numbers in the added and removed attributes, respectively.