bzr-builddeb merge sorts the changelog by version order, rather than preserving existing ordering

Bug #718944 reported by Steve Langasek
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Distributed Development
Fix Released
Undecided
Andrew Bennetts
bzr-builddeb
Fix Released
High
Andrew Bennetts
bzr-builddeb (Ubuntu)
Fix Released
High
Andrew Bennetts

Bug Description

Binary package hint: bzr-builddeb

For a simple merge of two UDD branches that have 3 and 2 new package revisions on them respectively, but a *very* extensive package history that includes multiple renames, bzr merge rips the changelog to shreds:

$ bzr diff debian/changelog|diffstat
 changelog | 4549 ++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 2274 insertions(+), 2275 deletions(-)
$

Every time I do a UDD merge between branches I have to pay close attention to how the changelog has been modified; but in the case of gcc-4.5, it's an absolute nightmare.

I think bzr-builddeb (or python-debian) needs to be switched to using the dpkg-mergechangelog implementation, instead of this divergent implementation that insists on reordering all the entries in the changelog in version order instead of respecting the existing shared history.

Related branches

Steve Langasek (vorlon)
Changed in bzr-builddeb (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

I thought it was a debian requirement that the changelog be in version sorted order...

summary: - bzr makes an unholy mess of debian/changelog on 'bzr merge'
+ bzr-builddeb merge sorts the changelog by version order, rather than
+ preserving existing ordering
Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 718944] Re: bzr-builddeb merge sorts the changelog by version order, rather than preserving existing ordering

On Tue, Feb 15, 2011 at 03:30:24PM -0000, John A Meinel wrote:
> I thought it was a debian requirement that the changelog be in version
> sorted order...

The only requirement is that, for each archive destination the package is
uploaded to, later versions have version numbers that sort after the
preceding uploads. And even that doesn't hold true if the package name has
changed. There are definitely plenty of packages for which the version
history is non-linear and gets flattened in other than version order.

It's fine to use version order - or any order - for the changelog entries
that are part of the merge. But shared common history from the base
revision should be left alone, whatever order it happens to have been put
in.

Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Jelmer Vernooij (jelmer)
Changed in bzr-builddeb:
status: New → Triaged
importance: Undecided → High
tags: added: changelog-merge
Revision history for this message
Andrew Bennetts (spiv) wrote :

> I think bzr-builddeb (or python-debian) needs to be switched to using the dpkg-mergechangelog implementation

The linked branch, lp:~spiv/bzr-builddeb/use-dpkg-mergechangelogs, does this: it deletes most of merge_changelog.py and just shells out to dpkg-mergechangelogs. However, 3 out of the 8 tests in tests/test_merge_changelog.py fail. I'm attaching the test log. I'd appreciate an Ubuntu dev's opinion regarding whether the divergent behaviour is an improvement or not: it appears that in some cases dpkg-mergechangelogs gives differently ordered output, or claims success where before a conflict would occur.

You can also just try out my branch and see if it works better for you!

Revision history for this message
Andrew Bennetts (spiv) wrote :
Revision history for this message
Andrew Bennetts (spiv) wrote :

I'm asking the UDD list for feedback.

Changed in bzr-builddeb:
assignee: nobody → Andrew Bennetts (spiv)
status: Triaged → In Progress
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I think these are acceptable test failures.

dpkg-mergechangelog is a bit more liberal in what it accepts as a changelog entry which is why test_not_valid_changelog fails

test_unsorted fails because dpkg-mergechangelog no longer fixes up the order of entries in the changelog. I think that is reasonable - it's doing a merge, not fixing the formatting of the changelog file (we don't expect a merge of two C files to clean up the indentation too). Of course, it should add new entries at the right place in the changelog, but it appears to be doing that.

test_3way_conflicted is correct and does the right thing by merging the two changelog entries rather than conflicting. this is bug 517093

I think this also fixes a fair number of other bugs open against bzr-builddeb. In particular: bug 517090, bug 552950

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

To summarize, I think this is a huge improvement over the current changelog merger in all aspects and it fixes 4 open bugs.

Revision history for this message
Andrew Bennetts (spiv) wrote :

Thanks for checking that Jelmer. The feedback on the list seemed positive too, so I'll tidy up the test failures and update the merge proposal.

Jelmer Vernooij (jelmer)
Changed in bzr-builddeb:
status: In Progress → Fix Committed
milestone: none → 2.7.6
Jelmer Vernooij (jelmer)
Changed in bzr-builddeb:
milestone: 2.7.6 → 2.7.7
Jelmer Vernooij (jelmer)
Changed in bzr-builddeb (Ubuntu):
assignee: nobody → Andrew Bennetts (spiv)
Changed in udd:
status: New → Fix Released
Changed in bzr-builddeb:
status: Fix Committed → Fix Released
Changed in udd:
assignee: nobody → Andrew Bennetts (spiv)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr-builddeb - 2.7.7

---------------
bzr-builddeb (2.7.7) unstable; urgency=low

  [ Jelmer Vernooij ]
  * Build type now defaults to normal mode when used in an empty tree.
    LP: #776528

  [ Andrew Bennetts ]
  * Use dpkg-mergechangelogs(1) to merge changelog files.
   + Preserve the existing ordering of changelog entries when merging.
     LP: #718944
   + Additional changelog entries are modified when merging another branch.
     LP: #552950
   + 3-way changelog file merge doesn't do textual merging on sections.
     LP: #517093
   + 3-way changelog file merge doesn't support deletions. LP: #517090

  [ Jelmer Vernooij ]
  * Add python-lzma to build dependencies, for use in test suite.
  * Recommend libalgorithm-merge-perl, required for conflict resolution
    in dpkg-mergechangelogs.

bzr-builddeb (2.7.6) unstable; urgency=low

  * Bump standards version to 3.9.2 (no changes).
  * Fix AttributeError in incremental imports using 'bzr import-dsc'.
    LP: #812950
  * Support --package-merge for the first package version. LP: #812704

bzr-builddeb (2.7.5) unstable; urgency=low

  [ Jelmer Vernooij ]
  * New 'bzr dep3-patch' subcommand that can generate DEP-3 compliant
    patches. LP: #460576

  [ Jonathan Riddell ]
  * Use new set_commit_message() hook in bzr to set the commit
    message from debian/changelog and set fixed bugs in tags. LP: #707274

  [ Jelmer Vernooij ]
  * Add dependency on devscripts >= 2.10.59, required now that 'dch --
    package' is used. LP: #783122
  * Fix support for native packages with dashes in their version in
    sources.list. LP: #796853
  * Fix deprecation warnings for TestCase.failUnlessExists and
    TestCase.failIfExists in bzr 2.4.

  [ Scott Kitterman ]
  * Delete debian/bzr-builddeb.dirs so the long obsolete and empty
    /usr/lib/python2.4/site-packages/bzrlib/plugins/bzr-builddeb/ is no
    longer created. Closes: #631564

  [ Jelmer Vernooij ]
  * Add support for xz and lzma tarballs. LP: #553668
  * When importing upstream component tarballs, don't repack bz2/lzma
    tarballs to gz if the package is in v3 source format. LP: #810531
 -- Andrew Starr-Bochicchio <email address hidden> Mon, 08 Aug 2011 23:53:25 +0000

Changed in bzr-builddeb (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.