Comment 5 for bug 232113

Revision history for this message
Vincent Ladeuil (vila) wrote :

I can reproduce this bug with a recent bzr (which generate only 114 conflicts instead of 143 thanks
to some other bug fixes :-/), traceback:
BZR_PDB=1 bzr remerge --lca
Warning: criss-cross merge encountered. See bzr help criss-cross.
bzr: ERROR: The file id "sp1f-genericmsvc.h-20080110122110-bnn2j7c6jhbiw4scjarkxgxk2w5xoh22" is not present in the tree <Inventory object at e21abd0, contents="{'sp1f-have_log_bin.require-20070514123848-glb7sh4lf7vnfqt4l77gwhguyc2k2cw4': InventoryFile('sp1f-have_log_bin.require-20070514123848-glb7sh4lf7vnfqt4l77gwhguyc2k2cw4', u'have_log_bin.require', parent_id='sp1d-mysqltest_r-x5knzvhqj2dl73uerge4e24flx5aupsc', sha1='566d3ad4d03fb568d20dd5fde481e10e0fb38018', len=31, <email address hidden>), 'sp1f-clientcert.der-20060503111055-belh4pjgfofrfv4ss6krjapskeho2uk6': InventoryFile('sp1f-clientcert.der-20060503111055-belh4pjgfofrfv4ss6krjapskeho2uk6', u'client-cert.der', parent_id='sp1d-extra_yassl_certs-qlzltwwnxf7xxgjup7s37vagnqovtril', sha1='04927567dc3010224979a839c16261dbbc40347e', len=699, revision=sp1r-msvensson@shellback.(none)-20060503112051-37118), 'sp1f-be_default.h-20071106183210-mnvzyvwpym77uxcwsvgfb3y5bnvorew2': InventoryFile('sp1f-be_default.h-20071106183210-mnvzyvwpym77uxcwsvgfb3y5bnvorew2', u'be_default.h', parent_id='sp1d-sql_backup-kssn2h2a5l2cqskksbk7dvts6pbym5j6', sha1='cda092bd4d88c2b8d5bb5b0aa06db849b022790a', len=8950, revision=sp1r-cbell/Chuck@mysql_cab_desk.-20071203202832-61394), 'sp1f-rpl_ndb_innodb_trans-20060905145203-mopikf2kqymact2krb45jf2j3ss7kegk': InventoryFile('sp1f-rpl_ndb_innodb_trans-20060905145203-mopikf2kqymact2krb45jf2j3ss7kegk', u'rpl_ndb_innodb_trans.test', parent_id='sp1d-mysqltest_suite_rpl_ndb_t-5daypjzb3gdodf7j5dgrrwfq2wbjs3jh', sha1='e5a6462ce1f5e59b55e0673c30fab9c1a5bdd97b', len=1521, <email address hidden>), 'sp1f-myisam_tb3.inc-20070206175435-46ozmsyoeusi6vqkhzhowmiyzh7iqxd5': InventoryFile('sp1f-myisam_tb3.inc-20070206175435-46ozmsyoeusi6vqkhzhowmiyzh7iqxd5', u'myisam_tb3.inc', parent_id='sp1d-mysqltest_suite_funcs_1_include-lku56dwgrx62ghafw3tek3oa5qnapu7d', sha1='cbba7f7455f9bdd558902bcca3dc962ea471976f', len=2267, revision=sp1r-joerg@debian.(none)-20070727113232-19339), 'sp1f-falcon_bug_22179.tes-20070920154325-xkh5yfl7opoxsxhc7euxjeqli2gh6yn5': InventoryFile('sp1f-falcon_bug_22179.tes-20070920154325-xkh5yfl7opoxsxhc7euxjeqli2gh6yn5', u'fa...}">.
**** entering debugger
 /home/vila/src/bzr/trunk/bzrlib/inventory.py(1264)__getitem__()
-> raise errors.NoSuchId(self, file_id)
(Pdb) bt
  /home/vila/src/bzr/trunk/bzrlib/commands.py(835)exception_to_return_code()
-> return the_callable(*args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/commands.py(1039)run_bzr()
-> ret = run(*run_argv)
  /home/vila/src/bzr/trunk/bzrlib/commands.py(643)run_argv_aliases()
-> return self.run_direct(**all_cmd_args)
  /home/vila/src/bzr/trunk/bzrlib/commands.py(647)run_direct()
-> return self._operation.run_simple(*args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/cleanup.py(122)run_simple()
-> self.cleanups, self.func, *args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/cleanup.py(156)_do_with_cleanups()
-> result = func(*args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/builtins.py(4104)run()
-> conflicts = merger.do_merge()
  /home/vila/src/bzr/trunk/bzrlib/merge.py(657)do_merge()
-> merge = operation.run_simple()
  /home/vila/src/bzr/trunk/bzrlib/cleanup.py(122)run_simple()
-> self.cleanups, self.func, *args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/cleanup.py(156)_do_with_cleanups()
-> result = func(*args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/merge.py(628)_do_merge_to()
-> merge.do_merge()
  /home/vila/src/bzr/trunk/bzrlib/merge.py(764)do_merge()
-> operation.run()
  /home/vila/src/bzr/trunk/bzrlib/cleanup.py(118)run()
-> self.cleanups, self.func, self, *args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/cleanup.py(156)_do_with_cleanups()
-> result = func(*args, **kwargs)
  /home/vila/src/bzr/trunk/bzrlib/merge.py(769)_do_merge()
-> self._compute_transform()
  /home/vila/src/bzr/trunk/bzrlib/merge.py(807)_compute_transform()
-> file_status = self._do_merge_contents(file_id)
  /home/vila/src/bzr/trunk/bzrlib/merge.py(1294)_do_merge_contents()
-> hook_status, lines = hook.merge_contents(params)
  /home/vila/src/bzr/trunk/bzrlib/merge.py(1385)merge_contents()
-> merge_hook_params.trans_id)
  /home/vila/src/bzr/trunk/bzrlib/merge.py(1638)text_merge()
-> lines, base_lines = self._merged_lines(file_id)
  /home/vila/src/bzr/trunk/bzrlib/merge.py(1617)_merged_lines()
-> plan = self._generate_merge_plan(file_id, base)
  /home/vila/src/bzr/trunk/bzrlib/merge.py(1659)_generate_merge_plan()
-> base=base)
  /home/vila/src/bzr/trunk/bzrlib/tree.py(494)plan_file_lca_merge()
-> data = self._get_plan_merge_data(file_id, other, base)
  /home/vila/src/bzr/trunk/bzrlib/tree.py(465)_get_plan_merge_data()
-> last_revision_a = self._get_file_revision(file_id, vf, 'this:')
  /home/vila/src/bzr/trunk/bzrlib/tree.py(522)_get_file_revision()
-> self._iter_parent_trees()]
  /home/vila/src/bzr/trunk/bzrlib/tree.py(512)_file_revision()
-> return revision_tree.inventory[file_id].revision
> /home/vila/src/bzr/trunk/bzrlib/inventory.py(1264)__getitem__()
-> raise errors.NoSuchId(self, file_id)
(Pdb)

There are several problems here:
1) We don't revert the tree properly,
2) We fail to retrieve the file revision because it's involved in an unresolved conflict

This can't be addressed simply (we first need to either revert properly or at least stop
with a warning before trying to remerge).

The workaround is to do:
  bzr revert [--no-backup]
  bzr clean-tree --detritus (checking that no precious unversioned files will be deleted)
  bzr merge --lca

I'll tags this bug and will come back to it later.