"bzr merge --lca" fails when the lca includes NULL_REVISION

Bug #235715 reported by Sven Sandberg
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
John A Meinel

Bug Description

I'm trying to merge trees which I branched the following way:

   $ bzr branch http://bazaar.launchpad.net/~bk-merge/mysql/mysql-6.0-rpl
   Branched 2653 revision(s).
   $ bzr branch http://bazaar.launchpad.net/~bk-merge/mysql/mysql-6.0
   Branched 2648 revision(s).

Then I type:

   $ cd mysql-6.0-rpl
   $ bzr merge --lcs ../mysql-6.0
   Warning: criss-cross merge encountered. See bzr help criss-cross.
   bzr: ERROR: Reserved revision-id {null:}

That last error looks like a bug?

Since "bzr merge ../mysql-6.0" gives 380 conflicts and "bzr merge --weave ../mysql-6.0" does not even show progress for many hours, this is a real showstopper.

Tags: mysql
Revision history for this message
Sven Sandberg (sven-mysql) wrote :

Btw, I'm using bzr 1.3.1 (from Ubuntu 8.04)

Revision history for this message
Sven Sandberg (sven-mysql) wrote :

Sorry, that should of course have been:

   $ bzr --version
   Bazaar (bzr) 1.3.1
     Python interpreter: /usr/bin/python 2.5.2.final.0
     Python standard library: /usr/lib/python2.5
     bzrlib: /usr/lib/python2.5/site-packages/bzrlib
     Bazaar configuration: /home/sven/.bazaar
     Bazaar log file: /home/sven/.bzr.log

   Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
   http://bazaar-vcs.org/

   bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
   you may use, modify and redistribute it under the terms of the GNU
   General Public License version 2 or later.

Revision history for this message
Sven Sandberg (sven-mysql) wrote :
Download full text (3.2 KiB)

======== Contents of /home/sven/.bzr.log: ========
0.116 encoding stdout as sys.stdout encoding 'UTF-8'
0.117 bzr arguments: [u'merge', u'--lca', u'../mysql-6.0']
0.117 looking for plugins in /home/sven/.bazaar/plugins
0.155 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
0.155 Plugin name __init__ already loaded
0.155 Plugin name __init__ already loaded
0.188 opening working tree '/home/sven/bzr/bug/mysql-6.0-rpl'
[ 1477] 2008-05-29 10:36:12.241 WARNING: Warning: criss-cross merge encountered. See bzr help criss-cross.
108.436 Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2895, in run
    verified)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2913, in _do_merge
    conflict_count = merger.do_merge()
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 421, in do_merge
    merge.do_merge()
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 520, in do_merge
    self._compute_transform()
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 558, in _compute_transform
    file_status = self.merge_contents(file_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 843, in merge_contents
    self.text_merge(file_id, trans_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 1078, in text_merge
    lines, conflicts = self._merged_lines(file_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 1105, in _merged_lines
    base=base)
  File "/usr/lib/python2.5/site-packages/bzrlib/tree.py", line 349, in plan_file_lca_merge
    last_revision_base)
  File "/usr/lib/python2.5/site-packages/bzrlib/versionedfile.py", line 532, in plan_lca_merge
    new_plan = _PlanLCAMerge(ver_a, ver_b, self, graph).plan_merge()
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 1440, in __init__
    lca_lines = self.vf.get_lines(lca)
  File "/usr/lib/python2.5/site-packages/bzrlib/versionedfile.py", line 560, in get_lines
    return versionedfile.get_lines(version_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1099, in get_lines
    return self.get_line_list([version_id])[0]
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1137, in get_line_list
    self.check_not_reserved_id(version_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/versionedfile.py", line 62, in check_not_reserved_id
    revision.check_not_reserved_id(version_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/revision.py", line 456, in check_not_reserved_id
    raise errors.ReservedId(revision_id)
ReservedId: Reserved revision-id {null:}

108.490 return code 3

0.097 encoding stdout as sys.stdout encoding 'UTF-8'
0.098 bzr arguments: [u'--version']
0.112 encoding stdout as sys.stdout encoding 'UTF-8'
0.136 return cod...

Read more...

Elliot Murphy (statik)
Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

I think this patch will at least work around the error. I'm trying to understand what is going on, though.
=== modified file 'bzrlib/merge.py'
--- bzrlib/merge.py 2008-05-23 21:45:50 +0000
+++ bzrlib/merge.py 2008-05-29 18:15:59 +0000
@@ -1434,7 +1434,10 @@
         _PlanMergeBase.__init__(self, a_rev, b_rev, vf)
         self.lcas = graph.find_lca(a_rev, b_rev)
         for lca in self.lcas:
- lca_lines = self.vf.get_lines(lca)
+ if _mod_revision.is_null(lca):
+ lca_lines = []
+ else:
+ lca_lines = self.vf.get_lines(lca)
             matcher = patiencediff.PatienceSequenceMatcher(None, self.lines_a,
                                                            lca_lines)
             blocks = list(matcher.get_matching_blocks())

Revision history for this message
John A Meinel (jameinel) wrote :

So I'm attaching the revision graph for this file. It seems the file was created "from scratch" on both sides of the graph. So it is quite valid that "null:" is the common ancestor.

I don't specifically know how the file was created 2x with the same file_id, perhaps it was an unrecorded cherrypick.

Anyway, that certainly could indicate that the above patch is the correct fix. (Modulo indenting issues with how Malone shows inline patches.)

Revision history for this message
John A Meinel (jameinel) wrote :

This is a patch which should apply to bzr 1.3.1 as well as bzr.dev (except for NEWS). I'm not sure what the official resolution will be. Either to just get it into bzr 1.6, or whether this should be backported to some other release.

Changed in bzr:
assignee: nobody → jameinel
milestone: none → 1.6
status: Confirmed → Fix Committed
Revision history for this message
John A Meinel (jameinel) wrote :

This is now in bzr.dev, and should be in bzr 1.6beta1 scheduled to be released in the next 24hrs or so (and 1.6rc1 next week, 1.6-final the week after that.)

Changed in bzr:
status: Fix Committed → 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.