~ubuntu-branches/debian/sid/bzr-builddeb/sid

« back to all changes in this revision

Viewing changes to merge_upstream.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij, Colin Watson, Jelmer Vernooij, Robert Collins, James Westby
  • Date: 2010-08-11 18:23:54 UTC
  • Revision ID: james.westby@ubuntu.com-20100811182354-pgqznly5bbtoiso4
Tags: 2.5
[ Colin Watson ]
* Consider a .dsc without a Format: to be Format: 1.0.

[ Jelmer Vernooij ]
* export now uses the timestamp of the last revision, making them more
  deterministic, and so hopefully producing the same tarballs when it is
  used for that.
* Fix use of getattr to have 3 arguments to avoid exception. (LP: #572093)
* Implement the automatic_tag_name hook so that "bzr tag" with no arguments
  will tag based on the version in debian/changelog.
* Support upstream/VERSION tags, for compatibility with git-
  buildpackage. LP: #551362
* Support upstream tarballs without a pristine tar delta.
* Support -r argument to import-upstream.

[ Robert Collins ]
* Add import-upstream command which imports an upstream - useful for
  migrating existing packaging branches into pristine-tar using mode.
* Stop stripping .bzrignore from tarball imports. LP: #496907
* Make the upstream branch authoritative for file ids when importing a
  tarball, stopping errors when files are renamed. LP: #588060

[ James Westby ]
* Add a --package-merge option to builddeb to build with the -v and -sa
  appropriate when doing a merge from Debian or similar. LP: #576027
* Fixed a logic error that stops -r working in merge-upstream. LP: #594575

[ Jelmer Vernooij ]
* Determine Bazaar home directory using bzrlib to prevent test
  isolation issues. Closes: #614125
* Bump standards version to 3.9.1 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#
28
28
 
29
29
import itertools
 
30
import subprocess
30
31
 
31
 
from debian_bundle.changelog import Version
 
32
try:
 
33
    from debian.changelog import Version
 
34
except ImportError:
 
35
    # Prior to 0.1.15 the debian module was called debian_bundle
 
36
    from debian_bundle.changelog import Version
32
37
 
33
38
from bzrlib.revisionspec import RevisionSpec
34
39
 
163
168
    else:
164
169
        ret.debian_version = "%d" % (prev_packaging_revnum+1)
165
170
    return ret
 
171
 
 
172
 
 
173
def changelog_add_new_version(tree, version, distribution_name, changelog,
 
174
        package):
 
175
    """Add an entry to the changelog for a new version.
 
176
 
 
177
    :param tree: WorkingTree in which the package lives
 
178
    :param version: Version to add
 
179
    :param distribution_name: Distribution name (debian, ubuntu, ...)
 
180
    :param changelog: Changelog object
 
181
    :param package: Package name
 
182
    :return: Whether an entry was successfully added
 
183
    """
 
184
    from bzrlib.plugins.builddeb.merge_upstream import package_version
 
185
    if "~bzr" in str(version) or "+bzr" in str(version):
 
186
        entry_description = "New upstream snapshot."
 
187
    else:
 
188
        entry_description = "New upstream release."
 
189
    proc = subprocess.Popen(["dch", "-v",
 
190
            str(package_version(version, distribution_name)),
 
191
            "-D", "UNRELEASED", "--release-heuristic", "changelog",
 
192
            entry_description], cwd=tree.basedir)
 
193
    proc.wait()
 
194
    # FIXME: Raise insightful exception here rather than just checking
 
195
    # return code.
 
196
    return proc.returncode == 0
 
197