Package gbp :: Package scripts :: Module dch

[hide private]
[frames] | no frames]

# Module dch

Generate Debian changelog entries from Git commit messages

Functions | [hide private]

guess_version_from_upstream(repo, upstream_tag_format, upstream_branch, cp) Guess the version based on the latest version on the upstream branch. |

get_author_email(repo, use_git_config) Get author and email from git configuration |

fixup_section(repo, use_git_author, options, dch_options) Fixup the changelog header and trailer's committer and email address |

snapshot_version(version) Get the current release and snapshot version. |

mangle_changelog(changelog, cp, snapshot=`'````'`) Mangle changelog to either add or remove snapshot markers |

do_release(changelog, repo, cp, use_git_author, dch_options) Remove the snapshot header and set the distribution |

do_snapshot(changelog, repo, next_snapshot) Add new snapshot banner to most recent changelog section. |

parse_commit(repo, commitid, opts, last_commit=False) Parse a commit and return message, author, and author email |

`str`

guess_documented_commit(cp, repo, tagformat) Guess the last commit documented in the changelog from the snapshot banner, the last tagged version or the last point the changelog was touched. |

has_snapshot_banner(cp) Whether the changelog has a snapshot banner |

get_customizations(customization_file) |

process_options(options, parser) |

process_editor_option(options) Determine text editor and check if we need it |

changelog_commit_msg(options, version) |

build_parser(name) |

parse_args(argv) |

main(argv) |

Variables | [hide private]

| user_customizations = ``{``}``
| snapshot_re = `re.compile(r'\s`*`\*\* SNAPSHOT build @`(?P<``commit``>``...``
| __package__ = ``'``gbp.scripts``'``

Function Details | [hide private]

### guess_version_from_upstream(repo, upstream_tag_format, upstream_branch, cp)

Guess the version based on the latest version on the upstream branch. If the version in dch is already higher this function returns None.

### fixup_section(repo, use_git_author, options, dch_options)

Fixup the changelog header and trailer's committer and email address

It might otherwise point to the last git committer instead of the person creating the changelog

This also applies --distribution and --urgency options passed to gbp dch

### snapshot_version(version)

Get the current release and snapshot version.

Format is <debian-version>~<release>.gbp<short-commit-id>

    >>> snapshot_version('1.0-1')
    ('1.0-1', 0)
    >>> snapshot_version('1.0-1~1.test0')
    ('1.0-1~1.test0', 0)
    >>> snapshot_version('1.0-1~2.gbp1234')
    ('1.0-1', 2)

### mangle_changelog(changelog, cp, snapshot=`'````'`)

Mangle changelog to either add or remove snapshot markers

Parameters:
  - `snapshot` (`str`) - SHA1 if snapshot header should be added/maintained, empty if it should be removed

### do_snapshot(changelog, repo, next_snapshot)

Add new snapshot banner to most recent changelog section. The next snapshot number is calculated by eval()'ing next_snapshot.

### guess_documented_commit(cp, repo, tagformat)

Guess the last commit documented in the changelog from the snapshot banner, the last tagged version or the last point the changelog was touched.

Parameters:
  - `cp` - the changelog
  - `repo` - the git repository
  - `tagformat` - the format for Debian tags
Returns: `str`
  the commit that was last documented in the changelog
Raises:
  - `GbpError` - In case we fail to find a commit to start at

Variables Details | [hide private]

### snapshot_re

Value:

      re.compile(r'\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*')