~jelmer/bzr-builddeb/relative-imports

« back to all changes in this revision

Viewing changes to merge_upstream.py

  • Committer: Jelmer Vernooij
  • Date: 2011-07-20 19:01:04 UTC
  • mto: This revision was merged to the branch mainline in revision 592.
  • Revision ID: jelmer@samba.org-20110720190104-adra5g365hfjd132
make sure the changelog becomes versioned when creating it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
            str(package_version(upstream_version, distribution_name, epoch)),
102
102
            "-D", "UNRELEASED", "--release-heuristic", "changelog",
103
103
            "--package", package, entry_description]
104
 
    if not tree.has_filename("debian/changelog"):
 
104
    create = (not tree.has_filename("debian/changelog"))
 
105
    if create:
105
106
        argv.append("--create")
106
 
    proc = subprocess.Popen(argv, cwd=tree.basedir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
107
    proc = subprocess.Popen(argv, cwd=tree.basedir, stdout=subprocess.PIPE,
 
108
        stderr=subprocess.PIPE)
107
109
    (stdout, stderr) = proc.communicate()
108
110
    if proc.returncode != 0:
109
111
        raise DchError("Adding changelog entry failed: %s" % stderr)
 
112
    if create:
 
113
        tree.add(["debian/changelog"])